SetupNNIDeveloperEnvironment.md 1.42 KB
Newer Older
1
**Set up NNI developer environment**
Chi Song's avatar
Chi Song committed
2

Gems Guo's avatar
Gems Guo committed
3
===
Chi Song's avatar
Chi Song committed
4

Gems Guo's avatar
Gems Guo committed
5
6
7
8
9
10
11
## 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.

**1. Clone the source code**

Run the command
Chi Song's avatar
Chi Song committed
12

Gems Guo's avatar
Gems Guo committed
13
14
15
```
git clone https://github.com/Microsoft/nni.git
```
Chi Song's avatar
Chi Song committed
16

Gems Guo's avatar
Gems Guo committed
17
18
19
20
21
to clone the source code

**2. Prepare the debug environment and install dependencies**

Change directory to the source code folder, then run the command
Chi Song's avatar
Chi Song committed
22

Gems Guo's avatar
Gems Guo committed
23
24
25
```
make install-dependencies
```
Chi Song's avatar
Chi Song committed
26

Gems Guo's avatar
Gems Guo committed
27
28
29
30
31
to install the dependent tools for the environment

**3. Build source code**

Run the command
Chi Song's avatar
Chi Song committed
32

Gems Guo's avatar
Gems Guo committed
33
34
35
```
make build
```
Chi Song's avatar
Chi Song committed
36

Gems Guo's avatar
Gems Guo committed
37
38
39
40
41
to build the source code

**4. Install NNI to development environment**

Run the command
Chi Song's avatar
Chi Song committed
42

Gems Guo's avatar
Gems Guo committed
43
44
45
```
make dev-install
```
Chi Song's avatar
Chi Song committed
46

Gems Guo's avatar
Gems Guo committed
47
48
49
50
to install the distribution content to development environment, and create cli scripts

**5. Check if the environment is ready**

Darío Hereñú's avatar
Darío Hereñú committed
51
Now, you can try to start an experiment to check if your environment is ready.
Gems Guo's avatar
Gems Guo committed
52
For example, run the command
Chi Song's avatar
Chi Song committed
53

Gems Guo's avatar
Gems Guo committed
54
55
56
```
nnictl create --config ~/nni/examples/trials/mnist/config.yml
```
Chi Song's avatar
Chi Song committed
57

goooxu's avatar
goooxu committed
58
And open WebUI to check if everything is OK
Gems Guo's avatar
Gems Guo committed
59
60
61

**6. Redeploy**

62
After the code changes, use **step 3** to rebuild your codes, then the changes will take effect immediately.
Gems Guo's avatar
Gems Guo committed
63
64

---
Vipul Gupta's avatar
Vipul Gupta committed
65
At last, wish you have a wonderful day.
66
For more contribution guidelines on making PR's or issues to NNI source code, you can refer to our [CONTRIBUTING](./CONTRIBUTING.md) document.