From bbf4760ca3ae7bab222f453f446e2b152a47fbbe Mon Sep 17 00:00:00 2001 From: Gems Guo Date: Fri, 2 Nov 2018 11:50:02 +0800 Subject: [PATCH] Rename the pypi package for nni --- README.Makefile.md | 2 +- README.md | 27 +++++++--- azure-pipelines.yml | 50 ++++++++++++++----- deployment/docker/Dockerfile | 2 +- deployment/pypi/setup.py | 6 +-- docs/GetStarted.md | 4 +- docs/InstallNNI_Ubuntu.md | 8 ++- docs/RemoteMachineMode.md | 2 +- docs/tutorial_2_RemoteMachineMode.md | 2 +- examples/trials/sklearn/requirements.txt | 6 +-- setup.py | 2 +- .../training_service/pai/paiData.ts | 2 +- src/sdk/pynni/setup.py | 2 +- tools/README.md | 2 +- 14 files changed, 76 insertions(+), 41 deletions(-) diff --git a/README.Makefile.md b/README.Makefile.md index 7b89482432..f226689a40 100644 --- a/README.Makefile.md +++ b/README.Makefile.md @@ -14,7 +14,7 @@ The targets will be detailed later. ## Dependencies -NNI requires at least Node.js, Yarn, and PIP to build, while TypeScript is also recommended. +NNI requires at least Node.js, Yarn, and pip to build, while TypeScript is also recommended. NNI requires Node.js, and all dependency libraries to run. Required Node.js libraries (including TypeScript) can be installed by Yarn, and required Python libraries can be installed by setuptools or PIP. diff --git a/README.md b/README.md index a85ddddfb2..b43e5fcac7 100644 --- a/README.md +++ b/README.md @@ -22,16 +22,29 @@ The tool dispatches and runs trial jobs generated by tuning algorithms to search ## **Install & Verify** -**pip install** -* We only support Linux in current stage, Ubuntu 16.04 or higher are tested and supported. Simply run the following `pip install` in an environment that has `python >= 3.5`, `git` and `wget`. - +**Install through pip** +* We only support Linux in current stage, Ubuntu 16.04 or higher are tested and supported. Simply run the following `pip install` in an environment that has `python >= 3.5`. +```bash + python3 -m pip install --user nni ``` -python3 -m pip install -v --user git+https://github.com/Microsoft/nni.git@v0.2 -source ~/.bashrc + +**Install through source code** +* We only support Linux (Ubuntu 16.04 or higher) in our current stage. +* Run the following commands in an environment that has `python >= 3.5`, `git` and `wget`. +```bash + git clone -b v0.3.0 https://github.com/Microsoft/nni.git + cd nni + source install.sh ``` -**verify install** -* The following example is an experiment built on TensorFlow, make sure you have `TensorFlow installed` before running it. +**Verify install** +* The following example is an experiment built on TensorFlow. Make sure you have **TensorFlow installed** before running it. +* Download the examples via clone the source code. +```bash + cd ~ + git clone -b v0.3.0 https://github.com/Microsoft/nni.git +``` +* Run the mnist example. ```bash nnictl create --config ~/nni/examples/trials/mnist/config.yml ``` diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fb4f53e8b6..dede877f0f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,23 +1,47 @@ -pool: - vmImage: 'Ubuntu 16.04' -strategy: - matrix: - Python36: - PYTHON_VERSION: '3.6' +jobs: -steps: +- job: 'Install_through_pip' + pool: + vmImage: 'Ubuntu 16.04' + strategy: + matrix: + Python36: + PYTHON_VERSION: '3.6' + + steps: - script: python3 -m pip install --upgrade pip setuptools displayName: 'Install python tools' - script: | - source install.sh - displayName: 'Install dependencies' + python3 -m pip install nni --user + displayName: 'Install nni toolkit via pip' - script: | cd test - export PATH=$HOME/.local/bin:$PATH - python3 naive_test.py + PATH=$HOME/.local/bin:$PATH python3 naive_test.py displayName: 'Integration tests' - script: | cd test - export PATH=$HOME/.local/bin:$PATH - python3 sdk_tuner_test.py + PATH=$HOME/.local/bin:$PATH python3 sdk_tuner_test.py displayName: 'Built-in tuner tests' + +- job: 'Install_through_source_code' + pool: + vmImage: 'Ubuntu 16.04' + strategy: + matrix: + Python36: + PYTHON_VERSION: '3.6' + + steps: + - script: python3 -m pip install --upgrade pip setuptools + displayName: 'Install python tools' + - script: | + source install.sh + displayName: 'Install nni toolkit via source code' + - script: | + cd test + PATH=$HOME/.local/bin:$PATH python3 naive_test.py + displayName: 'Integration tests' + - script: | + cd test + PATH=$HOME/.local/bin:$PATH python3 sdk_tuner_test.py + displayName: 'Built-in tuner tests' \ No newline at end of file diff --git a/deployment/docker/Dockerfile b/deployment/docker/Dockerfile index 73a6dc45df..a14cb0ab37 100644 --- a/deployment/docker/Dockerfile +++ b/deployment/docker/Dockerfile @@ -53,7 +53,7 @@ RUN python3 -m pip --no-cache-dir install \ # #Install NNI # -RUN python3 -m pip install --user nni-pkg +RUN python3 -m pip install --user nni # #Tensorflow 1.10.0 diff --git a/deployment/pypi/setup.py b/deployment/pypi/setup.py index 9c87dc3f68..fe3811838b 100644 --- a/deployment/pypi/setup.py +++ b/deployment/pypi/setup.py @@ -10,7 +10,7 @@ long_description = fh.read() setuptools.setup( - name = 'nni-pkg', + name = 'nni', version = '0.3.0', author = 'Microsoft NNI team', author_email = 'nni@microsoft.com', @@ -22,12 +22,12 @@ packages = setuptools.find_packages(), python_requires = '>=3.5', install_requires = [ - 'nni', + 'nni-sdk', 'schema', 'pyyaml', 'psutil', 'requests', - 'paramiko' + 'astor' ], classifiers = [ 'Programming Language :: Python :: 3', diff --git a/docs/GetStarted.md b/docs/GetStarted.md index e18fe4f4fc..c5a9346f5f 100644 --- a/docs/GetStarted.md +++ b/docs/GetStarted.md @@ -14,11 +14,11 @@ * __Install NNI through pip__ - python3 -m pip install --user nni-pkg + python3 -m pip install --user nni * __Install NNI through source code__ - git clone -b v0.3 https://github.com/Microsoft/nni.git + git clone -b v0.3.0 https://github.com/Microsoft/nni.git cd nni source install.sh diff --git a/docs/InstallNNI_Ubuntu.md b/docs/InstallNNI_Ubuntu.md index fc3f64f798..646705cd74 100644 --- a/docs/InstallNNI_Ubuntu.md +++ b/docs/InstallNNI_Ubuntu.md @@ -8,18 +8,16 @@ git wget - python pip should also be correctly installed. You could use "which pip" or "pip -V" to check in Linux. + python pip should also be correctly installed. You could use "python3 -m pip -v" to check in Linux. * __Install NNI through pip__ - pip3 install -v --user git+https://github.com/Microsoft/nni.git@v0.2 - source ~/.bashrc + python3 -m pip install --user nni * __Install NNI through source code__ - git clone -b v0.2 https://github.com/Microsoft/nni.git + git clone -b v0.3.0 https://github.com/Microsoft/nni.git cd nni - chmod +x install.sh source install.sh ## Further reading diff --git a/docs/RemoteMachineMode.md b/docs/RemoteMachineMode.md index 0a81a5eda1..b164bb43d5 100644 --- a/docs/RemoteMachineMode.md +++ b/docs/RemoteMachineMode.md @@ -15,7 +15,7 @@ For remote machines that are used only to run trials but not the nnictl, you can * __Install python SDK through pip__ - python3 -m pip install --user nni + python3 -m pip install --user nni-sdk * __Install python SDK through source code__ diff --git a/docs/tutorial_2_RemoteMachineMode.md b/docs/tutorial_2_RemoteMachineMode.md index 97ee31dda6..a8f9b65226 100644 --- a/docs/tutorial_2_RemoteMachineMode.md +++ b/docs/tutorial_2_RemoteMachineMode.md @@ -15,7 +15,7 @@ For remote machines that are used only to run trials but not the nnictl, you can * __Install python SDK through pip__ - python3 -m pip install --user nni + python3 -m pip install --user nni-sdk * __Install python SDK through source code__ diff --git a/examples/trials/sklearn/requirements.txt b/examples/trials/sklearn/requirements.txt index 6e2a708386..c9ede4ab93 100644 --- a/examples/trials/sklearn/requirements.txt +++ b/examples/trials/sklearn/requirements.txt @@ -1,4 +1,4 @@ -pip3 install numpy +python3 -m pip install numpy sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran -sudo pip3 install scipy -sudo pip3 install sklearn \ No newline at end of file +sudo python3 -m pip install scipy +sudo python3 -m pip install sklearn \ No newline at end of file diff --git a/setup.py b/setup.py index bdad933ec1..e0cf78bca4 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ def run(self): subprocess.run(['make', 'pip-install'], check=True) setup( - name = 'NNI', + name = 'nni', version = '0.3.0', author = 'Microsoft NNI Team', author_email = 'nni@microsoft.com', diff --git a/src/nni_manager/training_service/pai/paiData.ts b/src/nni_manager/training_service/pai/paiData.ts index 2c3e0e7c47..5189ad5e4d 100644 --- a/src/nni_manager/training_service/pai/paiData.ts +++ b/src/nni_manager/training_service/pai/paiData.ts @@ -56,7 +56,7 @@ if python3 -c 'import nni' > /dev/null 2>&1; then return else # Install nni - python3 -m pip install --user nni-pkg + python3 -m pip install --user nni fi`; export const PAI_TRIAL_COMMAND_FORMAT: string = diff --git a/src/sdk/pynni/setup.py b/src/sdk/pynni/setup.py index 38b245d623..786cf3fff0 100644 --- a/src/sdk/pynni/setup.py +++ b/src/sdk/pynni/setup.py @@ -26,7 +26,7 @@ def read(fname): return open(os.path.join(os.path.dirname(__file__), fname), encoding='utf-8').read() setuptools.setup( - name = 'nni', + name = 'nni-sdk', version = '0.3.0', packages = setuptools.find_packages(exclude=['tests']), diff --git a/tools/README.md b/tools/README.md index 6a2d23a7e1..0bff813c91 100644 --- a/tools/README.md +++ b/tools/README.md @@ -11,7 +11,7 @@ python >= 3.5 1. Enter tools directory - 2. Use pip3 to install packages + 2. Use pip to install packages * Install for current user: python3 -m pip install --user -e .