fast-test.yml 6.19 KB
Newer Older
1
2
3
4
# 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.

jobs:
liuzhe-lz's avatar
liuzhe-lz committed
5
- job: ubuntu_latest
6
7
  pool:
    # FIXME: In ubuntu-20.04 Python interpreter crashed during SMAC UT
liuzhe-lz's avatar
liuzhe-lz committed
8
    vmImage: ubuntu-18.04
9
10
11
12

  # This platform tests lint and doc first.

  steps:
liuzhe-lz's avatar
liuzhe-lz committed
13
14
15
16
17
  - task: UsePythonVersion@0
    inputs:
      versionSpec: 3.6
    displayName: Configure Python version

18
19
  - script: |
      set -e
liuzhe-lz's avatar
liuzhe-lz committed
20
21
22
      python3 -m pip install --upgrade pip setuptools
      python3 -m pip install pytest coverage
      python3 -m pip install pylint flake8
23
      echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
liuzhe-lz's avatar
liuzhe-lz committed
24
    displayName: Install Python tools
25
26
27

  - script: |
      python3 setup.py develop
liuzhe-lz's avatar
liuzhe-lz committed
28
    displayName: Install NNI
29
30
31
32
33
34
35

  - script: |
      set -e
      cd ts/nni_manager
      yarn eslint
      cd ../webui
      yarn eslint
liuzhe-lz's avatar
liuzhe-lz committed
36
    displayName: ESLint
37
38
39
40

  - script: |
      set -e
      sudo apt-get install -y pandoc
liuzhe-lz's avatar
liuzhe-lz committed
41
42
43
      python3 -m pip install --upgrade pygments
      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 --upgrade tensorflow
44
      python3 -m pip install --upgrade gym onnx peewee thop graphviz
liuzhe-lz's avatar
liuzhe-lz committed
45
      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
46
      sudo apt-get install swig -y
47
      python3 -m pip install -e .[SMAC,BOHB]
liuzhe-lz's avatar
liuzhe-lz committed
48
    displayName: Install extra dependencies
49
50
51
52
53
54
55

  - script: |
      set -e
      python3 -m pylint --rcfile pylintrc nni
      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
liuzhe-lz's avatar
liuzhe-lz committed
56
    displayName: pylint and flake8
57
58
59
60

  - script: |
      cd docs/en_US
      sphinx-build -M html . _build -W --keep-going -T
liuzhe-lz's avatar
liuzhe-lz committed
61
    displayName: Check Sphinx documentation
62
63
64
65

  - script: |
      cd test
      python3 -m pytest ut
liuzhe-lz's avatar
liuzhe-lz committed
66
    displayName: Python unit test
67
68
69
70
71
72
73

  - script: |
      set -e
      cd ts/nni_manager
      yarn test
      cd ../nasui
      CI=true yarn test
liuzhe-lz's avatar
liuzhe-lz committed
74
    displayName: TypeScript unit test
75
76
77
78

  - script: |
      cd test
      python3 nni_test/nnitest/run_tests.py --config config/pr_tests.yml
liuzhe-lz's avatar
liuzhe-lz committed
79
    displayName: Simple integration test
80
81


liuzhe-lz's avatar
liuzhe-lz committed
82
- job: ubuntu_legacy
83
  pool:
liuzhe-lz's avatar
liuzhe-lz committed
84
    vmImage: ubuntu-18.04
85
86
87
88

  # This platform runs integration test first.

  steps:
liuzhe-lz's avatar
liuzhe-lz committed
89
90
91
92
93
  - task: UsePythonVersion@0
    inputs:
      versionSpec: 3.6
    displayName: Configure Python version

94
95
  - script: |
      set -e
liuzhe-lz's avatar
liuzhe-lz committed
96
97
      python -m pip install --upgrade pip setuptools
      python -m pip install pytest coverage
98
      echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
liuzhe-lz's avatar
liuzhe-lz committed
99
    displayName: Install Python tools
100
101

  - script: |
liuzhe-lz's avatar
liuzhe-lz committed
102
103
      python setup.py develop
    displayName: Install NNI
104
105
106

  - script: |
      set -e
liuzhe-lz's avatar
liuzhe-lz committed
107
108
109
110
      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 tensorflow==1.15.4
      python -m pip install keras==2.1.6
      python -m pip install gym onnx peewee
111
      sudo apt-get install swig -y
112
      python -m pip install -e .[SMAC,BOHB]
liuzhe-lz's avatar
liuzhe-lz committed
113
    displayName: Install extra dependencies
114
115
116

  - script: |
      cd test
