Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NNI on Windows for NNI Remote mode #1073

Merged
merged 392 commits into from May 27, 2019
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
392 commits
Select commit Hold shift + click to select a range
b823708
test python
Apr 2, 2019
4722e52
test python36
Apr 2, 2019
767e817
debug python
Apr 2, 2019
5c930bf
debug python
Apr 2, 2019
9989d2d
debug
Apr 2, 2019
d095547
python version
Apr 2, 2019
b014243
test python
Apr 2, 2019
1509449
debug
Apr 2, 2019
846b3df
install nni
Apr 2, 2019
3151e10
install nni
Apr 2, 2019
5789190
test powershell
Apr 2, 2019
2839834
debug python
Apr 2, 2019
12e286b
test
Apr 2, 2019
07d8510
test python
Apr 2, 2019
5478626
use python
Apr 2, 2019
3db9a07
test python
Apr 2, 2019
6e41e45
test python
Apr 2, 2019
89d9a47
test
Apr 2, 2019
9f683b4
update
Apr 2, 2019
16dc2c8
test powershell
Apr 2, 2019
6f4931a
debug python
Apr 2, 2019
7f1a290
debug python
Apr 2, 2019
9c4248e
debug python
Apr 2, 2019
751f5f5
debug powershell
Apr 2, 2019
dfaa8ca
debug
Apr 2, 2019
9a75cd6
debug
Apr 2, 2019
2fc065e
debug install.ps1
Apr 2, 2019
3f7e9e5
Merge branch 'master' of https://github.com/demianzhang/nni into dev-…
Apr 2, 2019
f562510
add continueOnError: true
Apr 2, 2019
3ce1846
debug
Apr 2, 2019
6bc8c31
debug
Apr 2, 2019
af68b07
update
Apr 2, 2019
5247615
update
Apr 2, 2019
e7c22e9
add unittest
Apr 2, 2019
e0870ee
test node
Apr 2, 2019
57df89a
update
Apr 2, 2019
1e5492b
update joi
Apr 2, 2019
1591681
debug joi
Apr 2, 2019
f3ddb90
add joi
Apr 2, 2019
cad333d
debug joi
Apr 2, 2019
0a7549f
Update install
demianzhang Apr 2, 2019
05e4e9e
update
Apr 2, 2019
cc60f39
update
Apr 2, 2019
1ffb176
add unittest
Apr 2, 2019
bc7163c
add convert command
Apr 3, 2019
28b2894
add example
Apr 3, 2019
83cafbb
fix windows commands
Apr 3, 2019
d8ec84f
debug
Apr 3, 2019
c1605bd
fix tensorflow version
Apr 3, 2019
a972b48
fix pipeline
Apr 3, 2019
7f79ebf
update
Apr 3, 2019
d95c351
Merge pull request #155 from Microsoft/master
SparkSnail Apr 3, 2019
8e77ca5
fix conflict
Apr 3, 2019
9a5d50c
add gpu logic in windows
Apr 3, 2019
f304bfd
update
Apr 3, 2019
5337d18
update
Apr 3, 2019
08d49cc
debug
Apr 3, 2019
b47236d
fix commands
Apr 3, 2019
236e463
fix commands
Apr 3, 2019
1ed0230
update
Apr 3, 2019
abcb93e
update
Apr 3, 2019
07f4a00
Fix comments
demianzhang Apr 3, 2019
26aff74
update
Apr 3, 2019
9c4c54c
fix kill command
Apr 3, 2019
5a83e25
Merge remote-tracking branch 'upstream/master' into dev-local
demianzhang Apr 3, 2019
fe86617
Merge pull request #9 from demianzhang/dev-local
demianzhang Apr 3, 2019
2b3e99c
Merge branch 'master' of https://github.com/demianzhang/nni into dev-…
Apr 3, 2019
6fee8fc
Merge pull request #10 from SparkSnail/dev-windows
demianzhang Apr 3, 2019
1e1424f
fix package.json
Apr 3, 2019
e13afbb
Update package.json
demianzhang Apr 3, 2019
0cf62d8
Refactor runScript
demianzhang Apr 4, 2019
6da72ec
Fix bug
demianzhang Apr 4, 2019
0f9c1bd
Fix comments
demianzhang Apr 5, 2019
852118b
Fix execKill
demianzhang Apr 5, 2019
0cb9a18
Update
demianzhang Apr 5, 2019
ee2bc29
Update
demianzhang Apr 5, 2019
f763344
Merge pull request #11 from demianzhang/dev-local
demianzhang Apr 5, 2019
52f029f
Add unittest back
demianzhang Apr 5, 2019
65cc094
Rollback install node
demianzhang Apr 5, 2019
768cebf
Merge pull request #12 from demianzhang/master
demianzhang Apr 6, 2019
4266083
Fix gpu memory
demianzhang Apr 6, 2019
4cef85d
Merge pull request #13 from demianzhang/dev-local
demianzhang Apr 6, 2019
2ceb17f
Update
demianzhang Apr 6, 2019
039ea84
Merge remote-tracking branch 'upstream/master' into dev-local
demianzhang Apr 7, 2019
e4a1ef0
Merge pull request #14 from demianzhang/dev-local
demianzhang Apr 7, 2019
c8dbdd3
Rollback check process
demianzhang Apr 8, 2019
f548224
Merge remote-tracking branch 'upstream/master' into dev-local
demianzhang Apr 8, 2019
606308d
Update mnist-hyperband.test.yml
demianzhang Apr 8, 2019
556ee5f
Merge pull request #15 from demianzhang/dev-local
demianzhang Apr 8, 2019
ab66d76
Update pipelines-it-local-windows.yml
demianzhang Apr 9, 2019
4e6835a
Merge remote-tracking branch 'upstream/master' into dev-local
demianzhang Apr 9, 2019
d426e18
Update uninstall.ps1
demianzhang Apr 9, 2019
6c11e48
Merge pull request #16 from demianzhang/dev-local
demianzhang Apr 9, 2019
cbf01d4
Merge remote-tracking branch 'upstream/master' into dev-local
demianzhang Apr 10, 2019
81e311d
Fix virtual environment
demianzhang Apr 10, 2019
0ae15f8
Fix tar
demianzhang Apr 11, 2019
66301a0
Merge remote-tracking branch 'upstream/master' into dev-local
demianzhang Apr 11, 2019
a8557e9
Merge pull request #17 from demianzhang/dev-local
demianzhang Apr 11, 2019
9756126
Fix isAlive
demianzhang Apr 11, 2019
12049cb
Merge remote-tracking branch 'upstream/master' into dev-local
demianzhang Apr 12, 2019
5048433
Merge pull request #18 from demianzhang/dev-local
demianzhang Apr 12, 2019
9bb9e54
Merge branch 'master' of https://github.com/demianzhang/nni into dev-…
Apr 12, 2019
30ee182
change gpu index logic
Apr 12, 2019
f2ebe0a
test gpu index
Apr 12, 2019
8a0ce61
fix pipeline
Apr 12, 2019
41269fb
add cifar10
Apr 12, 2019
9a5392b
fix cifar10
Apr 12, 2019
0a74ff9
remove gpu in cifar10
Apr 12, 2019
0a4acd1
test mnist gpu
Apr 12, 2019
d8c5f76
update
Apr 13, 2019
8e06248
debug
Apr 13, 2019
d1d1fc5
Fix comments
demianzhang Apr 13, 2019
ac7ee0f
debug
Apr 14, 2019
d634c38
Update install.ps1
demianzhang Apr 14, 2019
8155e13
debug
Apr 14, 2019
9b060cb
update gpu metrics shell
Apr 14, 2019
5436f0c
debug
Apr 14, 2019
eacbd3b
debug
Apr 14, 2019
38aeb78
debug
Apr 14, 2019
15f1ec7
debug
Apr 15, 2019
96c8e9a
debug
Apr 15, 2019
dd08a3f
debug sigbreak
Apr 15, 2019
872894d
Preinstall node-pre-gyp
demianzhang Apr 15, 2019
9f7d424
Merge pull request #19 from demianzhang/dev-local
demianzhang Apr 15, 2019
b482980
Update Installation.md
demianzhang Apr 15, 2019
532039c
Update Installation.md
demianzhang Apr 15, 2019
cd2efe3
Remove install node-pre-gyp
demianzhang Apr 15, 2019
cfcc5b6
Merge remote-tracking branch 'upstream/master' into dev-local
demianzhang Apr 15, 2019
190e983
Merge pull request #20 from demianzhang/dev-local
demianzhang Apr 15, 2019
c2a1498
use taskkill to stop node process
Apr 16, 2019
c09a44c
use ctl+c event to stop process
Apr 16, 2019
a2a5521
add sigtrem signal in stop logic
Apr 16, 2019
7faedd7
add ctl+break command
Apr 16, 2019
c973994
Update isAlive
demianzhang Apr 16, 2019
c305e99
debug sigterm
Apr 16, 2019
fe51747
Update pypi readme
demianzhang Apr 16, 2019
e380291
Update
demianzhang Apr 16, 2019
df895f2
fix stop logic
Apr 16, 2019
08fdfbe
fix pipeline, add cifar10
Apr 16, 2019
94964d8
revert mnist, remove gpu
Apr 16, 2019
805871a
Fix virtualenv
demianzhang Apr 16, 2019
f75fda7
Merge pull request #21 from SparkSnail/dev-windows
demianzhang Apr 16, 2019
653cecb
Fix comments
demianzhang Apr 16, 2019
5192aee
Merge remote-tracking branch 'upstream/master'
demianzhang Apr 16, 2019
e7fa1b6
Update
demianzhang Apr 16, 2019
7460fe3
Update
demianzhang Apr 16, 2019
5f10b03
Fix install
demianzhang Apr 17, 2019
c0ea770
Update install.ps1
demianzhang Apr 17, 2019
2d6b925
Update install.ps1
demianzhang Apr 17, 2019
d200961
Fix comments
demianzhang Apr 18, 2019
84913f9
Fix virtualenv install
demianzhang Apr 18, 2019
d2337e7
Update
demianzhang Apr 18, 2019
eb663f0
Merge remote-tracking branch 'upstream/master'
demianzhang Apr 18, 2019
37d43b8
Update
demianzhang Apr 18, 2019
5fdd463
Fix comments
demianzhang Apr 19, 2019
ef9601e
Update
demianzhang Apr 19, 2019
fd6afcb
Update install.ps1
demianzhang Apr 19, 2019
1aaf67d
Merge remote-tracking branch 'upstream/master'
demianzhang Apr 19, 2019
ea4bdcd
Update
demianzhang Apr 19, 2019
242d121
Merge remote-tracking branch 'upstream/master'
demianzhang Apr 19, 2019
5708787
Merge remote-tracking branch 'upstream/master'
demianzhang Apr 19, 2019
2f08cdb
Update localTrainingService.ts
demianzhang Apr 19, 2019
1bcb498
Update
demianzhang Apr 19, 2019
438f51d
Update
demianzhang Apr 21, 2019
6878c34
Merge remote-tracking branch 'upstream/master'
demianzhang Apr 22, 2019
8aa0ee1
Update
demianzhang Apr 27, 2019
37a5860
Merge remote-tracking branch 'upstream/v0.7' into dev-remote
demianzhang Apr 27, 2019
2c9bebc
Update
demianzhang Apr 28, 2019
cb0b33e
Update
demianzhang Apr 28, 2019
95381d4
Merge remote-tracking branch 'upstream/v0.7' into dev-remote
demianzhang Apr 28, 2019
1180475
Update util.ts
demianzhang Apr 29, 2019
e2155fe
Update utils.ts
demianzhang Apr 29, 2019
969fd9b
Fix system slash
demianzhang Apr 29, 2019
bdf48c9
Update tmp dir
demianzhang Apr 29, 2019
c5ce1b9
Fix system slash
demianzhang Apr 29, 2019
d2b753b
Use python3 in remote
demianzhang May 4, 2019
fcdf3be
Write tar command to file
demianzhang May 4, 2019
d4348b4
Update tar
demianzhang May 4, 2019
b3329c3
Update
demianzhang May 4, 2019
3a3d9bf
Update
demianzhang May 5, 2019
47b1a20
Fix stop
demianzhang May 6, 2019
287ec67
Update StopSignal type
demianzhang May 6, 2019
dd6f15d
Add removeTrialJobMetricListener
demianzhang May 6, 2019
2870327
remove Listeners
demianzhang May 6, 2019
3bca449
Update listener
demianzhang May 6, 2019
342a4e8
Update
demianzhang May 6, 2019
5a2e177
Use Temp dir
demianzhang May 7, 2019
6081365
Use Temp dir
demianzhang May 7, 2019
6681758
Merge remote-tracking branch 'upstream/master' into dev-remote
demianzhang May 7, 2019
3479741
Add remote windows pipeline
demianzhang May 7, 2019
08a4163
Update pipelines-it-remote-windows.yml
demianzhang May 7, 2019
78cfd6f
Update
demianzhang May 7, 2019
54d5822
remote build wheel
demianzhang May 7, 2019
c906033
Update pipelines-it-remote-windows.yml
demianzhang May 7, 2019
ea42903
debug
demianzhang May 7, 2019
c39b58c
debug
demianzhang May 7, 2019
b9d3b1c
Use docker source install
demianzhang May 7, 2019
b65f04b
Update
demianzhang May 7, 2019
4ba62ac
Update
demianzhang May 7, 2019
0f601d0
Rollback remote build wheel
demianzhang May 8, 2019
f4329a3
Use self node and yarn
demianzhang May 8, 2019
1e85cb5
Fix docker source install
demianzhang May 8, 2019
949190f
Rollback Makefile
demianzhang May 8, 2019
776f37d
Upgrade docker pip
demianzhang May 8, 2019
84e1eb6
Update
demianzhang May 8, 2019
66d3017
Update
demianzhang May 8, 2019
b46f8fa
Remote build wheel
demianzhang May 8, 2019
958e65a
Use inline runOptions
demianzhang May 8, 2019
0d06216
Hide wget output
demianzhang May 9, 2019
a25ba30
Add continueOnError
demianzhang May 9, 2019
a1eab0d
Update
demianzhang May 9, 2019
d9f68b4
Update
demianzhang May 9, 2019
30b3d31
Update
demianzhang May 9, 2019
d8af7bd
Upgrade pip
demianzhang May 9, 2019
c37d565
Add chmod
demianzhang May 9, 2019
05c284a
Update
demianzhang May 9, 2019
3600a19
debug
demianzhang May 9, 2019
07c06f6
Update
demianzhang May 9, 2019
919f3bb
Use pscp
demianzhang May 9, 2019
8cf7afd
Update
demianzhang May 9, 2019
6c1b677
Download putty
demianzhang May 9, 2019
58f9ddc
Update
demianzhang May 9, 2019
82e3446
Update
demianzhang May 9, 2019
ccf48ca
Update
demianzhang May 9, 2019
10055d2
Update
demianzhang May 9, 2019
77b039f
Update
demianzhang May 9, 2019
12dd9ca
Update
demianzhang May 9, 2019
36a1640
Update
demianzhang May 9, 2019
d6b3fe6
Update
demianzhang May 9, 2019
28b73d5
Update
demianzhang May 9, 2019
9deca8b
debug
demianzhang May 10, 2019
f7b19dc
exclude metis
demianzhang May 10, 2019
2abf150
Refactor pathJoin
demianzhang May 10, 2019
97ae7ac
Update
demianzhang May 10, 2019
ddc4cac
debug metis
demianzhang May 12, 2019
6670679
debug metis
demianzhang May 12, 2019
fa702a8
Update
demianzhang May 12, 2019
faa4832
Update dependency
demianzhang May 13, 2019
f50f04b
Merge remote-tracking branch 'upstream/master' into dev-win-remote
demianzhang May 13, 2019
d9bb396
Fix comments
demianzhang May 13, 2019
afb44e7
Update
demianzhang May 13, 2019
a2b9538
Fix tslint
demianzhang May 14, 2019
9828cc6
Merge remote-tracking branch 'upstream/master' into dev-win-remote
demianzhang May 15, 2019
8a10f6e
Fix comments
demianzhang May 15, 2019
9968b70
Fix comments
demianzhang May 15, 2019
fe18855
add doc
demianzhang May 19, 2019
7ca7907
Merge remote-tracking branch 'upstream/master' into dev-win-remote
demianzhang May 23, 2019
643e9a8
Fix comments
demianzhang May 23, 2019
fb2deed
Update
demianzhang May 23, 2019
250a310
Update doc
demianzhang May 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -106,15 +106,15 @@ We encourage researchers and students leverage these projects to accelerate the

