integration-test-remote-l2l.yml 3.58 KB
Newer Older
liuzhe-lz's avatar
liuzhe-lz committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
trigger: none
pr: none
schedules:
- cron: 0 16 * * *
  branches:
    include: [ master ]

# variables set on VSO: (for security concern)
#   manager_ip
#   worker_ip
#   password_in_docker

jobs:
- job: remote_linux2linux
  pool: NNI CI REMOTE CLI
  timeoutInMinutes: 120

  steps:
  - script: |
      export NNI_RELEASE=999.$(date -u +%Y%m%d%H%M%S)
      echo "##vso[task.setvariable variable=PATH]${PATH}:${HOME}/.local/bin"
      echo "##vso[task.setvariable variable=NNI_RELEASE]${NNI_RELEASE}"

      echo "Working directory: ${PWD}"
      echo "NNI version: ${NNI_RELEASE}"

27
      python3 -m pip install --upgrade pip setuptools
liuzhe-lz's avatar
liuzhe-lz committed
28
29
30
31
    displayName: Prepare

  - script: |
      set -e
32
      python3 test/vso_tools/install_nni.py $(NNI_RELEASE) SMAC,BOHB
liuzhe-lz's avatar
liuzhe-lz committed
33
34
35

      cd examples/tuners/customized_tuner
      python3 setup.py develop --user
36
37
      nnictl algo register --meta meta_file.yml
    displayName: Install NNI
liuzhe-lz's avatar
liuzhe-lz committed
38
39
40
41
42
43
44
45
46
47

  - task: CopyFilesOverSSH@0
    inputs:
      sshEndpoint: $(worker)
      sourceFolder: dist
      targetFolder: /tmp/nnitest/$(Build.BuildId)/dist
      overwrite: true
    displayName: Copy wheel to remote machine
    timeoutInMinutes: 10

48
49
50
51
52
53
54
55
56
  - task: CopyFilesOverSSH@0
    inputs:
      sshEndpoint: $(worker)
      contents: Dockerfile
      targetFolder: /tmp/nnitest/$(Build.BuildId)
      overwrite: true
    displayName: Copy dockerfile to remote machine
    timeoutInMinutes: 10

liuzhe-lz's avatar
liuzhe-lz committed
57
58
59
60
61
62
63
64
65
  - task: CopyFilesOverSSH@0
    inputs:
      sshEndpoint: $(worker)
      sourceFolder: test
      targetFolder: /tmp/nnitest/$(Build.BuildId)/test
      overwrite: true
    displayName: Copy test scripts to remote machine
    timeoutInMinutes: 10

J-shang's avatar
J-shang committed
66
67
68
69
  # Need del later
  - task: CopyFilesOverSSH@0
    inputs:
      sshEndpoint: $(worker)
J-shang's avatar
J-shang committed
70
      contents: test/vso_tools/interim_patch.py
J-shang's avatar
J-shang committed
71
72
      targetFolder: /tmp/nnitest/$(Build.BuildId)
      overwrite: true
J-shang's avatar
J-shang committed
73
    displayName: Copy torch patch to remote machine
J-shang's avatar
J-shang committed
74
75
    timeoutInMinutes: 10

liuzhe-lz's avatar
liuzhe-lz committed
76
77
78
79
  - task: SSH@0
    inputs:
      sshEndpoint: $(worker)
      runOptions: commands
80
81
      commands: python3 /tmp/nnitest/$(Build.BuildId)/test/vso_tools/start_docker.py $(NNI_RELEASE) $(Build.BuildId) $(password_in_docker)
    displayName: Install NNI and run docker on Linux worker
liuzhe-lz's avatar
liuzhe-lz committed
82
83
84
85
86

  - script: |
      cd test
      python3 nni_test/nnitest/generate_ts_config.py \
          --ts remote \
87
          --remote_reuse true \
liuzhe-lz's avatar
liuzhe-lz committed
88
89
90
91
          --remote_user nni \
          --remote_host $(worker_ip) \
          --remote_port $(docker_port) \
          --remote_pwd $(password_in_docker) \
92
93
          --nni_manager_ip $(manager_ip) \
          --azurestoragetoken $(azureblob_token_test) \
94
95
96
97
          --nfs_server $(NFS_IP) \
          --local_mount_point $(LOCAL_MOUNT_POINT) \
          --remote_mount_point $(REMOTE_MOUNT_POINT) \
          --exported_directory $(Exported_Directory)
liuzhe-lz's avatar
liuzhe-lz committed
98
      python3 nni_test/nnitest/run_tests.py --config config/integration_tests.yml --ts remote
99
    displayName: Integration test (reuse mode)
liuzhe-lz's avatar
liuzhe-lz committed
100
101
102
103
104

  - script: |
      cd test
      python3 nni_test/nnitest/generate_ts_config.py \
          --ts remote \
105
          --remote_reuse false \
liuzhe-lz's avatar
liuzhe-lz committed
106
107
108
109
110
111
          --remote_user nni \
          --remote_host $(worker_ip) \
          --remote_port $(docker_port) \
          --remote_pwd $(password_in_docker) \
          --nni_manager_ip $(manager_ip)
      python3 nni_test/nnitest/run_tests.py --config config/integration_tests.yml --ts remote
112
113
    displayName: Integration test

liuzhe-lz's avatar
liuzhe-lz committed
114
115
116
117
118

  - task: SSH@0
    inputs:
      sshEndpoint: $(worker)
      runOptions: commands
119
120
      commands: python3 /tmp/nnitest/$(Build.BuildId)/test/vso_tools/stop_docker.py $(Build.BuildId)
    condition: always()
liuzhe-lz's avatar
liuzhe-lz committed
121
    displayName: Stop docker