liuzhe-lz's avatar
liuzhe-lz committed
117
118
      python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
    displayName: Simple integration test
119
120
121

  - script: |
      cd test
liuzhe-lz's avatar
liuzhe-lz committed
122
123
      python -m pytest ut
    displayName: Python unit test
124
125
126
127
128
129
130

  - script: |
      set -e
      cd ts/nni_manager
      yarn test
      cd ../nasui
      CI=true yarn test
liuzhe-lz's avatar
liuzhe-lz committed
131
    displayName: TypeScript unit test
132
133


liuzhe-lz's avatar
liuzhe-lz committed
134
- job: macos
135
  pool:
liuzhe-lz's avatar
liuzhe-lz committed
136
    vmImage: macOS-10.15
137
138
139
140

  # This platform runs TypeScript unit test first.

  steps:
141
142
143
  - task: UsePythonVersion@0
    inputs:
      versionSpec: 3.8
liuzhe-lz's avatar
liuzhe-lz committed
144
    displayName: Configure Python version
145

146
147
  - script: |
      set -e
148
      echo "##vso[task.setvariable variable=PATH]${PATH}:${HOME}/.local/bin"
liuzhe-lz's avatar
liuzhe-lz committed
149
150
151
      python -m pip install --upgrade pip setuptools wheel
      python -m pip install pytest coverage
    displayName: Install Python tools
152
153

  - script: |
liuzhe-lz's avatar
liuzhe-lz committed
154
155
      python setup.py develop
    displayName: Install NNI
156
157
158

  - script: |
      set -e
159
160
161
      export CI=true
      (cd ts/nni_manager && yarn test)
      (cd ts/nasui && yarn test)
liuzhe-lz's avatar
liuzhe-lz committed
162
    displayName: TypeScript unit test
163
164
165
166

  - script: |
      set -e
      # pytorch Mac binary does not support CUDA, default is cpu version
liuzhe-lz's avatar
liuzhe-lz committed
167
168
      python -m pip install torchvision==0.6.0 torch==1.5.0
      python -m pip install tensorflow==2.3.1
169
170
171
      brew install swig@3
      rm -f /usr/local/bin/swig
      ln -s /usr/local/opt/swig\@3/bin/swig /usr/local/bin/swig
172
      python -m pip install -e .[SMAC]
liuzhe-lz's avatar
liuzhe-lz committed
173
    displayName: Install extra dependencies
174
175
176

  - script: |
      cd test
liuzhe-lz's avatar
liuzhe-lz committed
177
178
      python -m pytest ut
    displayName: Python unit test
179
180
181

  - script: |
      cd test
liuzhe-lz's avatar
liuzhe-lz committed
182
183
      python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
    displayName: Simple integration test
184
185
186
187


# FIXME: Windows UT is still under debugging

liuzhe-lz's avatar
liuzhe-lz committed
188
- job: windows
189
  pool:
liuzhe-lz's avatar
liuzhe-lz committed
190
    vmImage: windows-2019
191
192
193
194

  # This platform runs Python unit test first.

  steps:
liuzhe-lz's avatar
liuzhe-lz committed
195
196
197
198
199
  - task: UsePythonVersion@0
    inputs:
      versionSpec: 3.8
    displayName: Configure Python version

200
  - script: |
liuzhe-lz's avatar
liuzhe-lz committed
201
202
203
      python -m pip install --upgrade pip setuptools
      python -m pip install pytest coverage
    displayName: Install Python tools
204
205

  - script: |
liuzhe-lz's avatar
liuzhe-lz committed
206
      python setup.py develop --no-user
liuzhe-lz's avatar
liuzhe-lz committed
207
    displayName: Install NNI
208
209

  - script: |
liuzhe-lz's avatar
liuzhe-lz committed
210
211
212
213
      python -m pip install scikit-learn==0.23.2
      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 tensorflow==2.3.1
    displayName: Install extra dependencies
214
215
216
217

  - script: |
      cd test
      python -m pytest ut
liuzhe-lz's avatar
liuzhe-lz committed
218
    displayName: Python unit test
219
220
221
222

  - script: |
      cd ts/nni_manager
      yarn test
liuzhe-lz's avatar
liuzhe-lz committed
223
    displayName: TypeScript unit test
224
225
226
227

  - script: |
      cd test
      python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
liuzhe-lz's avatar
liuzhe-lz committed
228
    displayName: Simple integration test
liuzhe-lz's avatar
liuzhe-lz committed
229
230
231
232
233


trigger:
  branches:
    exclude: [ l10n_master ]