## **Install & Verify**

If you choose NNI Windows local mode and you use PowerShell to run script for the first time, you need to **run PowerShell as administrator** with this command first:
If you are using NNI on Windows and use PowerShell to run script for the first time, you need to **run PowerShell as administrator** with this command first:

```bash
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
```

**Install through pip**

* We support Linux, MacOS and Windows(local mode) in current stage, Ubuntu 16.04 or higher, MacOS 10.14.1 along with Windows 10.1809 are tested and supported. Simply run the following `pip install` in an environment that has `python >= 3.5`.
* We support Linux, MacOS and Windows(local, remote and pai mode) in current stage, Ubuntu 16.04 or higher, MacOS 10.14.1 along with Windows 10.1809 are tested and supported. Simply run the following `pip install` in an environment that has `python >= 3.5`.

Linux and MacOS

Expand All @@ -131,12 +131,12 @@ python -m pip install --upgrade nni
Note:

* `--user` can be added if you want to install NNI in your home directory, which does not require any special privileges.
* Currently NNI on Windows only support local mode. Anaconda or Miniconda is highly recommended to install NNI on Windows.
* Currently NNI on Windows support local, remote and pai mode. Anaconda or Miniconda is highly recommended to install NNI on Windows.
* If there is any error like `Segmentation fault`, please refer to [FAQ](docs/en_US/FAQ.md)

