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

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
stages:
- stage: lint
  jobs:
  - job: docs
    pool:
      vmImage: ubuntu-latest
    variables:
      PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
    steps:
    - task: UsePythonVersion@0
      inputs:
        versionSpec: 3.8
      displayName: Configure Python version
    - script: |
        sudo apt-get install -y pandoc
        sudo apt-get remove swig -y
        sudo apt-get install swig3.0 -y
        sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
      displayName: Install apt packages
Yuge Zhang's avatar
Yuge Zhang committed
23
24
25
26
27
28
29
30
    - task: Cache@2
      inputs:
        key: 'python | "$(Agent.OS)" | dependencies/*.txt'
        restoreKeys: | 
          python | "$(Agent.OS)"
          python
        path: $(PIP_CACHE_DIR)
      displayName: Cache pip packages
31
32
33
34
35
36
    - script: |
        set -e
        python -m pip install -U -r dependencies/setup.txt
        python -m pip install -r dependencies/develop.txt
        python -m pip install -r dependencies/required.txt
        python -m pip install -r dependencies/recommended.txt
37
        python -m pip install -r dependencies/required_extra.txt
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
      displayName: Install requirements
    - script: |
        cd docs/en_US
        sphinx-build -M html . _build -W --keep-going -T
      displayName: Sphinx  # TODO: rstcheck

  - job: python
    pool:
      vmImage: ubuntu-latest
    variables:
      PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
    steps:
    - task: UsePythonVersion@0
      inputs:
        versionSpec: 3.8
      displayName: Configure Python version
    - script: |
        sudo apt-get remove swig -y
        sudo apt-get install swig3.0 -y
        sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
      displayName: Install apt packages
Yuge Zhang's avatar
Yuge Zhang committed
59
60
61
62
63
64
65
66
    - task: Cache@2
      inputs:
        key: 'python | "$(Agent.OS)" | dependencies/*.txt'
        restoreKeys: | 
          python | "$(Agent.OS)"
          python
        path: $(PIP_CACHE_DIR)
      displayName: Cache pip packages
67
68
69
70
71
72
    - script: |
        set -e
        python -m pip install -U -r dependencies/setup.txt
        python -m pip install -r dependencies/develop.txt
        python -m pip install -r dependencies/required.txt
        python -m pip install -r dependencies/recommended.txt
73
        python -m pip install -r dependencies/required_extra.txt
74
75
76
77
78
79
80
81
82
83
84
85
86
      displayName: Install requirements
    - script: python -m pylint --rcfile pylintrc nni
      displayName: pylint
    - 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
87
88
    variables:
      YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
89
    steps:
90
91
92
93
94
95
96
    - task: Cache@2
      inputs:
        key: 'yarn | "$(Agent.OS)" | ts/**/yarn.lock, !**/node_modules/**'
        restoreKeys: |
          yarn | "$(Agent.OS)"
        path: $(YARN_CACHE_FOLDER)
      displayName: Cache yarn packages
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
    - script: |
        set -e
        cd ts/nni_manager
        yarn
        yarn eslint
      displayName: ESLint (NNI Manager)
    - script: |
        set -e
        cd ts/webui
        yarn
        yarn eslint
      displayName: ESLint (WebUI)


- stage: test
  jobs:
  - job: ubuntu_latest
    pool:
      vmImage: ubuntu-latest
116
117
118
    variables:
      PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
      YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
119
120
121
122
123
124
125

    steps:
    - task: UsePythonVersion@0
      inputs:
        versionSpec: 3.8
      displayName: Configure Python version

126
127
128
129
130
131
132
133
134
    - script: |
        sudo apt-get install -y pandoc
        sudo apt-get remove swig -y
        sudo apt-get install swig3.0 -y
        sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
      displayName: Install apt packages

    - task: Cache@2
      inputs:
135
        key: 'python | "$(Agent.OS)" | latest | dependencies/*.txt'
