"docs/source/CommunitySharings/NNI_AutoFeatureEng.rst" did not exist on "569c35e0baeb8362306d101f66f8b2c514c99611"
deployment-pipelines.yml 7.74 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

jobs:
chicm-ms's avatar
chicm-ms committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
- job: 'version_number_validation'
  pool:
    vmImage: 'Ubuntu 16.04'
  strategy:
    matrix:
      Python36:
        PYTHON_VERSION: '3.6'
  steps:
  - script: |
      echo $(build_version)
      if [[ $(build_version) =~ ^v[0-9](.[0-9]){1,3}$ ]]; then
        echo 'valid build version $(build_version)'
        echo `git describe --tags --abbrev=0`
      else
        echo 'invalid build version $(build_version)'
        exit 1
      fi
    condition: eq( variables['build_type'], 'prerelease' )
    displayName: 'Validate prerelease version number'

  - script: |
      export BRANCH_TAG=`git describe --tags --abbrev=0`
      echo $BRANCH_TAG
      if [[ $BRANCH_TAG = $(build_version) && $BRANCH_TAG =~ ^v[0-9](.[0-9]){1,3}$ ]]; then
        echo 'Build version match branch tag'
      else
        echo 'Build version does not match branch tag'
        exit 1
      fi
    condition: eq( variables['build_type'], 'release' )
    displayName: 'Validate release version number and branch tag'


chicm-ms's avatar
chicm-ms committed
38
- job: 'Build_upload_nni_ubuntu'
chicm-ms's avatar
chicm-ms committed
39
40
  dependsOn: version_number_validation
  condition: succeeded()
chicm-ms's avatar
chicm-ms committed
41
42
43
44
45
46
47
48
49
50
51
52
  pool:
    vmImage: 'Ubuntu 16.04'
  strategy:
    matrix:
      Python36:
        PYTHON_VERSION: '3.6'

  steps:
  - script: |
      python3 -m pip install --upgrade pip setuptools --user
      python3 -m pip install twine --user
    displayName: 'Install twine'
chicm-ms's avatar
chicm-ms committed
53

chicm-ms's avatar
chicm-ms committed
54
55
56
57
  - script: |
      cd deployment/pypi
      if [ $(build_type) = 'prerelease' ]
      then
chicm-ms's avatar
chicm-ms committed
58
59
        # NNI build scripts (Makefile) uses branch tag as package version number
        git tag $(build_version)
chicm-ms's avatar
chicm-ms committed
60
61
62
63
64
65
        echo 'building prerelease package...'
        make version_ts=true build
      else
        echo 'building release package...'
        make build
      fi
chicm-ms's avatar
chicm-ms committed
66
    condition: eq( variables['upload_package'], 'true')
chicm-ms's avatar
chicm-ms committed
67
    displayName: 'build nni bdsit_wheel'
chicm-ms's avatar
chicm-ms committed
68