**Install through source code**

* We support Linux (Ubuntu 16.04 or higher), MacOS (10.14.1) and Windows local mode (10.1809) in our current stage.
* We support Linux (Ubuntu 16.04 or higher), MacOS (10.14.1) and Windows (10.1809) in our current stage.

Linux and MacOS

Expand All @@ -160,7 +160,7 @@ Windows

For the system requirements of NNI, please refer to [Install NNI](docs/en_US/Installation.md)

For NNI Windows local mode, please refer to [NNI Windows local mode](docs/en_US/WindowsLocalMode.md)
For NNI on Windows, please refer to [NNI on Windows](docs/en_US/NniOnWindows.md)

**Verify install**

Expand Down
18 changes: 12 additions & 6 deletions deployment/pypi/Makefile
Expand Up @@ -20,22 +20,28 @@ ifeq ($(version_ts), true)
NNI_VERSION_VALUE := $(NNI_VERSION_VALUE).$(TIME_STAMP)
endif
NNI_VERSION_TEMPLATE = 999.0.0-developing

NNI_YARN_TARBALL ?= $(CWD)nni-yarn.tar.gz
NNI_YARN_FOLDER ?= $(CWD)nni-yarn
NNI_YARN := PATH=$(CWD)node-$(OS_SPEC)-x64/bin:$${PATH} $(NNI_YARN_FOLDER)/bin/yarn
.PHONY: build
build:
python3 -m pip install --user --upgrade setuptools wheel
wget https://aka.ms/nni/nodejs-download/$(OS_SPEC) -O $(CWD)node-$(OS_SPEC)-x64.tar.xz
wget -q https://aka.ms/nni/nodejs-download/$(OS_SPEC) -O $(CWD)node-$(OS_SPEC)-x64.tar.xz
rm -rf $(CWD)node-$(OS_SPEC)-x64
mkdir $(CWD)node-$(OS_SPEC)-x64
tar xf $(CWD)node-$(OS_SPEC)-x64.tar.xz -C node-$(OS_SPEC)-x64 --strip-components 1
cd $(CWD)../../src/nni_manager && yarn && yarn build
cd $(CWD)../../src/webui && yarn && yarn build
wget -q https://aka.ms/yarn-download -O $(NNI_YARN_TARBALL)
rm -rf $(NNI_YARN_FOLDER)
mkdir $(NNI_YARN_FOLDER)
tar -xf $(NNI_YARN_TARBALL) -C $(NNI_YARN_FOLDER) --strip-components 1
cd $(CWD)../../src/nni_manager && $(NNI_YARN) && $(NNI_YARN) build
cd $(CWD)../../src/webui && $(NNI_YARN) && $(NNI_YARN) build
rm -rf $(CWD)nni
cp -r $(CWD)../../src/nni_manager/dist $(CWD)nni
cp -r $(CWD)../../src/webui/build $(CWD)nni/static
cp $(CWD)../../src/nni_manager/package.json $(CWD)nni
sed -ie 's/$(NNI_VERSION_TEMPLATE)/$(NNI_VERSION_VALUE)/' $(CWD)nni/package.json
cd $(CWD)nni && yarn --prod
cd $(CWD)nni && $(NNI_YARN) --prod
cd $(CWD) && sed -ie 's/$(NNI_VERSION_TEMPLATE)/$(NNI_VERSION_VALUE)/' setup.py && python3 setup.py bdist_wheel -p $(WHEEL_SPEC)
cd $(CWD)