136
137
138
139
140
141
142
143
        restoreKeys: | 
          python | "$(Agent.OS)"
          python
        path: $(PIP_CACHE_DIR)
      displayName: Cache pip packages

    - task: Cache@2
      inputs:
144
        key: 'yarn | "$(Agent.OS)" | latest | ts/**/yarn.lock, !**/node_modules/**'
145
146
147
148
149
        restoreKeys: |
          yarn | "$(Agent.OS)"
        path: $(YARN_CACHE_FOLDER)
      displayName: Cache yarn packages

150
151
    - script: |
        set -e
152
153
        python -m pip install -U -r dependencies/setup.txt
        python -m pip install -r dependencies/develop.txt
154
155
156
157
158
159
160
161
162
        echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
      displayName: Install Python tools

    - script: |
        python setup.py develop
      displayName: Install NNI

    - script: |
        set -e
163
164
        python -m pip install -r dependencies/recommended.txt
        python -m pip install -e .[SMAC,BOHB,PPOTuner]
165
166
      displayName: Install extra dependencies

J-shang's avatar
J-shang committed
167
168
169
170
171
172
    # Need del later
    - script: |
        set -e
        python interim_vision_patch.py
      displayName: Vision MNIST Patch

173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
    - script: |
        set -e
        cd test
        python -m pytest ut --ignore=ut/sdk/test_pruners.py \
          --ignore=ut/sdk/test_compressor_tf.py \
          --ignore=ut/sdk/test_compressor_torch.py
        python -m pytest ut/sdk/test_pruners.py
        python -m pytest ut/sdk/test_compressor_tf.py
        python -m pytest ut/sdk/test_compressor_torch.py
      displayName: Python unit test

    - script: |
        set -e
        cd ts/nni_manager
        yarn test
        cd ../nasui
        CI=true yarn test
      displayName: TypeScript unit test

    - 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
200
201
202
    variables:
      PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
      YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
203
204
205
206
207
208
209
210

    # This platform runs integration test first.
    steps:
    - task: UsePythonVersion@0
      inputs:
        versionSpec: 3.6
      displayName: Configure Python version

211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
    - script: |
        sudo apt-get install -y pandoc
        sudo apt-get remove swig -y
        sudo apt-get install swig3.0 -y
        sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
      displayName: Install apt packages

    - task: Cache@2
      inputs:
        key: 'python | "$(Agent.OS)" | legacy | dependencies/*.txt'
        restoreKeys: | 
          python | "$(Agent.OS)"
          python
        path: $(PIP_CACHE_DIR)
      displayName: Cache pip packages

    - task: Cache@2
      inputs:
        key: 'yarn | "$(Agent.OS)" | legacy | ts/**/yarn.lock, !**/node_modules/**'
        restoreKeys: |
          yarn | "$(Agent.OS)"
        path: $(YARN_CACHE_FOLDER)
      displayName: Cache yarn packages

235
236
    - script: |
        set -e
237
238
        python -m pip install -U -r dependencies/setup.txt
        python -m pip install -r dependencies/develop.txt
239
240
241
242
243
244
245
246
247
        echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
      displayName: Install Python tools

    - script: |
        python setup.py develop
      displayName: Install NNI

    - script: |
        set -e
248
249
        python -m pip install -r dependencies/recommended_legacy.txt
        python -m pip install -e .[SMAC,BOHB,PPOTuner]
250
251
      displayName: Install extra dependencies

J-shang's avatar
J-shang committed
252
253
254
255
256
257
258
    # Need del later
    - script: |
        set -e
        python interim_vision_patch.py
      displayName: Vision MNIST Patch


259
260
261
262
263
264
265
    - script: |
        cd test
        python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
      displayName: Simple integration test

    - script: |
        cd test
266
267
268
        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
269
270
271
272
273
274
275
276
277
278
279
280
281
      displayName: Python unit test

    - script: |
        set -e
        cd ts/nni_manager
        yarn test
        cd ../nasui
        CI=true yarn test
      displayName: TypeScript unit test

  - job: macos
    pool:
      vmImage: macOS-10.15
