azure-pipelines.yml 5.65 KB
Newer Older
chicm-ms's avatar
chicm-ms committed
1
2
3
# Azure hosted agents specification:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops

Gems Guo's avatar
Gems Guo committed
4
jobs:
chicm-ms's avatar
chicm-ms committed
5
- job: 'ubuntu_1804_python36'
chicm-ms's avatar
chicm-ms committed
6
  pool:
chicm-ms's avatar
chicm-ms committed
7
    vmImage: 'Ubuntu 18.04'
Gems Guo's avatar
Gems Guo committed
8
9

  steps:
chicm-ms's avatar
chicm-ms committed
10
  - script: |
11
      set -e
chicm-ms's avatar
chicm-ms committed
12
13
      python3 -m pip install --upgrade pip setuptools --user
      python3 -m pip install coverage --user
14
      echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
Gems Guo's avatar
Gems Guo committed
15
    displayName: 'Install python tools'
chicm-ms's avatar
chicm-ms committed
16
  - script: |
17
18
      make
      python3 -m pip install -U -e .
chicm-ms's avatar
chicm-ms committed
19
    displayName: 'Install nni toolkit via source code'
20
21
  - script: |
      set -e
22
      cd ts/nni_manager
23
      yarn eslint
chicm-ms's avatar
chicm-ms committed
24
      # uncomment following 2 lines to enable webui eslint
Lijiao's avatar
Lijiao committed
25
26
      cd ../webui
      yarn eslint
27
    displayName: 'Run eslint'
28
  - script: |
29
      set -e
Yuge Zhang's avatar
Yuge Zhang committed
30
      sudo apt-get install -y pandoc
Yuge Zhang's avatar
Yuge Zhang committed
31
      python3 -m pip install pygments --user --upgrade
chicm-ms's avatar
chicm-ms committed
32
      python3 -m pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html --user
chicm-ms's avatar
chicm-ms committed
33
34
      python3 -m pip install tensorflow==2.2.0 --user
      python3 -m pip install keras==2.4.2 --user
35
      python3 -m pip install gym onnx peewee thop --user
Yuge Zhang's avatar
Yuge Zhang committed
36
      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 --user
chicm-ms's avatar
chicm-ms committed
37
      sudo apt-get install swig -y
38
39
      nnictl package install --name=SMAC
      nnictl package install --name=BOHB
chicm-ms's avatar
chicm-ms committed
40
    displayName: 'Install dependencies'
41
42
  - script: |
      cd test
chicm-ms's avatar
chicm-ms committed
43
      source scripts/unittest.sh
44
    displayName: 'Unit test'
Gems Guo's avatar
Gems Guo committed
45
46
  - script: |
      cd test
chicm-ms's avatar
chicm-ms committed
47
48
      python3 nni_test/nnitest/run_tests.py --config config/pr_tests.yml
    displayName: 'Simple test'
49
50
51
52
  - script: |
      cd docs/en_US/
      sphinx-build -M html . _build -W
    displayName: 'Sphinx Documentation Build check'
53

54
- job: 'ubuntu_1804_python36_legacy_torch_tf'
chicm-ms's avatar
chicm-ms committed
55
  pool:
56
    vmImage: 'Ubuntu 18.04'
chicm-ms's avatar
chicm-ms committed
57
58
59

  steps:
  - script: |
60
      set -e
chicm-ms's avatar
chicm-ms committed
61
      python3 -m pip install --upgrade pip setuptools --user
62
      python3 -m pip install pylint==2.6.0 astroid==2.4.2 --user
chicm-ms's avatar
chicm-ms committed
63
      python3 -m pip install coverage --user
64
      python3 -m pip install thop --user
chicm-ms's avatar
chicm-ms committed
65
66
67
      echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
    displayName: 'Install python tools'
  - script: |
68
69
      make
      python3 -m pip install -U -e .
chicm-ms's avatar
chicm-ms committed
70
71
    displayName: 'Install nni toolkit via source code'
  - script: |
