NNI development environment supports Ubuntu 1604 (or above), and Windows 10 with Python3 64bit.
## Best practice for debug NNI source code
## Installation
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.
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.
### 1. Clone the source code
### 1. Clone source code
Run the command
```bash
```
git clone https://github.com/Microsoft/nni.git
git clone https://github.com/Microsoft/nni.git
```
```
to clone the source code
Note, if you want to contribute code back, it needs to fork your own NNI repo, and clone from there.
### 2. Prepare the debug environment and install dependencies
### 2. Install from source code
Change directory to the source code folder, then run the command
#### Ubuntu
```bash
make dev-easy-install
```
```
make install-dependencies
```
to install the dependent tools for the environment
After the code changes, it may need to redeploy. It depends on what kind of code changed.
#### Python
#### Python
It doesn't need to redeploy, but the nnictl may need to be restarted.
Nothing to do, the code is already linked to package folders.
#### TypeScript
#### TypeScript
* 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/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.
* 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.
* 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.
### 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.
---
For more contribution guidelines and coding styles, you can refer to the [contributing document](Contributing.md).
At last, wish you have a wonderful day.
For more contribution guidelines on making PR's or issues to NNI source code, you can refer to our [Contributing](Contributing.md) document.