forked from microsoft/SynapseML
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipeline.yaml
363 lines (352 loc) · 11.3 KB
/
pipeline.yaml
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
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
resources:
- repo: self
trigger:
branches:
include:
- master
paths:
exclude:
- README.md
- docs/*
- CODEOWNERS
- .github
pr:
branches:
include:
- master
paths:
exclude:
- README.md
- docs/*
- CODEOWNERS
- .github
variables:
runTests: True
jobs:
- job: Style
cancelTimeoutInMinutes: 0
condition: eq(variables.runTests, 'True')
pool:
vmImage: ubuntu-16.04
steps:
- template: templates/ivy_cache.yml
- task: AzureCLI@1
displayName: 'Style Check'
inputs:
azureSubscription: 'MMLSpark Connection'
scriptLocation: inlineScript
inlineScript: 'sbt scalastyle test:scalastyle it:scalastyle'
- job: Publish
cancelTimeoutInMinutes: 0
pool:
vmImage: ubuntu-16.04
steps:
- template: templates/ivy_cache_2.yml
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: conda info
- bash: conda env create -f environment.yaml
displayName: Create Anaconda environment
- task: AzureKeyVault@1
inputs:
azureSubscription: 'MMLSpark Connection'
keyVaultName: mmlspark-keys
- bash: |
source activate mmlspark
sbt packagePython
sbt publishBlob publishSigned publishDocs publishR
sbt genBuildInfo
echo "##vso[task.uploadsummary]$(pwd)/target/Build.md"
sbt release
displayName: Publish Artifacts
env:
STORAGE_KEY: $(storage-key)
NEXUS-UN: $(nexus-un)
NEXUS-PW: $(nexus-pw)
PGP-PRIVATE: $(pgp-private)
PGP-PUBLIC: $(pgp-public)
PGP-PW: $(pgp-pw)
- bash: sbt publishBadges
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: Publish Badges
env:
STORAGE_KEY: $(storage-key)
- job: E2E
cancelTimeoutInMinutes: 0
pool:
vmImage: ubuntu-16.04
steps:
- template: templates/ivy_cache_2.yml
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: conda info
- bash: conda env create -f environment.yaml
displayName: Create Anaconda environment
- task: AzureKeyVault@1
inputs:
azureSubscription: 'MMLSpark Connection'
keyVaultName: mmlspark-keys
- bash: |
source activate mmlspark
sbt packagePython
sbt publishBlob
displayName: Publish Blob Artifacts
env:
STORAGE_KEY: $(storage-key)
NEXUS-UN: $(nexus-un)
NEXUS-PW: $(nexus-pw)
PGP-PRIVATE: $(pgp-private)
PGP-PUBLIC: $(pgp-public)
PGP-PW: $(pgp-pw)
- task: AzureCLI@1
displayName: 'E2E'
inputs:
azureSubscription: 'MMLSpark Connection'
scriptLocation: inlineScript
inlineScript: 'sbt it:test'
condition: and(succeeded(), eq(variables.runTests, 'True'))
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**/test-reports/TEST-*.xml'
failTaskOnFailedTests: true
condition: and(eq(variables.runTests, 'True'), succeededOrFailed())
- job: PublishDocker
displayName: PublishDocker
pool:
vmImage: ubuntu-16.04
steps:
- template: templates/ivy_cache.yml
- bash: |
VERSION=$(sbt version | tail -1 | cut -d' ' -f2 | sed 's/\x1b\[[0-9;]*m//g')
echo '##vso[task.setvariable variable=version]'$VERSION
echo '##vso[task.setvariable variable=gittag]'$(git tag -l --points-at HEAD)
displayName: 'Get Docker Tag + Version'
- task: Docker@2
displayName: Demo Image Build
inputs:
containerRegistry: 'mmlsparkmcr-connection-new'
repository: 'public/mmlspark/build-demo'
command: 'build'
buildContext: "."
Dockerfile: 'tools/docker/demo/Dockerfile'
tags: $(version)
arguments: --build-arg MMLSPARK_VERSION=$(version)
- task: Docker@2
displayName: Demo Image Push
inputs:
containerRegistry: 'mmlsparkmcr-connection-new'
repository: 'public/mmlspark/build-demo'
command: 'push'
tags: $(version)
- task: Docker@2
displayName: Minimal Image Build + Push
inputs:
containerRegistry: 'mmlsparkmcr-connection-new'
repository: 'public/mmlspark/build-minimal'
command: 'build'
buildContext: "."
Dockerfile: 'tools/docker/minimal/Dockerfile'
tags: $(version)
arguments: --build-arg MMLSPARK_VERSION=$(version)
- task: Docker@2
displayName: Minimal Image Build + Push
inputs:
containerRegistry: 'mmlsparkmcr-connection-new'
repository: 'public/mmlspark/build-minimal'
command: 'push'
tags: $(version)
- task: Docker@2
condition: startsWith(variables['gittag'], 'v')
displayName: Release Image Build
inputs:
containerRegistry: 'mmlsparkmcr-connection-new'
repository: 'public/mmlspark/release'
command: 'build'
buildContext: "."
Dockerfile: 'tools/docker/demo/Dockerfile'
tags: |
$(version)
latest
arguments: --build-arg MMLSPARK_VERSION=$(version)
- task: Docker@2
condition: startsWith(variables['gittag'], 'v')
displayName: Release Image Push
inputs:
containerRegistry: 'mmlsparkmcr-connection-new'
repository: 'public/mmlspark/release'
command: 'push'
tags: |
$(version)
latest
- job: Release
cancelTimeoutInMinutes: 0
pool:
vmImage: ubuntu-16.04
steps:
- bash: |
echo '##vso[task.setvariable variable=tag]'$(git tag -l --points-at HEAD)
displayName: 'Get Git Tag'
- bash: |
wget https://github.com/git-chglog/git-chglog/releases/download/0.8.0/git-chglog_linux_amd64
chmod +x git-chglog_linux_amd64
./git-chglog_linux_amd64 -o CHANGELOG.md $TAG
condition: startsWith(variables['tag'], 'v')
- task: GitHubRelease@0
condition: startsWith(variables['tag'], 'v')
inputs:
gitHubConnection: 'MMLSPark Github via PAT'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'auto'
releaseNotesFile: 'CHANGELOG.md'
isDraft: true
- job: PythonTests
cancelTimeoutInMinutes: 0
condition: eq(variables.runTests, 'True')
pool:
vmImage: ubuntu-16.04
steps:
- template: templates/ivy_cache_2.yml
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: conda env create -f environment.yaml
displayName: Create Anaconda environment
- bash: |
source activate mmlspark
(timeout 5m sbt setup) || (echo "retrying" && timeout 5m sbt setup) || (echo "retrying" && timeout 5m sbt setup)
sbt coverage testPython
displayName: Test Python Code
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**/python-test-*.xml'
failTaskOnFailedTests: true
condition: succeededOrFailed()
- task: AzureCLI@1
displayName: 'Generate Codecov report'
inputs:
azureSubscription: 'MMLSpark Connection'
scriptLocation: inlineScript
inlineScript: 'sbt coverageReport'
condition: succeededOrFailed()
- task: AzureKeyVault@1
inputs:
azureSubscription: 'MMLSpark Connection'
keyVaultName: mmlspark-keys
condition: succeededOrFailed()
- bash: |
curl -s https://codecov.io/bash > .codecov
chmod +x .codecov
echo "Starting Codecov Upload"
./.codecov -t $(codecov-token) -f coverage.xml
./.codecov -t $(codecov-token) -f target/scala-2.11/coverage-report/cobertura.xml
displayName: Upload Coverage Report To Codecov.io
condition: succeededOrFailed()
- job: UnitTests
cancelTimeoutInMinutes: 1
timeoutInMinutes: 80
condition: eq(variables.runTests, 'True')
pool:
vmImage: ubuntu-16.04
strategy:
matrix:
automl:
PACKAGE: "automl"
cntk:
PACKAGE: "cntk"
cognitive1:
PACKAGE: "cognitive.split1"
FLAKY: "true"
cognitive2:
PACKAGE: "cognitive.split2"
FFMPEG: "true"
FLAKY: "true"
core:
PACKAGE: "core"
downloader:
PACKAGE: "downloader"
featurize:
PACKAGE: "featurize"
image:
PACKAGE: "image"
io1:
PACKAGE: "io.split1"
FLAKY: "true"
io2:
PACKAGE: "io.split2"
FLAKY: "true"
isolationforest:
PACKAGE: "isolationforest"
flaky:
PACKAGE: "flaky" #TODO fix flaky test so isolation is not needed
FLAKY: "true"
lightgbm1:
PACKAGE: "lightgbm.split1" #TODO speed up LGBM Tests and remove split
FLAKY: "true"
lightgbm2:
PACKAGE: "lightgbm.split2"
FLAKY: "true"
lime:
PACKAGE: "lime"
opencv:
PACKAGE: "opencv"
recommendation:
PACKAGE: "recommendation"
stages:
PACKAGE: "stages"
nn:
PACKAGE: "nn"
train:
PACKAGE: "train"
vw:
PACKAGE: "vw"
steps:
- template: templates/ivy_cache_2.yml
- task: AzureCLI@1
displayName: 'Setup repo'
inputs:
azureSubscription: 'MMLSpark Connection'
scriptLocation: inlineScript
inlineScript: |
(timeout 30s pip install requests) || (echo "retrying" && timeout 30s pip install requests)
(timeout 5m sbt setup) || (echo "retrying" && timeout 5m sbt setup) || (echo "retrying" && timeout 5m sbt setup)
- task: AzureCLI@1
displayName: 'Unit Test'
timeoutInMinutes: 60
inputs:
azureSubscription: 'MMLSpark Connection'
scriptLocation: inlineScript
inlineScript: |
(${FFMPEG:-false} && sudo apt-get update && sudo apt-get install ffmpeg libgstreamer1.0-0 \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly -y)
export SBT_OPTS="-Xmx2G -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=2G -Xss2M -Duser.timezone=GMT"
(timeout 20m sbt coverage "testOnly com.microsoft.ml.spark.$(PACKAGE).**") ||
(${FLAKY:-false} && timeout 20m sbt coverage "testOnly com.microsoft.ml.spark.$(PACKAGE).**") ||
(${FLAKY:-false} && timeout 20m sbt coverage "testOnly com.microsoft.ml.spark.$(PACKAGE).**")
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**/test-reports/TEST-*.xml'
failTaskOnFailedTests: true
condition: succeededOrFailed()
- task: AzureCLI@1
displayName: 'Generate Codecov report'
inputs:
azureSubscription: 'MMLSpark Connection'
scriptLocation: inlineScript
inlineScript: 'sbt coverageReport'
condition: succeededOrFailed()
- task: AzureKeyVault@1
inputs:
azureSubscription: 'MMLSpark Connection'
keyVaultName: mmlspark-keys
condition: succeededOrFailed()
- bash: |
curl -s https://codecov.io/bash > .codecov
chmod +x .codecov
echo "Starting Codecov Upload"
./.codecov -t $(codecov-token)
displayName: Upload Coverage Report To Codecov.io
condition: succeededOrFailed()