Unverified Commit 9710f170 authored by liuzhe-lz's avatar liuzhe-lz Committed by GitHub
Browse files

Hotfix UT pipeline (#3180)

parent b1cfea57
...@@ -2,25 +2,30 @@ ...@@ -2,25 +2,30 @@
# so that a bug in any module will cause at least one platform to fail quickly. # so that a bug in any module will cause at least one platform to fail quickly.
jobs: jobs:
- job: 'ubuntu_latest' - job: ubuntu_latest
pool: pool:
# FIXME: In ubuntu-20.04 Python interpreter crashed during SMAC UT # FIXME: In ubuntu-20.04 Python interpreter crashed during SMAC UT
vmImage: 'ubuntu-18.04' vmImage: ubuntu-18.04
# This platform tests lint and doc first. # This platform tests lint and doc first.
steps: steps:
- task: UsePythonVersion@0
inputs:
versionSpec: 3.6
displayName: Configure Python version
- script: | - script: |
set -e set -e
python3 -m pip install -U --upgrade pip setuptools python3 -m pip install --upgrade pip setuptools
python3 -m pip install -U pytest coverage python3 -m pip install pytest coverage
python3 -m pip install -U pylint flake8 python3 -m pip install pylint flake8
echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}" echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
displayName: 'Install Python tools' displayName: Install Python tools
- script: | - script: |
python3 setup.py develop python3 setup.py develop
displayName: 'Install NNI' displayName: Install NNI
- script: | - script: |
set -e set -e
...@@ -28,21 +33,20 @@ jobs: ...@@ -28,21 +33,20 @@ jobs:
yarn eslint yarn eslint
cd ../webui cd ../webui
yarn eslint yarn eslint
displayName: 'ESLint' displayName: ESLint
- script: | - script: |
set -e set -e
sudo apt-get install -y pandoc sudo apt-get install -y pandoc
python3 -m pip install -U --upgrade pygments python3 -m pip install --upgrade pygments
python3 -m pip install -U torch==1.7.0+cpu torchvision==0.8.1+cpu -f https://download.pytorch.org/whl/torch_stable.html python3 -m pip install --upgrade torch>=1.7.0+cpu torchvision>=0.8.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
python3 -m pip install -U tensorflow==2.3.1 python3 -m pip install --upgrade tensorflow
python3 -m pip install -U keras==2.4.2 python3 -m pip install --upgrade gym onnx peewee thop
python3 -m pip install -U gym onnx peewee thop python3 -m pip install sphinx==1.8.3 sphinx-argparse==0.2.5 sphinx-markdown-tables==0.0.9 sphinx-rtd-theme==0.4.2 sphinxcontrib-websupport==1.1.0 recommonmark==0.5.0 nbsphinx
python3 -m pip install -U sphinx==1.8.3 sphinx-argparse==0.2.5 sphinx-markdown-tables==0.0.9 sphinx-rtd-theme==0.4.2 sphinxcontrib-websupport==1.1.0 recommonmark==0.5.0 nbsphinx
sudo apt-get install swig -y sudo apt-get install swig -y
nnictl package install --name=SMAC nnictl package install --name=SMAC
nnictl package install --name=BOHB nnictl package install --name=BOHB
displayName: 'Install extra dependencies' displayName: Install extra dependencies
- script: | - script: |
set -e set -e
...@@ -50,17 +54,17 @@ jobs: ...@@ -50,17 +54,17 @@ jobs:
python3 -m flake8 nni --count --select=E9,F63,F72,F82 --show-source --statistics python3 -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 EXCLUDES=examples/trials/mnist-nas/*/mnist*.py,examples/trials/nas_cifar10/src/cifar10/general_child.py
python3 -m flake8 examples --count --exclude=$EXCLUDES --select=E9,F63,F72,F82 --show-source --statistics python3 -m flake8 examples --count --exclude=$EXCLUDES --select=E9,F63,F72,F82 --show-source --statistics
displayName: 'pylint and flake8' displayName: pylint and flake8
- script: | - script: |
cd docs/en_US cd docs/en_US
sphinx-build -M html . _build -W --keep-going -T sphinx-build -M html . _build -W --keep-going -T
displayName: 'Check Sphinx documentation' displayName: Check Sphinx documentation
- script: | - script: |
cd test cd test
python3 -m pytest ut python3 -m pytest ut
displayName: 'Python unit test' displayName: Python unit test
- script: | - script: |
set -e set -e
...@@ -68,52 +72,57 @@ jobs: ...@@ -68,52 +72,57 @@ jobs:
yarn test yarn test
cd ../nasui cd ../nasui
CI=true yarn test CI=true yarn test
displayName: 'TypeScript unit test' displayName: TypeScript unit test
- script: | - script: |
cd test cd test
python3 nni_test/nnitest/run_tests.py --config config/pr_tests.yml python3 nni_test/nnitest/run_tests.py --config config/pr_tests.yml
displayName: 'Simple integration test' displayName: Simple integration test
- job: 'ubuntu_legacy' - job: ubuntu_legacy
pool: pool:
vmImage: 'ubuntu-18.04' vmImage: ubuntu-18.04
# This platform runs integration test first. # This platform runs integration test first.
steps: steps:
- task: UsePythonVersion@0
inputs:
versionSpec: 3.6
displayName: Configure Python version
- script: | - script: |
set -e set -e
python3 -m pip install -U --upgrade pip setuptools python -m pip install --upgrade pip setuptools
python3 -m pip install -U pytest coverage python -m pip install pytest coverage
echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}" echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
displayName: 'Install Python tools' displayName: Install Python tools
- script: | - script: |
python3 setup.py develop python setup.py develop
displayName: 'Install NNI' displayName: Install NNI
- script: | - script: |
set -e set -e
python3 -m pip install -U torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html python -m pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
python3 -m pip install -U tensorflow==1.15.2 python -m pip install tensorflow==1.15.4
python3 -m pip install -U keras==2.1.6 python -m pip install keras==2.1.6
python3 -m pip install -U gym onnx peewee python -m pip install gym onnx peewee
sudo apt-get install swig -y sudo apt-get install swig -y
nnictl package install --name=SMAC nnictl package install --name=SMAC
nnictl package install --name=BOHB nnictl package install --name=BOHB
displayName: 'Install extra dependencies' displayName: Install extra dependencies
- script: | - script: |
cd test cd test
python3 nni_test/nnitest/run_tests.py --config config/pr_tests.yml python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
displayName: 'Simple integration test' displayName: Simple integration test
- script: | - script: |
cd test cd test
python3 -m pytest ut python -m pytest ut
displayName: 'Python unit test' displayName: Python unit test
- script: | - script: |
set -e set -e
...@@ -121,12 +130,12 @@ jobs: ...@@ -121,12 +130,12 @@ jobs:
yarn test yarn test
cd ../nasui cd ../nasui
CI=true yarn test CI=true yarn test
displayName: 'TypeScript unit test' displayName: TypeScript unit test
- job: 'macos' - job: macos
pool: pool:
vmImage: 'macOS-10.15' vmImage: macOS-10.15
# This platform runs TypeScript unit test first. # This platform runs TypeScript unit test first.
...@@ -134,86 +143,91 @@ jobs: ...@@ -134,86 +143,91 @@ jobs:
- task: UsePythonVersion@0 - task: UsePythonVersion@0
inputs: inputs:
versionSpec: 3.8 versionSpec: 3.8
displayName: Configure Python displayName: Configure Python version
- script: | - script: |
set -e set -e
echo "##vso[task.setvariable variable=PATH]${PATH}:${HOME}/.local/bin" echo "##vso[task.setvariable variable=PATH]${PATH}:${HOME}/.local/bin"
python -m pip install -U --upgrade pip setuptools wheel python -m pip install --upgrade pip setuptools wheel
python -m pip install -U pytest coverage python -m pip install pytest coverage
displayName: 'Install Python tools' displayName: Install Python tools
- script: | - script: |
python3 setup.py develop python setup.py develop
displayName: 'Install NNI' displayName: Install NNI
- script: | - script: |
set -e set -e
export CI=true export CI=true
(cd ts/nni_manager && yarn test) (cd ts/nni_manager && yarn test)
(cd ts/nasui && yarn test) (cd ts/nasui && yarn test)
displayName: 'TypeScript unit test' displayName: TypeScript unit test
- script: | - script: |
set -e set -e
# pytorch Mac binary does not support CUDA, default is cpu version # pytorch Mac binary does not support CUDA, default is cpu version
python3 -m pip install -U torchvision==0.6.0 torch==1.5.0 python -m pip install torchvision==0.6.0 torch==1.5.0
python3 -m pip install -U tensorflow==2.3.1 python -m pip install tensorflow==2.3.1
brew install swig@3 brew install swig@3
rm -f /usr/local/bin/swig rm -f /usr/local/bin/swig
ln -s /usr/local/opt/swig\@3/bin/swig /usr/local/bin/swig ln -s /usr/local/opt/swig\@3/bin/swig /usr/local/bin/swig
nnictl package install --name=SMAC nnictl package install --name=SMAC
displayName: 'Install extra dependencies' displayName: Install extra dependencies
- script: | - script: |
cd test cd test
python3 -m pytest ut python -m pytest ut
displayName: 'Python unit test' displayName: Python unit test
- script: | - script: |
cd test cd test
python3 nni_test/nnitest/run_tests.py --config config/pr_tests.yml python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
displayName: 'Simple integration test' displayName: Simple integration test
# FIXME: Windows UT is still under debugging # FIXME: Windows UT is still under debugging
- job: 'windows' - job: windows
pool: pool:
vmImage: 'windows-2019' vmImage: windows-2019
# This platform runs Python unit test first. # This platform runs Python unit test first.
steps: steps:
- task: UsePythonVersion@0
inputs:
versionSpec: 3.8
displayName: Configure Python version
- script: | - script: |
python -m pip install -U --upgrade pip setuptools python -m pip install --upgrade pip setuptools
python -m pip install -U pytest coverage python -m pip install pytest coverage
displayName: 'Install Python tools' displayName: Install Python tools
- script: | - script: |
python setup.py develop --no-user python setup.py develop --no-user
displayName: 'Install NNI' displayName: Install NNI
- script: | - script: |
python -m pip install -U scikit-learn==0.23.2 python -m pip install scikit-learn==0.23.2
python -m pip install -U torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html python -m pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install -U tensorflow==2.3.1 python -m pip install tensorflow==2.3.1
displayName: 'Install extra dependencies' displayName: Install extra dependencies
- script: | - script: |
cd test cd test
python -m pytest ut python -m pytest ut
displayName: 'Python unit test' displayName: Python unit test
- script: | - script: |
cd ts/nni_manager cd ts/nni_manager
yarn test yarn test
displayName: 'TypeScript unit test' displayName: TypeScript unit test
- script: | - script: |
cd test cd test
python nni_test/nnitest/run_tests.py --config config/pr_tests.yml python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
displayName: 'Simple integration test' displayName: Simple integration test
trigger: trigger:
......
...@@ -65,7 +65,6 @@ dependencies = [ ...@@ -65,7 +65,6 @@ dependencies = [
'ruamel.yaml', 'ruamel.yaml',
'requests', 'requests',
'responses', 'responses',
'scipy',
'schema', 'schema',
'PythonWebHDFS', 'PythonWebHDFS',
'colorama', 'colorama',
...@@ -77,7 +76,9 @@ dependencies = [ ...@@ -77,7 +76,9 @@ dependencies = [
'dataclasses ; python_version < "3.7"', 'dataclasses ; python_version < "3.7"',
'numpy < 1.19.4 ; sys_platform == "win32"', 'numpy < 1.19.4 ; sys_platform == "win32"',
'numpy < 1.20 ; sys_platform != "win32" and python_version < "3.7"', 'numpy < 1.20 ; sys_platform != "win32" and python_version < "3.7"',
'numpy ; sys.platform != "win32" and python_version >= "3.7"' 'numpy ; sys.platform != "win32" and python_version >= "3.7"',
'scipy < 1.6 ; python_version < "3.7"',
'scipy ; python_version >= "3.7"',
] ]
release = os.environ.get('NNI_RELEASE') release = os.environ.get('NNI_RELEASE')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment