pipelines-it-pai-windows.yml 2.8 KB
Newer Older
1
2
jobs:
- job: 'build_docker_image'
chicm-ms's avatar
chicm-ms committed
3
  timeoutInMinutes: 120
4
5
6
7
8
9
10
11
  pool:
    vmImage: 'Ubuntu 16.04'
  steps:
  - script: python3 -m pip install --upgrade pip setuptools --user
    displayName: 'Install python tools'

  - script: |
      cd deployment/pypi
12
13
14
15
      if [ -d ./dist ]
      then
        rm -rf ./dist/*
      fi
16
17
18
19
20
21
22
      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: |
23
      set -e
24
25
26
27
28
29
      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
30
        sed -ie 's/RUN python3 -m pip --no-cache-dir install nni/COPY .\/dist\/* .\/\nRUN python3 -m pip install nni-*.whl/' ../docker/Dockerfile
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
62
        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 "##vso[task.setvariable variable=TEST_IMG]$TEST_IMG"
    displayName: 'build docker image'
  - script:
      echo $TEST_IMG
      echo "##vso[task.setvariable variable=docker_image;isOutput=true]$TEST_IMG"
    name: setvariableStep
    displayName: 'set image variable'

- job: 'integration_test_pai'
  timeoutInMinutes: 0
  dependsOn: build_docker_image
  variables:
    docker_image: $[ dependencies.build_docker_image.outputs['setvariableStep.docker_image'] ]

  steps:
  - script: |
      set PATH=$(ENV_PATH)
      python --version
      powershell.exe -file install.ps1
    displayName: 'Install nni toolkit via source code'
63
64
65
66
  - script: |
      set PATH=$(ENV_PATH)
      python -m pip install scikit-learn==0.21.0 --user
    displayName: 'Install dependencies for integration tests'
67
68
69
70
  - script: |
      cd test
      set PATH=$(ENV_PATH)
      python --version
SparkSnail's avatar
SparkSnail committed
71
      mount -o anon $(pai_nfs_uri) $(local_nfs_uri)
SparkSnail's avatar
SparkSnail committed
72
      python nni_test/nnitest/generate_ts_config.py --ts pai --pai_token $(pai_token) --pai_host $(pai_host) --pai_user $(pai_user) --nni_docker_image $(docker_image) --pai_storage_config_name $(pai_storage_config_name) --nni_manager_nfs_mount_path $(nni_manager_nfs_mount_path) --container_nfs_mount_path $(container_nfs_mount_path) --nni_manager_ip $(nni_manager_ip)
73
      python nni_test/nnitest/run_tests.py --config config/integration_tests.yml --ts pai
74
    displayName: 'Examples and advanced features tests on pai'