72
      set -e
chicm-ms's avatar
chicm-ms committed
73
74
75
      python3 -m pip install torch==1.3.1+cpu torchvision==0.4.2+cpu -f https://download.pytorch.org/whl/torch_stable.html --user
      python3 -m pip install tensorflow==1.15.2 --user
      python3 -m pip install keras==2.1.6 --user
Yuge Zhang's avatar
Yuge Zhang committed
76
      python3 -m pip install gym onnx peewee --user
chicm-ms's avatar
chicm-ms committed
77
78
79
80
      sudo apt-get install swig -y
      nnictl package install --name=SMAC
      nnictl package install --name=BOHB
    displayName: 'Install dependencies'
chicm-ms's avatar
chicm-ms committed
81
82
83
84
85
86
87
  - script: |
      set -e
      python3 -m pylint --rcfile pylintrc nni
    displayName: 'Run pylint'
  - script: |
      set -e
      python3 -m pip install flake8 --user
88
89
90
      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
      python3 -m flake8 examples --count --exclude=$EXCLUDES --select=E9,F63,F72,F82 --show-source --statistics
chicm-ms's avatar
chicm-ms committed
91
    displayName: 'Run flake8 tests to find Python syntax errors and undefined names'
chicm-ms's avatar
chicm-ms committed
92
93
94
95
96
97
98
99
100
101
  - script: |
      cd test
      source scripts/unittest.sh
    displayName: 'Unit test'
  - script: |
      cd test
      python3 nni_test/nnitest/run_tests.py --config config/pr_tests.yml
    displayName: 'Simple test'


102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# NOTE: seems failed because nnictl is not added to path
#- job: 'macos_latest_python37'
#  pool:
#    vmImage: 'macOS-latest'
#
#  steps:
#  - script: |
#      export PYTHON37_BIN_DIR=/usr/local/Cellar/python@3.7/`ls /usr/local/Cellar/python@3.7`/bin
#      echo "##vso[task.setvariable variable=PATH]${PYTHON37_BIN_DIR}:${HOME}/Library/Python/3.7/bin:${PATH}"
#      python3 -m pip install --upgrade pip setuptools
#    displayName: 'Install python tools'
#  - script: |
#      echo "network-timeout 600000" >> ${HOME}/.yarnrc
#      make
#      python3 -m pip install -U -e .
#    displayName: 'Install nni toolkit via source code'
#  - script: |
#      set -e
#      # pytorch Mac binary does not support CUDA, default is cpu version
#      python3 -m pip install torchvision==0.6.0 torch==1.5.0 --user
#      python3 -m pip install tensorflow==2.3.1 --user
#      brew install swig@3
#      rm -f /usr/local/bin/swig
#      ln -s /usr/local/opt/swig\@3/bin/swig /usr/local/bin/swig
#      nnictl package install --name=SMAC
#    displayName: 'Install dependencies'
#  - script: |
#      cd test
#      source scripts/unittest.sh
#    displayName: 'Unit test'
#  - script: |
#      cd test
#      python3 nni_test/nnitest/run_tests.py --config config/pr_tests.yml
#    displayName: 'Simple test'
chicm-ms's avatar
chicm-ms committed
136

137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#- job: 'win2016_python37'
#  pool:
#    vmImage: 'vs2017-win2016'
#
#  steps:
#  - script: |
#      powershell.exe -file install.ps1
#    displayName: 'Install nni toolkit via source code'
#  - script: |
#      python -m pip install scikit-learn==0.23.2 --user
#      python -m pip install keras==2.1.6 --user
#      python -m pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html --user
#      python -m pip install tensorflow==1.15.2 --user
#    displayName: 'Install dependencies'
#  - script: |
#      cd test
#      powershell.exe -file scripts/unittest.ps1
#    displayName: 'unit test'
#  - script: |
#      cd test
#      python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
#    displayName: 'Simple test'