Expand All @@ -50,4 +56,4 @@ clean:
rm -rf $(CWD)dist
rm -rf $(CWD)nni
rm -rf $(CWD)nni.egg-info
rm -rf $(CWD)node-$(OS_SPEC)-x64
rm -rf $(CWD)node-$(OS_SPEC)-x64
4 changes: 2 additions & 2 deletions docs/en_US/FAQ.md
Expand Up @@ -36,8 +36,8 @@ Unable to open the WebUI may have the following reasons:
* If you still can't see the WebUI after you use the server IP, you can check the proxy and the firewall of your machine. Or use the browser on the machine where you start your NNI experiment.
* Another reason may be your experiment is failed and NNI may fail to get the experiment infomation. You can check the log of NNImanager in the following directory: ~/nni/experiment/[your_experiment_id] /log/nnimanager.log

### Windows local mode problems
Please refer to [NNI Windows local mode](WindowsLocalMode.md)
### NNI on Windows problems
Please refer to [NNI on Windows](NniOnWindows.md)

### Help us improve
Please inquiry the problem in https://github.com/Microsoft/nni/issues to see whether there are other people already reported the problem, create a new one if there are no existing issues been created.
2 changes: 1 addition & 1 deletion docs/en_US/Installation.md
@@ -1,6 +1,6 @@
# Installation of NNI

