fast-test.yml 6.26 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
44
45
      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
      python3 -m pip install --upgrade 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
46
47
48
      sudo apt-get install swig -y
      nnictl package install --name=SMAC
      nnictl package install --name=BOHB
liuzhe-lz's avatar
liuzhe-lz committed
49
    displayName: Install extra dependencies
50
51
52
53
54
55
56

  - 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
57
    displayName: pylint and flake8
58
59
60
61

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

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

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

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


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

  # This platform runs integration test first.

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

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

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

  - script: |
      set -e
liuzhe-lz's avatar
liuzhe-lz committed
108
109
110
111
      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
112
113
114
      sudo apt-get install swig -y
      nnictl package install --name=SMAC
      nnictl package install --name=BOHB
liuzhe-lz's avatar
liuzhe-lz committed
115
    displayName: Install extra dependencies
116
117
118

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

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

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


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

  # This platform runs TypeScript unit test first.

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

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

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

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

  - script: |
      set -e
      # pytorch Mac binary does not support CUDA, default is cpu version
liuzhe-lz's avatar
liuzhe-lz committed
169
170
      python -m pip install torchvision==0.6.0 torch==1.5.0
      python -m pip install tensorflow==2.3.1
171
172
173
174
      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
liuzhe-lz's avatar
liuzhe-lz committed
175
    displayName: Install extra dependencies
176
177
178

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

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


# FIXME: Windows UT is still under debugging

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

  # This platform runs Python unit test first.

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

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

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

  - script: |
liuzhe-lz's avatar
liuzhe-lz committed
212
213
214
215
      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
216
217
218
219

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

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

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


trigger:
  branches:
    exclude: [ l10n_master ]