SetupNniDeveloperEnvironment.md 1.9 KB
Newer Older
1
2
3
4
5
6
7
8
**Set up NNI developer environment**

===

## Best practice for debug NNI source code

For debugging NNI source code, your development environment should be under Ubuntu 16.04 (or above) system with python 3 and pip 3 installed, then follow the below steps.

9
### 1. Clone the source code
10
11
12
13
14
15
16
17
18

Run the command

```
git clone https://github.com/Microsoft/nni.git
```

to clone the source code

19
### 2. Prepare the debug environment and install dependencies
20
21
22
23
24
25
26
27
28

Change directory to the source code folder, then run the command

```
make install-dependencies
```

to install the dependent tools for the environment

29
### 3. Build source code
30
31
32
33
34
35
36
37
38

Run the command

```
make build
```

to build the source code

39
### 4. Install NNI to development environment
40
41
42
43
44
45
46
47
48

Run the command

```
make dev-install
```

to install the distribution content to development environment, and create cli scripts

49
### 5. Check if the environment is ready
50
51
52
53
54

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

```
55
nnictl create --config ~/nni/examples/trials/mnist-tfv1/config.yml
56
57
58
59
```

And open WebUI to check if everything is OK

60
61
62
63
64
65
66
67
68
69
### 6. Redeploy

After the code changes, it may need to redeploy. It depends on what kind of code changed. 

#### Python

It doesn't need to redeploy, but the nnictl may need to be restarted.

#### TypeScript

70
71
* If `src/nni_manager` is changed, run `yarn watch` continually under this folder. It will rebuild code instantly. The nnictl may need to be restarted to reload NNI manager.
* If `src/webui` or `src/nasui` are changed, run `yarn start` under the corresponding folder. The web UI will refresh automatically if code is changed.
72
73
74
75


---
At last, wish you have a wonderful day.
76
For more contribution guidelines on making PR's or issues to NNI source code, you can refer to our [Contributing](Contributing.md) document.