azure-pipelines.yml 4.83 KB
Newer Older
Gems Guo's avatar
Gems Guo committed
1
jobs:
chicm-ms's avatar
chicm-ms committed
2
3
4
5
6
7
8
- job: 'basic_test_pr_ubuntu'
  pool:
    vmImage: 'Ubuntu 16.04'
  strategy:
    matrix:
      Python36:
        PYTHON_VERSION: '3.6'
Gems Guo's avatar
Gems Guo committed
9
10

  steps:
chicm-ms's avatar
chicm-ms committed
11
12
13
14
  - script: |
      python3 -m pip install --upgrade pip setuptools --user
      python3 -m pip install pylint==2.3.1 astroid==2.2.5 --user
      python3 -m pip install coverage --user
15
      echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
Gems Guo's avatar
Gems Guo committed
16
    displayName: 'Install python tools'
chicm-ms's avatar
chicm-ms committed
17
18
19
  - script: |
      source install.sh
    displayName: 'Install nni toolkit via source code'
20
21
22
23
  - script: |
      set -e
      cd src/nni_manager
      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: |
QuanluZhang's avatar
QuanluZhang committed
29
30
      python3 -m pip install torch==1.2.0 --user
      python3 -m pip install torchvision==0.4.0 --user
chicm-ms's avatar
chicm-ms committed
31
      python3 -m pip install tensorflow==1.13.1 --user
chicm-ms's avatar
chicm-ms committed
32
33
      python3 -m pip install keras==2.1.6 --user
      python3 -m pip install gym onnx --user
34
      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 --user
chicm-ms's avatar
chicm-ms committed
35
      sudo apt-get install swig -y
36
37
      nnictl package install --name=SMAC
      nnictl package install --name=BOHB
chicm-ms's avatar
chicm-ms committed
38
    displayName: 'Install dependencies'
Gems Guo's avatar
Gems Guo committed
39
  - script: |
chicm-ms's avatar
chicm-ms committed
40
41
42
43
44
45
46
47
      set -e
      python3 -m pylint --rcfile pylintrc nni_annotation
      python3 -m pylint --rcfile pylintrc nni_cmd
      python3 -m pylint --rcfile pylintrc nni_gpu_tool
      python3 -m pylint --rcfile pylintrc nni_trial_tool
      python3 -m pylint --rcfile pylintrc nni
      python3 -m pylint --rcfile pylintrc nnicli
    displayName: 'Run pylint'
48
49
  - script: |
      python3 -m pip install flake8 --user
chicm-ms's avatar
chicm-ms committed
50
      EXCLUDES=./src/nni_manager/,./src/webui,./tools/nni_annotation/testcase/,./examples/trials/mnist-nas/*/mnist*.py,./examples/trials/nas_cifar10/src/cifar10/general_child.py
chicm-ms's avatar
chicm-ms committed
51
      python3 -m flake8 . --count --exclude=$EXCLUDES --select=E9,F63,F72,F82 --show-source --statistics
52
    displayName: 'Run flake8 tests to find Python syntax errors and undefined names'
53
54
55
56
  - script: |
      cd test
      source unittest.sh
    displayName: 'Unit test'
Gems Guo's avatar
Gems Guo committed
57
58
  - script: |
      cd test
59
      python3 naive_test.py
60
61
62
    displayName: 'Naive test'
  - script: |
      cd test
63
      python3 tuner_test.py
64
    displayName: 'Built-in tuners / assessors tests'
Gems Guo's avatar
Gems Guo committed
65
66
  - script: |
      cd test
67
      python3 metrics_test.py
68
    displayName: 'Trial job metrics test'
chicm-ms's avatar
chicm-ms committed
69
70
  - script: |
      cd test
71
      python3 cli_test.py
chicm-ms's avatar
chicm-ms committed
72
    displayName: 'nnicli test'
73
74
75
76
  - script: |
      cd docs/en_US/
      sphinx-build -M html . _build -W
    displayName: 'Sphinx Documentation Build check'
77

chicm-ms's avatar
chicm-ms committed
78
- job: 'basic_test_pr_macOS'
79
80
81
82
83
84
85
86
87
88
89
90
  pool:
    vmImage: 'macOS 10.13'
  strategy:
    matrix:
      Python36:
        PYTHON_VERSION: '3.6'

  steps:
  - script: python3 -m pip install --upgrade pip setuptools
    displayName: 'Install python tools'
  - script: |
      source install.sh
91
      echo "##vso[task.setvariable variable=PATH]${HOME}/Library/Python/3.7/bin:${PATH}"
92
    displayName: 'Install nni toolkit via source code'
93
  - script: |
QuanluZhang's avatar
QuanluZhang committed
94
95
      python3 -m pip install torch==1.2.0 --user
      python3 -m pip install torchvision==0.4.0 --user
96
      python3 -m pip install tensorflow==1.13.1 --user
97
98
99
      ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
      brew install swig@3
      ln -s /usr/local/opt/swig\@3/bin/swig /usr/local/bin/swig
100
101
102
103
104
      nnictl package install --name=SMAC
    displayName: 'Install dependencies'
  - script: |
      cd test
      source unittest.sh
105
    displayName: 'Unit test'
106
107
  - script: |
      cd test
108
      python3 naive_test.py
109
    displayName: 'Naive test'
110
111
  - script: |
      cd test
112
      python3 tuner_test.py
113
    displayName: 'Built-in tuners / assessors tests'
chicm-ms's avatar
chicm-ms committed
114
115
  - script: |
      cd test
116
      python3 cli_test.py
chicm-ms's avatar
chicm-ms committed
117
    displayName: 'nnicli test'
chicm-ms's avatar
chicm-ms committed
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133

- job: 'basic_test_pr_Windows'
  pool:
    vmImage: 'vs2017-win2016'
  strategy:
    matrix:
      Python36:
        PYTHON_VERSION: '3.6'

  steps:
  - script: |
      powershell.exe -file install.ps1
    displayName: 'Install nni toolkit via source code'
  - script: |
      python -m pip install scikit-learn==0.20.0 --user
      python -m pip install keras==2.1.6 --user
QuanluZhang's avatar
QuanluZhang committed
134
      python -m pip install torch===1.2.0 torchvision===0.4.1 -f https://download.pytorch.org/whl/torch_stable.html --user
chicm-ms's avatar
chicm-ms committed
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
      python -m pip install torchvision --user
      python -m pip install tensorflow==1.13.1 --user
    displayName: 'Install dependencies'
  - script: |
      cd test
      powershell.exe -file unittest.ps1
    displayName: 'unit test'
  - script: |
      cd test
      python tuner_test.py
    displayName: 'Built-in tuners / assessors tests'
  - script: |
      cd test
      PATH=$HOME/.local/bin:$PATH python3 cli_test.py
    displayName: 'nnicli test'