2022-04-02 04:46:51 +03:00
|
|
|
trigger: none
|
2020-10-30 07:39:34 +03:00
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
stages:
|
|
|
|
- stage: lint
|
|
|
|
jobs:
|
|
|
|
- job: docs
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
|
|
|
steps:
|
2022-01-24 10:51:34 +03:00
|
|
|
- template: templates/install-dependencies.yml
|
|
|
|
parameters:
|
|
|
|
platform: ubuntu-latest
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
sudo apt-get install -y pandoc
|
2022-01-24 10:51:34 +03:00
|
|
|
displayName: Install pandoc
|
|
|
|
|
2021-12-07 10:49:03 +03:00
|
|
|
- script: |
|
|
|
|
cd docs
|
2022-04-01 12:31:16 +03:00
|
|
|
rstcheck -r source \
|
2022-04-03 12:43:28 +03:00
|
|
|
--ignore-directives automodule,autoclass,autofunction,cardlinkitem,codesnippetcard,argparse,tabs \
|
2022-04-01 12:31:16 +03:00
|
|
|
--ignore-roles githublink --ignore-substitutions release \
|
|
|
|
--report warning
|
|
|
|
displayName: rstcheck
|
2022-02-10 06:10:30 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd docs
|
2022-03-27 16:26:24 +03:00
|
|
|
make -e SPHINXOPTS="-W --keep-going -T -q" html
|
2022-02-10 06:10:30 +03:00
|
|
|
displayName: Sphinx sanity check
|
2022-01-24 10:51:34 +03:00
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
2022-03-28 08:52:49 +03:00
|
|
|
set -e
|
2022-02-10 06:10:30 +03:00
|
|
|
cd docs
|
2022-03-28 08:52:49 +03:00
|
|
|
rm -rf build
|
|
|
|
sudo apt-get install -y gettext
|
|
|
|
python tools/translation_patch.py
|
2022-03-27 16:26:24 +03:00
|
|
|
make -e SPHINXOPTS="-W --keep-going -T -q -D language='zh'" html
|
2022-02-10 06:10:30 +03:00
|
|
|
displayName: Sphinx sanity check (Chinese)
|
|
|
|
|
|
|
|
- script: |
|
2022-04-20 05:35:02 +03:00
|
|
|
set -e
|
2022-02-10 06:10:30 +03:00
|
|
|
cd docs
|
2022-04-20 05:35:02 +03:00
|
|
|
rm -rf build
|
|
|
|
make i18n
|
|
|
|
git diff --exit-code source/locales
|
2022-02-10 06:10:30 +03:00
|
|
|
displayName: Translation up-to-date
|
2021-01-25 06:17:02 +03:00
|
|
|
|
2022-04-14 09:55:56 +03:00
|
|
|
- script: |
|
|
|
|
cd docs
|
2022-04-20 10:24:50 +03:00
|
|
|
rm -rf build
|
2022-04-14 09:55:56 +03:00
|
|
|
make -e SPHINXOPTS="-W -T -b linkcheck -q --keep-going" html
|
|
|
|
displayName: External links integrity check
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- job: python
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
|
|
|
steps:
|
2022-01-24 10:51:34 +03:00
|
|
|
- template: templates/install-dependencies.yml
|
|
|
|
parameters:
|
|
|
|
platform: ubuntu-latest
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
2022-01-24 10:51:34 +03:00
|
|
|
# pylint requires newer typing extension. Override requirements in tensorflow
|
|
|
|
python -m pip install "typing-extensions>=3.10"
|
|
|
|
displayName: Resolve dependency version
|
|
|
|
|
2022-04-25 10:33:04 +03:00
|
|
|
- script: python test/vso_tools/trigger_import.py
|
|
|
|
displayName: Trigger import
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
2022-01-24 10:51:34 +03:00
|
|
|
python -m pylint --rcfile pylintrc nni
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: pylint
|
2022-01-24 10:51:34 +03:00
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- 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
|
|
|
|
|
2022-03-24 18:37:05 +03:00
|
|
|
- script: |
|
|
|
|
python -m pyright nni
|
2022-03-25 12:13:22 +03:00
|
|
|
displayName: Type Check
|
2022-03-24 18:37:05 +03:00
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- job: typescript
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
|
|
|
steps:
|
2022-01-24 10:51:34 +03:00
|
|
|
- template: templates/install-dependencies.yml
|
|
|
|
parameters:
|
|
|
|
platform: ubuntu-latest
|
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
set -e
|
2022-01-24 10:51:34 +03:00
|
|
|
yarn --cwd ts/nni_manager
|
|
|
|
yarn --cwd ts/nni_manager eslint
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: ESLint (NNI Manager)
|
2022-01-24 10:51:34 +03:00
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
set -e
|
2022-01-24 10:51:34 +03:00
|
|
|
yarn --cwd ts/webui
|
2022-02-10 07:55:46 +03:00
|
|
|
yarn --cwd ts/webui sanity-check
|
|
|
|
displayName: Sanity check (WebUI)
|
2022-01-25 09:02:10 +03:00
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
|
2022-01-24 10:51: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
|
|
|
- stage: test
|
|
|
|
jobs:
|
|
|
|
- job: ubuntu_latest
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-01-24 10:51:34 +03:00
|
|
|
- template: templates/install-dependencies.yml
|
|
|
|
parameters:
|
|
|
|
platform: ubuntu-latest
|
2021-01-25 06:17:02 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
python setup.py develop
|
2022-01-24 10:51:34 +03:00
|
|
|
echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: Install NNI
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
2022-01-24 10:51:34 +03:00
|
|
|
mkdir -p coverage
|
2021-01-25 06:17:02 +03:00
|
|
|
cd test
|
2021-06-25 07:32:35 +03:00
|
|
|
python -m pytest ut --cov-config=.coveragerc \
|
2021-12-06 05:48:50 +03:00
|
|
|
--ignore=ut/compression/v1/test_pruners.py \
|
|
|
|
--ignore=ut/compression/v1/test_compressor_tf.py \
|
|
|
|
--ignore=ut/compression/v1/test_compressor_torch.py \
|
|
|
|
--ignore=ut/compression/v1/test_model_speedup.py
|
|
|
|
python -m pytest ut/compression/v1/test_pruners.py --cov-config=.coveragerc --cov-append
|
|
|
|
python -m pytest ut/compression/v1/test_compressor_tf.py --cov-config=.coveragerc --cov-append
|
|
|
|
python -m pytest ut/compression/v1/test_compressor_torch.py --cov-config=.coveragerc --cov-append
|
|
|
|
python -m pytest ut/compression/v1/test_model_speedup.py --cov-config=.coveragerc --cov-append
|
2021-08-27 11:48:53 +03:00
|
|
|
cp coverage.xml ../coverage/python.xml
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: Python unit test
|
|
|
|
|
|
|
|
- script: |
|
2022-01-24 10:51:34 +03:00
|
|
|
yarn --cwd ts/nni_manager test
|
|
|
|
cp ts/nni_manager/coverage/cobertura-coverage.xml coverage/typescript.xml
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: TypeScript unit test
|
|
|
|
|
2021-06-25 07:32:35 +03:00
|
|
|
- task: PublishTestResults@2
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
inputs:
|
|
|
|
testResultsFiles: '$(System.DefaultWorkingDirectory)/**/test-*.xml'
|
|
|
|
testRunTitle: 'Publish test results for Python $(python.version)'
|
|
|
|
displayName: Publish test results
|
|
|
|
|
|
|
|
- task: PublishCodeCoverageResults@1
|
|
|
|
inputs:
|
|
|
|
codeCoverageTool: Cobertura
|
2021-08-27 11:48:53 +03:00
|
|
|
summaryFileLocation: coverage/*
|
2021-06-25 07:32:35 +03:00
|
|
|
displayName: Publish code coverage results
|
|
|
|
|
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
|
|
|
|
|
|
|
|
- job: ubuntu_legacy
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-18.04
|
|
|
|
|
|
|
|
steps:
|
2022-01-24 10:51:34 +03:00
|
|
|
- template: templates/install-dependencies.yml
|
|
|
|
parameters:
|
|
|
|
platform: ubuntu-legacy
|
2021-01-25 06:17:02 +03:00
|
|
|
|
|
|
|
- script: |
|
|
|
|
python setup.py develop
|
2022-01-24 10:51:34 +03:00
|
|
|
echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: Install NNI
|
|
|
|
|
|
|
|
- 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: |
|
2022-01-24 10:51:34 +03:00
|
|
|
yarn --cwd ts/nni_manager test
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: TypeScript unit test
|
|
|
|
|
2022-01-24 10:51:34 +03:00
|
|
|
- job: windows
|
2021-01-25 06:17:02 +03:00
|
|
|
pool:
|
2022-01-24 10:51:34 +03:00
|
|
|
vmImage: windows-latest
|
2022-02-28 08:59:49 +03:00
|
|
|
timeoutInMinutes: 75
|
2021-01-25 06:17:02 +03:00
|
|
|
|
|
|
|
steps:
|
2022-01-24 10:51:34 +03:00
|
|
|
- template: templates/install-dependencies.yml
|
|
|
|
parameters:
|
|
|
|
platform: windows
|
2021-01-25 06:17:02 +03:00
|
|
|
|
|
|
|
- script: |
|
2022-01-24 10:51:34 +03:00
|
|
|
python setup.py develop --no-user
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: Install NNI
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
cd test
|
|
|
|
python -m pytest ut
|
|
|
|
displayName: Python unit test
|
|
|
|
|
2022-01-24 10:51:34 +03:00
|
|
|
- script: |
|
|
|
|
yarn --cwd ts/nni_manager test
|
|
|
|
displayName: TypeScript unit test
|
|
|
|
|
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
|
|
|
|
|
2022-01-24 10:51:34 +03:00
|
|
|
- job: macos
|
2021-01-25 06:17:02 +03:00
|
|
|
pool:
|
2022-01-24 10:51:34 +03:00
|
|
|
vmImage: macOS-latest
|
2021-01-25 06:17:02 +03:00
|
|
|
|
|
|
|
steps:
|
2022-01-24 10:51:34 +03:00
|
|
|
- template: templates/install-dependencies.yml
|
|
|
|
parameters:
|
|
|
|
platform: macos
|
2021-01-25 06:17:02 +03:00
|
|
|
|
|
|
|
- script: |
|
2022-01-24 10:51:34 +03:00
|
|
|
python setup.py develop
|
|
|
|
echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: Install NNI
|
|
|
|
|
|
|
|
- script: |
|
2022-01-24 10:51:34 +03:00
|
|
|
CI=true yarn --cwd ts/nni_manager test --exclude test/core/nnimanager.test.ts
|
|
|
|
displayName: TypeScript unit test
|
2021-12-14 06:28:56 +03:00
|
|
|
|
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
|