2020-10-30 07:39:34 +03:00
|
|
|
# To reduce debug cost, steps are sorted differently on each platform,
|
|
|
|
# so that a bug in any module will cause at least one platform to fail quickly.
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
stages:
|
|
|
|
- stage: lint
|
|
|
|
jobs:
|
|
|
|
- job: docs
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
|
|
|
variables:
|
|
|
|
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 3.8
|
|
|
|
displayName: Configure Python version
|
|
|
|
- script: |
|
|
|
|
sudo apt-get install -y pandoc
|
|
|
|
sudo apt-get remove swig -y
|
|
|
|
sudo apt-get install swig3.0 -y
|
|
|
|
sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
|
|
|
|
displayName: Install apt packages
|
2021-01-29 08:40:53 +03:00
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
|
|
|
key: 'python | "$(Agent.OS)" | dependencies/*.txt'
|
|
|
|
restoreKeys: |
|
|
|
|
python | "$(Agent.OS)"
|
|
|
|
python
|
|
|
|
path: $(PIP_CACHE_DIR)
|
|
|
|
displayName: Cache pip packages
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
python -m pip install -U -r dependencies/setup.txt
|
|
|
|
python -m pip install -r dependencies/develop.txt
|
|
|
|
python -m pip install -r dependencies/required.txt
|
|
|
|
python -m pip install -r dependencies/recommended.txt
|
2021-02-09 11:59:25 +03:00
|
|
|
python -m pip install -r dependencies/required_extra.txt
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: Install requirements
|
|
|
|
- script: |
|
|
|
|
cd docs/en_US
|
|
|
|
sphinx-build -M html . _build -W --keep-going -T
|
|
|
|
displayName: Sphinx # TODO: rstcheck
|
|
|
|
|
|
|
|
- job: python
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
|
|
|
variables:
|
|
|
|
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 3.8
|
|
|
|
displayName: Configure Python version
|
|
|
|
- script: |
|
|
|
|
sudo apt-get remove swig -y
|
|
|
|
sudo apt-get install swig3.0 -y
|
|
|
|
sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
|
|
|
|
displayName: Install apt packages
|
2021-01-29 08:40:53 +03:00
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
|
|
|
key: 'python | "$(Agent.OS)" | dependencies/*.txt'
|
|
|
|
restoreKeys: |
|
|
|
|
python | "$(Agent.OS)"
|
|
|
|
python
|
|
|
|
path: $(PIP_CACHE_DIR)
|
|
|
|
displayName: Cache pip packages
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
python -m pip install -U -r dependencies/setup.txt
|
|
|
|
python -m pip install -r dependencies/develop.txt
|
|
|
|
python -m pip install -r dependencies/required.txt
|
|
|
|
python -m pip install -r dependencies/recommended.txt
|
2021-02-09 11:59:25 +03:00
|
|
|
python -m pip install -r dependencies/required_extra.txt
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: Install requirements
|
|
|
|
- script: python -m pylint --rcfile pylintrc nni
|
|
|
|
displayName: pylint
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
python -m flake8 nni --count --select=E9,F63,F72,F82 --show-source --statistics
|
|
|
|
EXCLUDES=examples/trials/mnist-nas/*/mnist*.py,examples/trials/nas_cifar10/src/cifar10/general_child.py
|
|
|
|
python -m flake8 examples --count --exclude=$EXCLUDES --select=E9,F63,F72,F82 --show-source --statistics
|
|
|
|
displayName: flake8
|
|
|
|
|
|
|
|
- job: typescript
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
2021-02-09 11:59:25 +03:00
|
|
|
variables:
|
|
|
|
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
|
2021-01-25 06:17:02 +03:00
|
|
|
steps:
|
2021-06-21 08:40:50 +03:00
|
|
|
- task: NodeTool@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 16.3.0
|
|
|
|
displayName: Configure Node.js version
|
2021-02-09 11:59:25 +03:00
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
|
|
|
key: 'yarn | "$(Agent.OS)" | ts/**/yarn.lock, !**/node_modules/**'
|
|
|
|
restoreKeys: |
|
|
|
|
yarn | "$(Agent.OS)"
|
|
|
|
path: $(YARN_CACHE_FOLDER)
|
|
|
|
displayName: Cache yarn packages
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
cd ts/nni_manager
|
|
|
|
yarn
|
|
|
|
yarn eslint
|
|
|
|
displayName: ESLint (NNI Manager)
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
cd ts/webui
|
|
|
|
yarn
|
|
|
|
yarn eslint
|
|
|
|
displayName: ESLint (WebUI)
|
|
|
|
|
|
|
|
|
|
|
|
- stage: test
|
|
|
|
jobs:
|
|
|
|
- job: ubuntu_latest
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
2021-02-09 11:59:25 +03:00
|
|
|
variables:
|
|
|
|
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
|
|
|
|
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
|
2021-01-25 06:17:02 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 3.8
|
|
|
|
displayName: Configure Python version
|
|
|
|
|
2021-06-21 08:40:50 +03:00
|
|
|
- task: NodeTool@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 16.3.0
|
|
|
|
displayName: Configure Node.js version
|
|
|
|
|
2021-02-09 11:59:25 +03:00
|
|
|
- script: |
|
|
|
|
sudo apt-get install -y pandoc
|
|
|
|
sudo apt-get remove swig -y
|
|
|
|
sudo apt-get install swig3.0 -y
|
|
|
|
sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
|
|
|
|
displayName: Install apt packages
|
|
|
|
|
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
2021-02-19 11:20:02 +03:00
|
|
|
key: 'python | "$(Agent.OS)" | latest | dependencies/*.txt'
|
2021-02-09 11:59:25 +03:00
|
|
|
restoreKeys: |
|
|
|
|
python | "$(Agent.OS)"
|
|
|
|
python
|
|
|
|
path: $(PIP_CACHE_DIR)
|
|
|
|
displayName: Cache pip packages
|
|
|
|
|
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
2021-02-19 11:20:02 +03:00
|
|
|
key: 'yarn | "$(Agent.OS)" | latest | ts/**/yarn.lock, !**/node_modules/**'
|
2021-02-09 11:59:25 +03:00
|
|
|
restoreKeys: |
|
|
|
|
yarn | "$(Agent.OS)"
|
|
|
|
path: $(YARN_CACHE_FOLDER)
|
|
|
|
displayName: Cache yarn packages
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
set -e
|
2021-02-09 11:59:25 +03:00
|
|
|
python -m pip install -U -r dependencies/setup.txt
|
|
|
|
python -m pip install -r dependencies/develop.txt
|
2021-01-25 06:17:02 +03:00
|
|
|
echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
|
|
|
|
displayName: Install Python tools
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
python setup.py develop
|
|
|
|
displayName: Install NNI
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
2021-02-09 11:59:25 +03:00
|
|
|
python -m pip install -r dependencies/recommended.txt
|
2021-05-28 04:19:21 +03:00
|
|
|
python -m pip install -e .[SMAC,BOHB,PPOTuner,DNGO]
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: Install extra dependencies
|
|
|
|
|
2021-03-05 14:06:58 +03:00
|
|
|
# Need del later
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
python interim_vision_patch.py
|
|
|
|
displayName: Vision MNIST Patch
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
cd test
|
|
|
|
python -m pytest ut --ignore=ut/sdk/test_pruners.py \
|
|
|
|
--ignore=ut/sdk/test_compressor_tf.py \
|
|
|
|
--ignore=ut/sdk/test_compressor_torch.py
|
|
|
|
python -m pytest ut/sdk/test_pruners.py
|
|
|
|
python -m pytest ut/sdk/test_compressor_tf.py
|
|
|
|
python -m pytest ut/sdk/test_compressor_torch.py
|
|
|
|
displayName: Python unit test
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
cd ts/nni_manager
|
|
|
|
yarn test
|
|
|
|
cd ../nasui
|
|
|
|
CI=true yarn test
|
|
|
|
displayName: TypeScript unit test
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd test
|
|
|
|
python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
|
|
|
|
displayName: Simple integration test
|
|
|
|
|
|
|
|
- job: ubuntu_legacy
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-18.04
|
2021-02-09 11:59:25 +03:00
|
|
|
variables:
|
|
|
|
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
|
|
|
|
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
|
2021-01-25 06:17:02 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 3.6
|
|
|
|
displayName: Configure Python version
|
|
|
|
|
2021-06-21 08:40:50 +03:00
|
|
|
- task: NodeTool@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 16.3.0
|
|
|
|
displayName: Configure Node.js version
|
|
|
|
|
2021-02-09 11:59:25 +03:00
|
|
|
- script: |
|
|
|
|
sudo apt-get install -y pandoc
|
|
|
|
sudo apt-get remove swig -y
|
|
|
|
sudo apt-get install swig3.0 -y
|
|
|
|
sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
|
|
|
|
displayName: Install apt packages
|
|
|
|
|
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
|
|
|
key: 'python | "$(Agent.OS)" | legacy | dependencies/*.txt'
|
|
|
|
restoreKeys: |
|
|
|
|
python | "$(Agent.OS)"
|
|
|
|
python
|
|
|
|
path: $(PIP_CACHE_DIR)
|
|
|
|
displayName: Cache pip packages
|
|
|
|
|
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
|
|
|
key: 'yarn | "$(Agent.OS)" | legacy | ts/**/yarn.lock, !**/node_modules/**'
|
|
|
|
restoreKeys: |
|
|
|
|
yarn | "$(Agent.OS)"
|
|
|
|
path: $(YARN_CACHE_FOLDER)
|
|
|
|
displayName: Cache yarn packages
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
set -e
|
2021-02-09 11:59:25 +03:00
|
|
|
python -m pip install -U -r dependencies/setup.txt
|
|
|
|
python -m pip install -r dependencies/develop.txt
|
2021-01-25 06:17:02 +03:00
|
|
|
echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
|
|
|
|
displayName: Install Python tools
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
python setup.py develop
|
|
|
|
displayName: Install NNI
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
2021-02-09 11:59:25 +03:00
|
|
|
python -m pip install -r dependencies/recommended_legacy.txt
|
2021-05-28 04:19:21 +03:00
|
|
|
python -m pip install -e .[SMAC,BOHB,PPOTuner,DNGO]
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: Install extra dependencies
|
|
|
|
|
2021-03-05 14:06:58 +03:00
|
|
|
# Need del later
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
python interim_vision_patch.py
|
|
|
|
displayName: Vision MNIST Patch
|
|
|
|
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
cd test
|
|
|
|
python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
|
|
|
|
displayName: Simple integration test
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd test
|
2021-02-22 05:44:06 +03:00
|
|
|
python -m pytest ut --ignore=ut/retiarii/test_convert_basic.py \
|
|
|
|
--ignore=ut/retiarii/test_convert_operators.py \
|
|
|
|
--ignore=ut/retiarii/test_convert_pytorch.py
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: Python unit test
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
cd ts/nni_manager
|
|
|
|
yarn test
|
|
|
|
cd ../nasui
|
|
|
|
CI=true yarn test
|
|
|
|
displayName: TypeScript unit test
|
|
|
|
|
|
|
|
- job: macos
|
|
|
|
pool:
|
|
|
|
vmImage: macOS-10.15
|
2021-02-09 11:59:25 +03:00
|
|
|
variables:
|
|
|
|
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
|
|
|
|
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
|
2021-01-25 06:17:02 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 3.8
|
|
|
|
displayName: Configure Python version
|
|
|
|
|
2021-06-21 08:40:50 +03:00
|
|
|
- task: NodeTool@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 16.3.0
|
|
|
|
displayName: Configure Node.js version
|
|
|
|
|
2021-02-09 11:59:25 +03:00
|
|
|
- script: |
|
|
|
|
brew install swig@3
|
|
|
|
rm -f /usr/local/bin/swig
|
|
|
|
ln -s /usr/local/opt/swig\@3/bin/swig /usr/local/bin/swig
|
|
|
|
displayName: Install brew packages
|
|
|
|
|
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
|
|
|
key: 'python | "$(Agent.OS)" | dependencies/*.txt'
|
|
|
|
restoreKeys: |
|
|
|
|
python | "$(Agent.OS)"
|
|
|
|
python
|
|
|
|
path: $(PIP_CACHE_DIR)
|
|
|
|
displayName: Cache pip packages
|
|
|
|
|
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
|
|
|
key: 'yarn | "$(Agent.OS)" | ts/**/yarn.lock, !**/node_modules/**'
|
|
|
|
restoreKeys: |
|
|
|
|
yarn | "$(Agent.OS)"
|
|
|
|
path: $(YARN_CACHE_FOLDER)
|
|
|
|
displayName: Cache yarn packages
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
set -e
|
2021-02-09 11:59:25 +03:00
|
|
|
python -m pip install -U -r dependencies/setup.txt
|
|
|
|
python -m pip install -r dependencies/develop.txt
|
2021-01-25 06:17:02 +03:00
|
|
|
echo "##vso[task.setvariable variable=PATH]${PATH}:${HOME}/.local/bin"
|
|
|
|
displayName: Install Python tools
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
python setup.py develop
|
|
|
|
displayName: Install NNI
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
export CI=true
|
|
|
|
(cd ts/nni_manager && yarn test)
|
|
|
|
(cd ts/nasui && yarn test)
|
|
|
|
displayName: TypeScript unit test
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
2021-02-09 11:59:25 +03:00
|
|
|
python -m pip install -r dependencies/recommended.txt
|
2021-05-28 04:19:21 +03:00
|
|
|
python -m pip install -e .[SMAC,BOHB,PPOTuner,DNGO]
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: Install extra dependencies
|
|
|
|
|
2021-03-05 14:06:58 +03:00
|
|
|
# Need del later
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
python interim_vision_patch.py
|
|
|
|
displayName: Vision MNIST Patch
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
cd test
|
|
|
|
python -m pytest ut
|
|
|
|
displayName: Python unit test
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd test
|
|
|
|
python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
|
|
|
|
displayName: Simple integration test
|
|
|
|
|
|
|
|
- job: windows
|
|
|
|
pool:
|
|
|
|
vmImage: windows-2019
|
2021-02-09 11:59:25 +03:00
|
|
|
variables:
|
|
|
|
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
|
|
|
|
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
|
2021-01-25 06:17:02 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 3.8
|
|
|
|
displayName: Configure Python version
|
|
|
|
|
2021-06-21 08:40:50 +03:00
|
|
|
- task: NodeTool@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: 16.3.0
|
|
|
|
displayName: Configure Node.js version
|
|
|
|
|
2021-02-09 11:59:25 +03:00
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
|
|
|
key: 'python | "$(Agent.OS)" | dependencies/*.txt'
|
|
|
|
restoreKeys: |
|
|
|
|
python | "$(Agent.OS)"
|
|
|
|
python
|
|
|
|
path: $(PIP_CACHE_DIR)
|
|
|
|
displayName: Cache pip packages
|
|
|
|
|
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
|
|
|
key: 'yarn | "$(Agent.OS)" | ts/**/yarn.lock, !**/node_modules/**'
|
|
|
|
restoreKeys: |
|
|
|
|
yarn | "$(Agent.OS)"
|
|
|
|
path: $(YARN_CACHE_FOLDER)
|
|
|
|
displayName: Cache yarn packages
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
2021-02-09 11:59:25 +03:00
|
|
|
set -e
|
|
|
|
python -m pip install -U -r dependencies/setup.txt
|
|
|
|
python -m pip install -r dependencies/develop.txt
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: Install Python tools
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
python setup.py develop --no-user
|
|
|
|
displayName: Install NNI
|
|
|
|
|
|
|
|
- script: |
|
2021-02-09 11:59:25 +03:00
|
|
|
python -m pip install -r dependencies/recommended.txt
|
2021-05-28 04:19:21 +03:00
|
|
|
python -m pip install -e .[DNGO]
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: Install extra dependencies
|
|
|
|
|
2021-03-05 14:06:58 +03:00
|
|
|
# Need del later
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
python interim_vision_patch.py
|
|
|
|
displayName: Vision MNIST Patch
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
cd test
|
|
|
|
python -m pytest ut
|
|
|
|
displayName: Python unit test
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd ts/nni_manager
|
|
|
|
yarn test
|
|
|
|
displayName: TypeScript unit test
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd test
|
|
|
|
python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
|
|
|
|
displayName: Simple integration test
|
2020-11-09 09:54:49 +03:00
|
|
|
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
branches:
|
|
|
|
exclude: [ l10n_master ]
|