pipelines-it-paiYarn.yml 2.2 KB
Newer Older
SparkSnail's avatar
SparkSnail committed
1
2
3
4
5
6
7
8
9
10
11
12
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

jobs:
- job: 'integration_test_paiYarn'
  timeoutInMinutes: 0

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

  - script: |
13
      set -e
SparkSnail's avatar
SparkSnail committed
14
15
16
17
18
19
20
21
22
23
24
25
      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'

  - script: |
26
      set -e
SparkSnail's avatar
SparkSnail committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
      sudo apt-get install swig -y
      PATH=$HOME/.local/bin:$PATH nnictl package install --name=SMAC
      PATH=$HOME/.local/bin:$PATH nnictl package install --name=BOHB
    displayName: 'Install dependencies for integration tests in PAI mode'

  - script: |
      set -e
      if [ $(build_docker_img) = 'true' ]
      then
        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 ../../
      else
        export TEST_IMG=$(existing_docker_img)
      fi

      echo "TEST_IMG:$TEST_IMG"
      cd test
      python3 generate_ts_config.py --ts paiYarn --pai_host $(pai_host) --pai_user $(pai_user) --pai_pwd $(pai_pwd) --vc $(pai_virtual_cluster) \
      --nni_docker_image $TEST_IMG --data_dir $(data_dir) --output_dir $(output_dir) --nni_manager_ip $(nni_manager_ip)

      PATH=$HOME/.local/bin:$PATH python3 config_test.py --ts paiYarn
      PATH=$HOME/.local/bin:$PATH python3 metrics_test.py
    displayName: 'integration test'