fast-test.yml 6.49 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
  pool:
7
    vmImage: ubuntu-latest
8
9
10
11

  # This platform tests lint and doc first.

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

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

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

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

37
38
  # FIXME: temporarily fixed to pytorch 1.6 as 1.7 won't work with compression

39
40
41
  - script: |
      set -e
      sudo apt-get install -y pandoc
42
43
44
45
46
47
48
49
50
      python -m pip install --upgrade pygments
      python -m pip install "torch==1.6.0+cpu" "torchvision==0.7.0+cpu" -f https://download.pytorch.org/whl/torch_stable.html
      python -m pip install tensorflow
      python -m pip install gym onnx peewee thop graphviz
      python -m pip install sphinx==3.3.1 sphinx-argparse==0.2.5 sphinx-rtd-theme==0.4.2 sphinxcontrib-websupport==1.1.0 nbsphinx
      sudo apt-get remove swig -y
      sudo apt-get install swig3.0 -y
      sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
      python -m pip install -e .[SMAC,BOHB]
liuzhe-lz's avatar
liuzhe-lz committed
51
    displayName: Install extra dependencies
52
53
54

  - script: |
      set -e
55
56
      python -m pylint --rcfile pylintrc nni
      python -m flake8 nni --count --select=E9,F63,F72,F82 --show-source --statistics
