"ts/webui/src/vscode:/vscode.git/clone" did not exist on "7978c25a3f9ebc94a979ccec47b4fdc46099a5be"
SetupNniDeveloperEnvironment.md 2.24 KB
Newer Older
1
# Setup NNI development environment
2

3
NNI development environment supports Ubuntu 1604 (or above), and Windows 10 with Python3 64bit.
4

5
## Installation
6

7
The installation steps are similar with installing from source code. But the installation links to code directory, so that code changes can be applied to installation as easy as possible.
8

9
### 1. Clone source code
10

11
```bash
12
13
14
git clone https://github.com/Microsoft/nni.git
```

15
Note, if you want to contribute code back, it needs to fork your own NNI repo, and clone from there.
16

17
### 2. Install from source code
18

19
#### Ubuntu
20

21
22
```bash
make dev-easy-install
23
24
```

25
#### Windows
26

27
28
```bat
powershell -ExecutionPolicy Bypass -file install.ps1 -Development
29
30
```

31
### 3. Check if the environment is ready
32
33
34
35

Now, you can try to start an experiment to check if your environment is ready.
For example, run the command

36
37
```bash
nnictl create --config examples/trials/mnist-tfv1/config.yml
38
39
40
41
```

And open WebUI to check if everything is OK

42
### 4. Reload changes
43
44
45

#### Python

46
Nothing to do, the code is already linked to package folders.
47
48
49

#### TypeScript

50
* If `src/nni_manager` is changed, run `yarn watch` under this folder. It will watch and build code continually. The `nnictl` need to be restarted to reload NNI manager.
51
52
* If `src/webui` is changed, run `yarn dev`, which will run a mock API server and a webpack dev server simultaneously. Use `EXPERIMENT` environment variable (e.g., `mnist-tfv1-running`) to specify the mock data being used. Built-in mock experiments are listed in `src/webui/mock`. An example of the full command is `EXPERIMENT=mnist-tfv1-running yarn dev`.
* If `src/nasui` is changed, run `yarn start` under the corresponding folder. The web UI will refresh automatically if code is changed. There is also a mock API server that is useful when developing. It can be launched via `node server.js`.
53

54
55
56
57
58
### 5. Submit Pull Request

All changes are merged to master branch from your forked repo. The description of Pull Request must be meaningful, and useful.

We will review the changes as soon as possible. Once it passes review, we will merge it to master branch.
59

60
For more contribution guidelines and coding styles, you can refer to the [contributing document](Contributing.md).