azure-pipelines.yml 4.31 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
  - script: |
      python3 -m pip install torch==0.4.1 --user
      python3 -m pip install torchvision==0.2.1 --user
chicm-ms's avatar
chicm-ms committed
23
      python3 -m pip install tensorflow==1.13.1 --user
chicm-ms's avatar
chicm-ms committed
24
25
26
      python3 -m pip install keras==2.1.6 --user
      python3 -m pip install gym onnx --user
      sudo apt-get install swig -y
27
28
      nnictl package install --name=SMAC
      nnictl package install --name=BOHB
chicm-ms's avatar
chicm-ms committed
29
    displayName: 'Install dependencies'
Gems Guo's avatar
Gems Guo committed
30
  - script: |
chicm-ms's avatar
chicm-ms committed
31
32
33
34
35
36
37
38
      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'
39
40
  - script: |
      python3 -m pip install flake8 --user
41
      IGNORE=./tools/nni_annotation/testcase/*:F821,./examples/trials/mnist-nas/*/mnist*.py:F821,./examples/trials/nas_cifar10/src/cifar10/general_child.py:F821
42
43
      python3 -m flake8 . --count --per-file-ignores=$IGNORE --select=E9,F63,F72,F82 --show-source --statistics
    displayName: 'Run flake8 tests to find Python syntax errors and undefined names'
44
45
46
47
  - script: |
      cd test
      source unittest.sh
    displayName: 'Unit test'
Gems Guo's avatar
Gems Guo committed
48
49
  - script: |
      cd test
50
      python3 naive_test.py
51
52
53
    displayName: 'Naive test'
  - script: |
      cd test
54
      python3 tuner_test.py
55
    displayName: 'Built-in tuners / assessors tests'
Gems Guo's avatar
Gems Guo committed
56
57
  - script: |
      cd test
58
      python3 metrics_test.py
59
    displayName: 'Trial job metrics test'
chicm-ms's avatar
chicm-ms committed
60
61
  - script: |
      cd test
62
      python3 cli_test.py
chicm-ms's avatar
chicm-ms committed
63
    displayName: 'nnicli test'
64

chicm-ms's avatar
chicm-ms committed
65
- job: 'basic_test_pr_macOS'
66
67
68
69
70
71
72
73
74
75
76
77
  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
78
      echo "##vso[task.setvariable variable=PATH]${HOME}/Library/Python/3.7/bin:${PATH}"
79
    displayName: 'Install nni toolkit via source code'
80
  - script: |
81
82
83
      python3 -m pip install torch==0.4.1 --user
      python3 -m pip install torchvision==0.2.1 --user
      python3 -m pip install tensorflow==1.13.1 --user
84
85
86
      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
87
88
89
90
91
      nnictl package install --name=SMAC
    displayName: 'Install dependencies'
  - script: |
      cd test
      source unittest.sh
92
    displayName: 'Unit test'
93
94
  - script: |
      cd test
95
      python3 naive_test.py
96
    displayName: 'Naive test'
97
98
  - script: |
      cd test
99
      python3 tuner_test.py
100
    displayName: 'Built-in tuners / assessors tests'
chicm-ms's avatar
chicm-ms committed
101
102
  - script: |
      cd test
103
      python3 cli_test.py
chicm-ms's avatar
chicm-ms committed
104
    displayName: 'nnicli test'
chicm-ms's avatar
chicm-ms committed
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136

- 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
      python -m pip install https://download.pytorch.org/whl/cu90/torch-0.4.1-cp36-cp36m-win_amd64.whl --user
      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'