chicm-ms's avatar
chicm-ms committed
69
70
71
72
73
74
75
76
77
78
  - script: |
      cd deployment/pypi
      if [ $(build_type) = 'prerelease' ]
      then
        echo 'uploading prerelease package to testpypi...'
        python3 -m twine upload -u $(testpypi_user) -p $(testpypi_pwd) --repository-url https://test.pypi.org/legacy/ dist/*
      else
        echo 'uploading release package to pypi...'
        python3 -m twine upload -u $(pypi_user) -p $(pypi_pwd) dist/*
      fi
chicm-ms's avatar
chicm-ms committed
79
    condition: eq( variables['upload_package'], 'true')
chicm-ms's avatar
chicm-ms committed
80
81
82
83
84
85
86
    displayName: 'upload nni package to pypi/testpypi'

  - script: |
      cd deployment/docker

      if [ $(build_type) = 'prerelease' ]
      then
chicm-ms's avatar
chicm-ms committed
87
88
        docker login -u $(docker_hub_dev_user) -p $(docker_hub_dev_pwd)
        export IMG_NAME=$(dev_docker_img)
chicm-ms's avatar
chicm-ms committed
89
        export IMG_TAG=`git describe --tags --abbrev=0`.`date -u +%y%m%d%H%M`
chicm-ms's avatar
chicm-ms committed
90
        echo 'updating docker file for testpyi...'
91
        sed -ie 's/RUN python3 -m pip --no-cache-dir install nni/RUN python3 -m pip install --no-cache-dir --index-url https:\/\/test.pypi.org\/simple --extra-index-url https:\/\/pypi.org\/simple nni/' Dockerfile
chicm-ms's avatar
chicm-ms committed
92
93
94
95
      else
        docker login -u $(docker_hub_user) -p $(docker_hub_pwd)
        export IMG_NAME=msranni/nni
        export IMG_TAG=`git describe --tags --abbrev=0`
chicm-ms's avatar
chicm-ms committed
96
      fi
chicm-ms's avatar
chicm-ms committed
97
98
99
100
101
102
103
104
105
106
107
      echo $IMG_NAME:$IMG_TAG
      cat Dockerfile
      docker build -f Dockerfile -t $IMG_NAME:$IMG_TAG .
      docker push $IMG_NAME:$IMG_TAG

      if [ $(update_latest_tag) = 'true' ]
      then
        docker tag $IMG_NAME:$IMG_TAG $IMG_NAME:latest
        docker push $IMG_NAME:latest
      fi

chicm-ms's avatar
chicm-ms committed
108
    condition: eq( variables['build_docker_img'], 'true')
chicm-ms's avatar
chicm-ms committed
109
110
111
    displayName: 'build and upload nni docker image'

- job: 'Build_upload_nni_macos'
chicm-ms's avatar
chicm-ms committed
112
113
  dependsOn: version_number_validation
  condition: succeeded()
chicm-ms's avatar
chicm-ms committed
114
  pool:
liuzhe-lz's avatar
liuzhe-lz committed
115
    vmImage: 'macOS-10.15'
chicm-ms's avatar
chicm-ms committed
116
117
118
119
120
  steps:
  - script: |
      python3 -m pip install --upgrade pip setuptools --user
      python3 -m pip install twine --user
    displayName: 'Install twine'
chicm-ms's avatar
chicm-ms committed
121

chicm-ms's avatar
chicm-ms committed
122
123
124
  - script: |
      make install-dependencies
    displayName: 'Install nni dependencies'
chicm-ms's avatar
chicm-ms committed
125

chicm-ms's avatar
chicm-ms committed
126
127
128
129
  - script: |
      cd deployment/pypi
      if [ $(build_type) = 'prerelease' ]
      then
chicm-ms's avatar
chicm-ms committed
130
131
        # NNI build scripts (Makefile) uses branch tag as package version number
        git tag $(build_version)
chicm-ms's avatar
chicm-ms committed
132
        echo 'building prerelease package...'
chicm-ms's avatar
chicm-ms committed
133
        PATH=$HOME/Library/Python/3.8/bin:$PATH make version_ts=true build
chicm-ms's avatar
chicm-ms committed
134
135
      else
        echo 'building release package...'
chicm-ms's avatar
chicm-ms committed
136
        PATH=$HOME/Library/Python/3.8/bin:$PATH make build
chicm-ms's avatar
chicm-ms committed
137
      fi
chicm-ms's avatar
chicm-ms committed
138
    condition: eq( variables['upload_package'], 'true')
chicm-ms's avatar
chicm-ms committed
139
    displayName: 'build nni bdsit_wheel'
chicm-ms's avatar
chicm-ms committed
140

chicm-ms's avatar
chicm-ms committed
141
142
143
144
145
146
147
148
149
150
  - script: |
      cd deployment/pypi
      if [ $(build_type) = 'prerelease' ]
      then
        echo 'uploading prerelease package to testpypi...'
        python3 -m twine upload -u $(testpypi_user) -p $(testpypi_pwd) --repository-url https://test.pypi.org/legacy/ dist/*
      else
        echo 'uploading release package to pypi...'
        python3 -m twine upload -u $(pypi_user) -p $(pypi_pwd) dist/*
      fi
chicm-ms's avatar
chicm-ms committed
151
    condition: eq( variables['upload_package'], 'true')
chicm-ms's avatar
chicm-ms committed
152
    displayName: 'upload nni package to pypi/testpypi'
153

154
- job: 'Build_upload_nni_win32'
155
156
157
158
159
160
161
162
163
  dependsOn: version_number_validation
  condition: succeeded()
  pool:
    vmImage: 'vs2017-win2016'
  strategy:
    matrix:
      Python36:
        PYTHON_VERSION: '3.6'
  steps:
164
165
166
  - powershell: |
      python -m pip install --upgrade pip setuptools
      python -m pip install twine
167
168
    displayName: 'Install twine'

169
170
171
  - powershell: |
      cd deployment\pypi
      if($env:BUILD_TYPE -eq 'prerelease'){
172
        # NNI build scripts (powershell) uses branch tag as package version number
173
174
175
176
177
178
179
180
        git tag $env:BUILD_VERSION
        Write-Host 'building prerelease package...'
        .\install.ps1 -version_os 32 -version_ts $True
      }
      else{
        Write-Host 'building release package...'
        .\install.ps1 -version_os 32 -version_ts $False
      }
181
182
183
    condition: eq( variables['upload_package'], 'true')
    displayName: 'build nni bdsit_wheel'

184
185
186
187
  - powershell: |
      cd deployment\pypi
      if($env:BUILD_TYPE -eq 'prerelease'){
        Write-Host 'uploading prerelease package to testpypi...'
188
        python -m twine upload -u $(testpypi_user) -p $(testpypi_pwd) --repository-url https://test.pypi.org/legacy/ dist/*
189
190
191
      }
      else{
        Write-Host 'uploading release package to pypi...'
192
        python -m twine upload -u $(pypi_user) -p $(pypi_pwd) dist/*
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
      }
    condition: eq( variables['upload_package'], 'true')
    displayName: 'upload nni package to pypi/testpypi'

- job: 'Build_upload_nni_win_amd64'
  dependsOn: version_number_validation
  condition: succeeded()
  pool:
    vmImage: 'vs2017-win2016'
  strategy:
    matrix:
      Python36:
        PYTHON_VERSION: '3.6'
  steps:
  - powershell: |
      python -m pip install --upgrade pip setuptools
      python -m pip install twine
    displayName: 'Install twine'

  - powershell: |
      cd deployment\pypi
      if($env:BUILD_TYPE -eq 'prerelease'){
        # NNI build scripts (powershell) uses branch tag as package version number
        git tag $env:BUILD_VERSION
        Write-Host 'building prerelease package...'
        .\install.ps1 -version_os 64 -version_ts $True
      }
      else{
        Write-Host 'building release package...'
        .\install.ps1 -version_os 64 -version_ts $False
      }
    condition: eq( variables['upload_package'], 'true')
    displayName: 'build nni bdsit_wheel'

  - powershell: |
      cd deployment\pypi
      if($env:BUILD_TYPE -eq 'prerelease'){
        Write-Host 'uploading prerelease package to testpypi...'
231
        python -m twine upload -u $(testpypi_user) -p $(testpypi_pwd) --repository-url https://test.pypi.org/legacy/ dist/*
232
233
234
      }
      else{
        Write-Host 'uploading release package to pypi...'
235
        python -m twine upload -u $(pypi_user) -p $(pypi_pwd) dist/*
236
      }
237
    condition: eq( variables['upload_package'], 'true')
238
    displayName: 'upload nni package to pypi/testpypi'