Currently we support installation on Linux, Mac and Windows(local mode).
Currently we support installation on Linux, Mac and Windows(local, remote and pai mode).

## **Installation on Linux & Mac**

Expand Down
@@ -1,6 +1,6 @@
# Windows Local Mode (experimental feature)

Currently we only support local mode on Windows. Windows 10.1809 is well tested and recommended.
Currently we support local, remote and pai mode on Windows. Windows 10.1809 is well tested and recommended.

## **Installation on Windows**

Expand Down
6 changes: 3 additions & 3 deletions docs/en_US/QuickStart.md
Expand Up @@ -2,15 +2,15 @@

## Installation

We support Linux MacOS and Windows(local mode) in current stage, Ubuntu 16.04 or higher, MacOS 10.14.1 and Windows 10.1809 are tested and supported. Simply run the following `pip install` in an environment that has `python >= 3.5`.
We support Linux MacOS and Windows in current stage, Ubuntu 16.04 or higher, MacOS 10.14.1 and Windows 10.1809 are tested and supported. Simply run the following `pip install` in an environment that has `python >= 3.5`.
#### Linux and MacOS

```bash
python3 -m pip install --upgrade nni
```

#### Windows
If you choose Windows local mode and use PowerShell to run script, you need run below PowerShell command as administrator at first time.
If you are using NNI on Windows, you need run below PowerShell command as administrator at first time.
```bash
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
```
Expand Down Expand Up @@ -151,7 +151,7 @@ Run the **config.yml** file from your command line to start MNIST experiment.
#### Windows
Run the **config_windows.yml** file from your command line to start MNIST experiment.

