forked from microsoft/SynapseML
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline.yaml
307 lines (297 loc) · 9.77 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
resources:
- repo: self
trigger:
branches:
include:
- master
paths:
exclude:
- README.md
- docs/*
- CODEOWNERS
pr:
branches:
include:
- master
paths:
exclude:
- README.md
- docs/*
- CODEOWNERS
variables:
runTests: True
jobs:
- job: Style
cancelTimeoutInMinutes: 0
condition: eq(variables.runTests, 'True')
pool:
vmImage: ubuntu-16.04
steps:
- task: AzureCLI@1
displayName: 'Style Check'
inputs:
azureSubscription: 'Findable Incubation(ca9d21ff-2a46-4e8b-bf06-8d65242342e5)'
scriptLocation: inlineScript
inlineScript: 'sbt scalastyle test:scalastyle it:scalastyle'
- job: PublishAndE2E
cancelTimeoutInMinutes: 0
pool:
vmImage: ubuntu-16.04
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: conda env create -f environment.yaml
displayName: Create Anaconda environment
- task: AzureKeyVault@1
inputs:
azureSubscription: 'Findable Incubation(ca9d21ff-2a46-4e8b-bf06-8d65242342e5)'
keyVaultName: mmlspark-keys
- bash: |
source activate mmlspark
sbt packagePython
sbt publishBlob publishDocs publishR
sbt genBuildInfo
echo "##vso[task.uploadsummary]$(pwd)/target/Build.md"
displayName: Publish Artifacts
env:
STORAGE_KEY: $(storage-key)
- bash: sbt publishBadges
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: Publish Badges
env:
STORAGE_KEY: $(storage-key)
- task: AzureCLI@1
displayName: 'E2E'
inputs:
azureSubscription: 'Findable Incubation(ca9d21ff-2a46-4e8b-bf06-8d65242342e5)'
scriptLocation: inlineScript
inlineScript: 'sbt it:test'
condition: 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:
- 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=tag]'$(echo $VERSION | tr '+' '-')
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'
repository: 'public/mmlspark/build-demo'
command: 'build'
buildContext: "."
Dockerfile: 'tools/docker/demo/Dockerfile'
tags: $(tag)
arguments: --build-arg MMLSPARK_VERSION=$(version)
- task: Docker@2
displayName: Demo Image Push
inputs:
containerRegistry: 'mmlsparkmcr-connection'
repository: 'public/mmlspark/build-demo'
command: 'push'
tags: $(tag)
- task: Docker@2
displayName: Minimal Image Build + Push
inputs:
containerRegistry: 'mmlsparkmcr-connection'
repository: 'public/mmlspark/build-minimal'
command: 'build'
buildContext: "."
Dockerfile: 'tools/docker/minimal/Dockerfile'
tags: $(tag)
arguments: --build-arg MMLSPARK_VERSION=$(version)
- task: Docker@2
displayName: Minimal Image Build + Push
inputs:
containerRegistry: 'mmlsparkmcr-connection'
repository: 'public/mmlspark/build-minimal'
command: 'push'
tags: $(tag)
- task: Docker@2
condition: startsWith(variables['gittag'], 'v')
displayName: Release Image Build
inputs:
containerRegistry: 'mmlsparkmcr-connection'
repository: 'public/mmlspark/release'
command: 'build'
buildContext: "."
Dockerfile: 'tools/docker/demo/Dockerfile'
tags: |
$(tag)
latest
arguments: --build-arg MMLSPARK_VERSION=$(version)
- task: Docker@2
condition: startsWith(variables['gittag'], 'v')
displayName: Release Image Push
inputs:
containerRegistry: 'mmlsparkmcr-connection'
repository: 'public/mmlspark/release'
command: 'push'
tags: |
$(tag)
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:
- 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: 'Findable Incubation(ca9d21ff-2a46-4e8b-bf06-8d65242342e5)'
scriptLocation: inlineScript
inlineScript: 'sbt coverageReport'
condition: succeededOrFailed()
- task: AzureKeyVault@1
inputs:
azureSubscription: 'Findable Incubation(ca9d21ff-2a46-4e8b-bf06-8d65242342e5)'
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 -F python
./.codecov -t $(codecov-token) -f target/scala-2.11/coverage-report/cobertura.xml -F scala
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"
cognitive:
PACKAGE: "cognitive"
core:
PACKAGE: "core"
downloader:
PACKAGE: "downloader"
featurize:
PACKAGE: "featurize"
image:
PACKAGE: "image"
io:
PACKAGE: "io"
FLAKY: "true"
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"
train:
PACKAGE: "train"
vw:
PACKAGE: "vw"
steps:
- task: AzureCLI@1
displayName: 'Setup repo'
inputs:
azureSubscription: 'Findable Incubation(ca9d21ff-2a46-4e8b-bf06-8d65242342e5)'
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: 'Findable Incubation(ca9d21ff-2a46-4e8b-bf06-8d65242342e5)'
scriptLocation: inlineScript
inlineScript: |
(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: 'Findable Incubation(ca9d21ff-2a46-4e8b-bf06-8d65242342e5)'
scriptLocation: inlineScript
inlineScript: 'sbt coverageReport'
condition: succeededOrFailed()
- task: AzureKeyVault@1
inputs:
azureSubscription: 'Findable Incubation(ca9d21ff-2a46-4e8b-bf06-8d65242342e5)'
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 scala
displayName: Upload Coverage Report To Codecov.io
condition: succeededOrFailed()