2022-01-24 10:51:34 +03:00
|
|
|
trigger:
|
|
|
|
branches:
|
|
|
|
exclude: [ l10n_master ]
|
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
|
2022-01-25 07:32:42 +03:00
|
|
|
useCache: ${{ eq('$(USE_CACHE)', 'true') }}
|
2022-01-24 10:51:34 +03:00
|
|
|
|
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
|
|
|
|
python tools/chineselink.py check
|
|
|
|
displayName: Translation up-to-date
|
2022-01-24 10:51:34 +03:00
|
|
|
|
2021-01-25 06:17:02 +03:00
|
|
|
- script: |
|
|
|
|
cd docs/en_US
|
|
|
|
sphinx-build -M html . _build -W --keep-going -T
|
|
|
|
displayName: Sphinx # TODO: rstcheck
|
|
|
|
|
|
|
|
- job: python
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
|
|
|
steps:
|
2022-01-24 10:51:34 +03:00
|
|
|
- template: templates/install-dependencies.yml
|
|
|
|
parameters:
|
|
|
|
platform: ubuntu-latest
|
2022-01-25 07:32:42 +03:00
|
|
|
useCache: ${{ eq('$(USE_CACHE)', 'true') }}
|
2022-01-24 10:51:34 +03:00
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
|
|
|
- job: typescript
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-latest
|
|
|
|
steps:
|
2022-01-24 10:51:34 +03:00
|
|
|
- template: templates/install-dependencies.yml
|
|
|
|
parameters:
|
|
|
|
platform: ubuntu-latest
|
2022-01-25 07:32:42 +03:00
|
|
|
useCache: ${{ eq('$(USE_CACHE)', 'true') }}
|
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/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
|
|
|
|
yarn --cwd ts/webui eslint
|
2021-01-25 06:17:02 +03:00
|
|
|
displayName: ESLint (WebUI)
|
|
|
|
|
2022-01-25 09:02:10 +03:00
|
|
|
- script: |
|
|
|
|
yarn --cwd ts/webui tsc
|
|
|
|
displayName: Type Check (WebUI)
|
|
|
|
|
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
|
2022-01-25 07:32:42 +03:00
|
|
|
useCache: ${{ eq('$(USE_CACHE)', 'true') }}
|
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
|
2022-01-25 07:32:42 +03:00
|
|
|
useCache: ${{ eq('$(USE_CACHE)', 'true') }}
|
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
|
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
|
2022-01-25 07:32:42 +03:00
|
|
|
useCache: ${{ eq('$(USE_CACHE)', 'true') }}
|
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
|
2022-01-25 07:32:42 +03:00
|
|
|
useCache: ${{ eq('$(USE_CACHE)', 'true') }}
|
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
|