**Note**, if you're using windows local mode, it needs to change `python3` to `python` in the config.yml file, or use the config_windows.yml file to start the experiment.
**Note**, if you're using NNI on Windows, it needs to change `python3` to `python` in the config.yml file, or use the config_windows.yml file to start the experiment.

```bash
nnictl create --config nni/examples/trials/mnist/config_windows.yml
Expand Down
12 changes: 11 additions & 1 deletion docs/en_US/RemoteMachineMode.md
Expand Up @@ -55,7 +55,8 @@ machineList:
username: bob
passwd: bob123
```

You can use different systems to run experiments on the remote machine.
#### Linux and MacOS
Simply filling the `machineList` section and then run:

```bash
Expand All @@ -64,5 +65,14 @@ nnictl create --config ~/nni/examples/trials/mnist-annotation/config_remote.yml

to start the experiment.

#### Windows
Simply filling the `machineList` section and then run:

```bash
nnictl create --config %userprofile%\nni\examples\trials\mnist-annotation\config_remote.yml
```

to start the experiment.

## version check
NNI support version check feature in since version 0.6, [refer](PaiMode.md)
2 changes: 1 addition & 1 deletion install.ps1
Expand Up @@ -15,7 +15,7 @@ $yarnUrl = "https://yarnpkg.com/latest.tar.gz"
$unzipNodeDir = "node-v*"
$unzipYarnDir = "yarn-v*"

$NNI_DEPENDENCY_FOLDER = "C:\tmp\$env:USERNAME"
$NNI_DEPENDENCY_FOLDER = [System.IO.Path]::GetTempPath()+$env:USERNAME

$WHICH_PYTHON = where.exe python
if($WHICH_PYTHON -eq $null){
Expand Down
16 changes: 8 additions & 8 deletions src/nni_manager/common/utils.ts
Expand Up @@ -43,11 +43,11 @@ function getExperimentRootDir(): string {
.getLogDir();
}

function getLogDir(): string{
function getLogDir(): string {
return path.join(getExperimentRootDir(), 'log');
}

function getLogLevel(): string{
function getLogLevel(): string {
return getExperimentStartupInfo()
.getLogLevel();
}
Expand Down Expand Up @@ -149,7 +149,7 @@ function parseArg(names: string[]): string {
return '';
}

function encodeCmdLineArgs(args:any):any{
function encodeCmdLineArgs(args: any): any {
if(process.platform === 'win32'){
return JSON.stringify(args);
}
Expand All @@ -158,7 +158,7 @@ function encodeCmdLineArgs(args:any):any{
}
}

function getCmdPy():string{
function getCmdPy(): string {
let cmd = 'python3';
if(process.platform === 'win32'){
cmd = 'python';
Expand Down Expand Up @@ -390,7 +390,7 @@ async function getVersion(): Promise<string> {
/**
* run command as ChildProcess
*/
function getTunerProc(command: string, stdio: StdioOptions, newCwd: string, newEnv: any): ChildProcess{
function getTunerProc(command: string, stdio: StdioOptions, newCwd: string, newEnv: any): ChildProcess {
let cmd: string = command;
let arg: string[] = [];
let newShell: boolean = true;
Expand All @@ -411,7 +411,7 @@ function getTunerProc(command: string, stdio: StdioOptions, newCwd: string, newE
/**
* judge whether the process is alive
*/
async function isAlive(pid:any): Promise<boolean>{
async function isAlive(pid:any): Promise<boolean> {
let deferred : Deferred<boolean> = new Deferred<boolean>();
let alive: boolean = false;
if(process.platform ==='win32'){
Expand Down Expand Up @@ -439,7 +439,7 @@ async function isAlive(pid:any): Promise<boolean>{
/**
* kill process
*/
async function killPid(pid:any): Promise<void>{
async function killPid(pid:any): Promise<void> {
let deferred : Deferred<void> = new Deferred<void>();
try {
if (process.platform === "win32") {
Expand All @@ -455,7 +455,7 @@ async function killPid(pid:any): Promise<void>{
return deferred.promise;
}

function getNewLine(): string{
function getNewLine(): string {
if (process.platform === "win32") {
return "\r\n";
}
Expand Down
15 changes: 9 additions & 6 deletions src/nni_manager/core/nnimanager.ts
Expand Up @@ -58,7 +58,8 @@ class NNIManager implements Manager {
private status: NNIManagerStatus;
private waitingTrials: string[];
private trialJobs: Map<string, TrialJobDetail>;

private trialJobMetricListener: (metric: TrialJobMetric) => void;

constructor() {
this.currSubmittedTrialNum = 0;
this.trialConcurrencyChange = 0;
Expand All @@ -76,6 +77,11 @@ class NNIManager implements Manager {
status: 'INITIALIZED',
errors: []
};
this.trialJobMetricListener = (metric: TrialJobMetric) => {
this.onTrialJobMetrics(metric).catch((err: Error) => {
this.criticalError(NNIError.FromError(err, 'Job metrics error: '));
});
};
}

public updateExperimentProfile(experimentProfile: ExperimentProfile, updateType: ProfileUpdateType): Promise<void> {
Expand Down Expand Up @@ -342,6 +348,7 @@ class NNIManager implements Manager {
if (this.dispatcher === undefined) {
throw new Error('Error: tuner has not been setup');
}
this.trainingService.removeTrialJobMetricListener(this.trialJobMetricListener);
this.dispatcher.sendCommand(TERMINATE);
let tunerAlive: boolean = true;
// gracefully terminate tuner and assessor here, wait at most 30 seconds.
Expand Down Expand Up @@ -589,11 +596,7 @@ class NNIManager implements Manager {
if (this.dispatcher === undefined) {
throw new Error('Error: tuner or job maintainer have not been setup');
}
this.trainingService.addTrialJobMetricListener((metric: TrialJobMetric) => {
this.onTrialJobMetrics(metric).catch((err: Error) => {
this.criticalError(NNIError.FromError(err, 'Job metrics error: '));
});
});
this.trainingService.addTrialJobMetricListener(this.trialJobMetricListener);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mark


this.dispatcher.onCommand((commandType: string, content: string) => {
this.onTunerCommand(commandType, content).catch((err: Error) => {
Expand Down
55 changes: 48 additions & 7 deletions src/nni_manager/training_service/common/util.ts
Expand Up @@ -24,7 +24,10 @@ import { getLogger } from "common/log";
import { countFilesRecursively } from '../../common/utils'
import * as cpp from 'child-process-promise';
import * as cp from 'child_process';
import { GPU_INFO_COLLECTOR_FORMAT_LINUX, GPU_INFO_COLLECTOR_FORMAT_WINDOWS } from './gpuData'
import * as os from 'os';
import * as fs from 'fs';
import { getNewLine } from '../../common/utils';
import { GPU_INFO_COLLECTOR_FORMAT_LINUX, GPU_INFO_COLLECTOR_FORMAT_WINDOWS } from './gpuData';
import * as path from 'path';
import { String } from 'typescript-string-operations';
import { file } from "../../node_modules/@types/tmp";
Expand Down Expand Up @@ -66,6 +69,20 @@ export async function execMkdir(directory: string): Promise<void> {
return Promise.resolve();
}

/**
* copy files to the directory
* @param source
* @param destination
*/
export async function execCopydir(source: string, destination: string): Promise<void> {
if (process.platform === 'win32') {
await cpp.exec(`powershell.exe Copy-Item ${source} -Destination ${destination} -Recurse`);
} else {
await cpp.exec(`cp -r ${source} ${destination}`);
}
return Promise.resolve();
}

/**
* crete a new file
* @param filename
Expand All @@ -91,8 +108,6 @@ export function execScript(filePath: string): cp.ChildProcess {
}
}



/**
* output the last line of a file
* @param filePath
Expand All @@ -111,9 +126,9 @@ export async function execTail(filePath: string): Promise<cpp.childProcessPromis
* delete a directory
* @param directory
*/
export async function execRemove(directory: string): Promise<void>{
export async function execRemove(directory: string): Promise<void> {
if (process.platform === 'win32') {
await cpp.exec(`powershell.exe Remove-Item ${directory}`);
await cpp.exec(`powershell.exe Remove-Item ${directory} -Recurse -Force`);
} else {
await cpp.exec(`rm -rf ${directory}`);
}
Expand All @@ -124,7 +139,7 @@ export async function execRemove(directory: string): Promise<void>{
* kill a process
* @param directory
*/
export async function execKill(pid: string): Promise<void>{
export async function execKill(pid: string): Promise<void> {
if (process.platform === 'win32') {
await cpp.exec(`cmd /c taskkill /PID ${pid} /T /F`);
} else {
Expand All @@ -138,7 +153,7 @@ export async function execKill(pid: string): Promise<void>{
* @param variable
* @returns command string
*/
export function setEnvironmentVariable(variable: { key: string; value: string }): string{
export function setEnvironmentVariable(variable: { key: string; value: string }): string {
if (process.platform === 'win32') {
return `$env:${variable.key}="${variable.value}"`;
}
Expand All @@ -147,6 +162,32 @@ export function setEnvironmentVariable(variable: { key: string; value: string })
}
}

/**
* Compress files in directory to tar file
* @param source_path
* @param tar_path
*/
export async function tarAdd(tar_path: string, source_path: string): Promise<void> {
if (process.platform === 'win32') {
tar_path = tar_path.split('\\').join('\\\\');
source_path = source_path.split('\\').join('\\\\');
let script: string[] = [];
script.push(
`import os`,
`import tarfile`,
String.Format(`tar = tarfile.open("{0}","w:gz")\r\nfor root,dir,files in os.walk("{1}"):`, tar_path, source_path),
` for file in files:`,
` fullpath = os.path.join(root,file)`,
` tar.add(fullpath, arcname=file)`,
`tar.close()`);
await fs.promises.writeFile(path.join(os.tmpdir(), 'tar.py'), script.join(getNewLine()), { encoding: 'utf8', mode: 0o777 });
const tarScript: string = path.join(os.tmpdir(), 'tar.py');
await cpp.exec(`python ${tarScript}`);
} else {
await cpp.exec(`tar -czf ${tar_path} -C ${source_path} .`);
}
return Promise.resolve();
}

/**
* generate script file name
Expand Down