282
283
284
    variables:
      PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
      YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
285
286
287
288
289
290
291
292
293

    # This platform runs TypeScript unit test first.

    steps:
    - task: UsePythonVersion@0
      inputs:
        versionSpec: 3.8
      displayName: Configure Python version

294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
    - script: |
        brew install swig@3
        rm -f /usr/local/bin/swig
        ln -s /usr/local/opt/swig\@3/bin/swig /usr/local/bin/swig
      displayName: Install brew packages

    - task: Cache@2
      inputs:
        key: 'python | "$(Agent.OS)" | dependencies/*.txt'
        restoreKeys: | 
          python | "$(Agent.OS)"
          python
        path: $(PIP_CACHE_DIR)
      displayName: Cache pip packages

    - task: Cache@2
      inputs:
        key: 'yarn | "$(Agent.OS)" | ts/**/yarn.lock, !**/node_modules/**'
        restoreKeys: |
          yarn | "$(Agent.OS)"
        path: $(YARN_CACHE_FOLDER)
      displayName: Cache yarn packages

317
318
    - script: |
        set -e
319
320
        python -m pip install -U -r dependencies/setup.txt
        python -m pip install -r dependencies/develop.txt
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
        echo "##vso[task.setvariable variable=PATH]${PATH}:${HOME}/.local/bin"
      displayName: Install Python tools

    - script: |
        python setup.py develop
      displayName: Install NNI

    - script: |
        set -e
        export CI=true
        (cd ts/nni_manager && yarn test)
        (cd ts/nasui && yarn test)
      displayName: TypeScript unit test

    - script: |
        set -e
337
338
        python -m pip install -r dependencies/recommended.txt
        python -m pip install -e .[SMAC,BOHB,PPOTuner]
339
340
      displayName: Install extra dependencies

J-shang's avatar
J-shang committed
341
342
343
344
345
346
    # Need del later
    - script: |
        set -e
        python interim_vision_patch.py
      displayName: Vision MNIST Patch

347
348
349
350
351
352
353
354
355
356
357
358
359
    - 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

  - job: windows
    pool:
      vmImage: windows-2019
360
361
362
    variables:
      PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
      YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
363
364
365
366
367
368
369
370
371

    # This platform runs Python unit test first.

    steps:
    - task: UsePythonVersion@0
      inputs:
        versionSpec: 3.8
      displayName: Configure Python version

372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
    - task: Cache@2
      inputs:
        key: 'python | "$(Agent.OS)" | dependencies/*.txt'
        restoreKeys: | 
          python | "$(Agent.OS)"
          python
        path: $(PIP_CACHE_DIR)
      displayName: Cache pip packages

    - task: Cache@2
      inputs:
        key: 'yarn | "$(Agent.OS)" | ts/**/yarn.lock, !**/node_modules/**'
        restoreKeys: |
          yarn | "$(Agent.OS)"
        path: $(YARN_CACHE_FOLDER)
      displayName: Cache yarn packages

389
    - script: |
390
391
392
        set -e
        python -m pip install -U -r dependencies/setup.txt
        python -m pip install -r dependencies/develop.txt
393
394
395
396
397
398
399
      displayName: Install Python tools

    - script: |
        python setup.py develop --no-user
      displayName: Install NNI

    - script: |
400
        python -m pip install -r dependencies/recommended.txt
401
402
      displayName: Install extra dependencies

J-shang's avatar
J-shang committed
403
404
405
406
407
408
    # Need del later
    - script: |
        set -e
        python interim_vision_patch.py
      displayName: Vision MNIST Patch

409
410
411
412
413
414
415
416
417
418
419
420
421
422
    - script: |
        cd test
        python -m pytest ut
      displayName: Python unit test

    - script: |
        cd ts/nni_manager
        yarn test
      displayName: TypeScript unit test

    - script: |
        cd test
        python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
      displayName: Simple integration test
liuzhe-lz's avatar
liuzhe-lz committed
423
424
425
426
427


trigger:
  branches:
    exclude: [ l10n_master ]