pipelines-it-pai.yml 3.5 KB
Newer Older
chicm-ms's avatar
chicm-ms committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright (c) Microsoft Corporation
# All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge,
# to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and
# to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

21
22
jobs:
- job: 'integration_test_pai'
23
  timeoutInMinutes: 0
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

  steps:
  - script: python3 -m pip install --upgrade pip setuptools --user
    displayName: 'Install python tools'

  - script: |
      cd deployment/pypi
      echo 'building prerelease package...'
      make build
      ls $(Build.SourcesDirectory)/deployment/pypi/dist/
    condition: eq( variables['build_docker_img'], 'true' )
    displayName: 'build nni bdsit_wheel'

  - script: |
      source install.sh
    displayName: 'Install nni toolkit via source code'

41
42
43
44
45
  - script: |
      python3 -m pip install scikit-learn==0.20.0 --user
      python3 -m pip install torch==0.4.1 --user
      python3 -m pip install torchvision==0.2.1 --user
      python3 -m pip install keras==2.1.6 --user
SparkSnail's avatar
SparkSnail committed
46
      python3 -m pip install tensorflow-gpu==1.12.0 --user
47
      sudo apt-get install swig -y
SparkSnail's avatar
SparkSnail committed
48
      PATH=$HOME/.local/bin:$PATH nnictl package install --name=SMAC
49
      PATH=$HOME/.local/bin:$PATH nnictl package install --name=BOHB
50
51
    displayName: 'Install dependencies for integration tests in PAI mode'

52
  - script: |
Chengmin Chi's avatar
updates  
Chengmin Chi committed
53
      set -e
54
55
      if [ $(build_docker_img) = 'true' ]
      then
chicm-ms's avatar
chicm-ms committed
56
57
58
59
60
61
62
63
64
65
66
67
68
69
        cd deployment/pypi
        docker login -u $(docker_hub_user) -p $(docker_hub_pwd)
        echo 'updating docker file for installing nni from local...'
        # update Dockerfile to install NNI in docker image from whl file built in last step
        sed -ie 's/RUN python3 -m pip --no-cache-dir install nni/COPY .\/dist\/* .\nRUN python3 -m pip install nni-*.whl/' ../docker/Dockerfile
        cat ../docker/Dockerfile
        export IMG_TAG=`date -u +%y%m%d%H%M`

        echo 'build and upload docker image'
        docker build -f ../docker/Dockerfile -t $(test_docker_img_name):$IMG_TAG .
        docker push $(test_docker_img_name):$IMG_TAG

        export TEST_IMG=$(test_docker_img_name):$IMG_TAG
        cd ../../
70
71
72
      else
        export TEST_IMG=$(existing_docker_img)
      fi
chicm-ms's avatar
chicm-ms committed
73

74
75
      echo "TEST_IMG:$TEST_IMG"
      cd test
76
      python3 generate_ts_config.py --ts pai --pai_host $(pai_host) --pai_user $(pai_user) --pai_pwd $(pai_pwd) --vc $(pai_virtual_cluster) \
77
78
      --nni_docker_image $TEST_IMG --data_dir $(data_dir) --output_dir $(output_dir) --nni_manager_ip $(nni_manager_ip)

79
      PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts pai --exclude multi_phase_batch,multi_phase_grid
Chengmin Chi's avatar
updates  
Chengmin Chi committed
80
      PATH=$HOME/.local/bin:$PATH python3 metrics_test.py
81
    displayName: 'integration test'