pipelines-it-pai.yml 2.38 KB
Newer Older
liuzhe-lz's avatar
liuzhe-lz committed
1
2
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
chicm-ms's avatar
chicm-ms committed
3

4
5
jobs:
- job: 'integration_test_pai'
chicm-ms's avatar
chicm-ms committed
6
  timeoutInMinutes: 120
7
8
9
10
11
12

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

  - script: |
13
      set -e
14
      cd deployment/pypi
15
16
17
18
      if [ -d ./dist ]
      then
        rm -rf ./dist/*
      fi
19
20
21
22
23
24
25
26
27
28
      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'

29
  - script: |
30
      set -e
31
      sudo apt-get install swig -y
SparkSnail's avatar
SparkSnail committed
32
      PATH=$HOME/.local/bin:$PATH nnictl package install --name=SMAC
33
      PATH=$HOME/.local/bin:$PATH nnictl package install --name=BOHB
34
35
    displayName: 'Install dependencies for integration tests in PAI mode'

36
  - script: |
Chengmin Chi's avatar
updates  
Chengmin Chi committed
37
      set -e
38
39
      if [ $(build_docker_img) = 'true' ]
      then
chicm-ms's avatar
chicm-ms committed
40
41
42
43
        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
44
        sed -ie 's/RUN python3 -m pip --no-cache-dir install nni/COPY .\/dist\/* .\/\nRUN python3 -m pip install nni-*.whl/' ../docker/Dockerfile
chicm-ms's avatar
chicm-ms committed
45
46
47
48
49
50
51
52
53
        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 ../../
54
55
56
      else
        export TEST_IMG=$(existing_docker_img)
      fi
chicm-ms's avatar
chicm-ms committed
57

58
59
      echo "TEST_IMG:$TEST_IMG"
      cd test
SparkSnail's avatar
SparkSnail committed
60
      python3 nni_test/nnitest/generate_ts_config.py --ts pai --pai_host $(pai_host) --pai_user $(pai_user) --nni_docker_image $TEST_IMG --pai_storage_config_name $(pai_storage_config_name)\
SparkSnail's avatar
SparkSnail committed
61
       --pai_token $(pai_token) --nni_manager_nfs_mount_path $(nni_manager_nfs_mount_path) --container_nfs_mount_path $(container_nfs_mount_path) --nni_manager_ip $(nni_manager_ip) --vc $(virtual_cluster)
62
      PATH=$HOME/.local/bin:$PATH python3 nni_test/nnitest/run_tests.py --config config/integration_tests.yml --ts pai
63
    displayName: 'integration test'