57
      EXCLUDES=examples/trials/mnist-nas/*/mnist*.py,examples/trials/nas_cifar10/src/cifar10/general_child.py
58
      python -m flake8 examples --count --exclude=$EXCLUDES --select=E9,F63,F72,F82 --show-source --statistics
liuzhe-lz's avatar
liuzhe-lz committed
59
    displayName: pylint and flake8
60
61
62
63

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

  - script: |
67
      set -e
68
      cd test
69
70
71
72
73
74
      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
liuzhe-lz's avatar
liuzhe-lz committed
75
    displayName: Python unit test
76
77
78
79
80
81
82

  - script: |
      set -e
      cd ts/nni_manager
      yarn test
      cd ../nasui
      CI=true yarn test
liuzhe-lz's avatar
liuzhe-lz committed
83
    displayName: TypeScript unit test
84
85
86

  - script: |
      cd test
87
      python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
liuzhe-lz's avatar
liuzhe-lz committed
88
    displayName: Simple integration test
89
90


liuzhe-lz's avatar
liuzhe-lz committed
91
- job: ubuntu_legacy
92
  pool:
liuzhe-lz's avatar
liuzhe-lz committed
93
    vmImage: ubuntu-18.04
94
95
96
97

  # This platform runs integration test first.

  steps:
liuzhe-lz's avatar
liuzhe-lz committed
98
99
100
101
102
  - task: UsePythonVersion@0
    inputs:
      versionSpec: 3.6
    displayName: Configure Python version

103
104
  - script: |
      set -e
liuzhe-lz's avatar
liuzhe-lz committed
105
106
      python -m pip install --upgrade pip setuptools
      python -m pip install pytest coverage
107
      echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
liuzhe-lz's avatar
liuzhe-lz committed
108
    displayName: Install Python tools
109
110

  - script: |
liuzhe-lz's avatar
liuzhe-lz committed
111
112
      python setup.py develop
    displayName: Install NNI
113
114
115

  - script: |
      set -e
liuzhe-lz's avatar
liuzhe-lz committed
116
117
118
119
      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
120
      sudo apt-get install swig -y
121
      python -m pip install -e .[SMAC,BOHB]
liuzhe-lz's avatar
liuzhe-lz committed
122
    displayName: Install extra dependencies
123
124
125

  - script: |
      cd test
liuzhe-lz's avatar
liuzhe-lz committed
126
127
      python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
    displayName: Simple integration test
128
129
130

  - script: |
      cd test
liuzhe-lz's avatar
liuzhe-lz committed
131
132
      python -m pytest ut
    displayName: Python unit test
133
134
135
136
137
138
139

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


liuzhe-lz's avatar
liuzhe-lz committed
143
- job: macos
144
  pool:
liuzhe-lz's avatar
liuzhe-lz committed
145
    vmImage: macOS-10.15
146
147
148
149

  # This platform runs TypeScript unit test first.

  steps:
150
151
152
  - task: UsePythonVersion@0
    inputs:
      versionSpec: 3.8
liuzhe-lz's avatar
liuzhe-lz committed
153
    displayName: Configure Python version
154

155
156
  - script: |
      set -e
157
      echo "##vso[task.setvariable variable=PATH]${PATH}:${HOME}/.local/bin"
liuzhe-lz's avatar
liuzhe-lz committed
158
159
160
      python -m pip install --upgrade pip setuptools wheel
      python -m pip install pytest coverage
    displayName: Install Python tools
161
162

  - script: |
liuzhe-lz's avatar
liuzhe-lz committed
163
164
      python setup.py develop
    displayName: Install NNI
165
166
167

  - script: |
      set -e
168
169
170
      export CI=true
      (cd ts/nni_manager && yarn test)
      (cd ts/nasui && yarn test)
liuzhe-lz's avatar
liuzhe-lz committed
171
    displayName: TypeScript unit test
172
173
174
175

  - script: |
      set -e
      # pytorch Mac binary does not support CUDA, default is cpu version
liuzhe-lz's avatar
liuzhe-lz committed
176
177
      python -m pip install torchvision==0.6.0 torch==1.5.0
      python -m pip install tensorflow==2.3.1
178
179
180
      brew install swig@3
      rm -f /usr/local/bin/swig
      ln -s /usr/local/opt/swig\@3/bin/swig /usr/local/bin/swig
181
      python -m pip install -e .[SMAC]
liuzhe-lz's avatar
liuzhe-lz committed
182
    displayName: Install extra dependencies
183
184
185

  - script: |
      cd test
liuzhe-lz's avatar
liuzhe-lz committed
186
187
      python -m pytest ut
    displayName: Python unit test
188
189
190

  - script: |
      cd test
liuzhe-lz's avatar
liuzhe-lz committed
191
192
      python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
    displayName: Simple integration test
193
194
195
196


# FIXME: Windows UT is still under debugging

liuzhe-lz's avatar
liuzhe-lz committed
197
- job: windows
198
  pool:
liuzhe-lz's avatar
liuzhe-lz committed
199
    vmImage: windows-2019
200
201
202
203

  # This platform runs Python unit test first.

  steps:
liuzhe-lz's avatar
liuzhe-lz committed
204
205
206
207
208
  - task: UsePythonVersion@0
    inputs:
      versionSpec: 3.8
    displayName: Configure Python version

209
  - script: |
liuzhe-lz's avatar
liuzhe-lz committed
210
211
212
      python -m pip install --upgrade pip setuptools
      python -m pip install pytest coverage
    displayName: Install Python tools
213
214

  - script: |
liuzhe-lz's avatar
liuzhe-lz committed
215
      python setup.py develop --no-user
liuzhe-lz's avatar
liuzhe-lz committed
216
    displayName: Install NNI
217
218

  - script: |
liuzhe-lz's avatar
liuzhe-lz committed
219
220
221
222
      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
223
224
225
226

  - script: |
      cd test
      python -m pytest ut
liuzhe-lz's avatar
liuzhe-lz committed
227
    displayName: Python unit test
228
229
230
231

  - script: |
      cd ts/nni_manager
      yarn test
liuzhe-lz's avatar
liuzhe-lz committed
232
    displayName: TypeScript unit test
233
234
235
236

  - script: |
      cd test
      python nni_test/nnitest/run_tests.py --config config/pr_tests.yml
liuzhe-lz's avatar
liuzhe-lz committed
237
    displayName: Simple integration test
liuzhe-lz's avatar
liuzhe-lz committed
238
239
240
241
242


trigger:
  branches:
    exclude: [ l10n_master ]