forked from mozilla/bugbug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.taskcluster.yml
445 lines (429 loc) · 17.8 KB
/
.taskcluster.yml
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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
version: 1
policy:
pullRequests: public
tasks:
$let:
user: ${event.sender.login}
head_branch:
$if: 'tasks_for == "github-pull-request"'
then: ${event.pull_request.head.ref}
else:
$if: 'tasks_for == "github-push"'
then: ${event.ref}
else: ${event.release.target_commitish}
head_rev:
$if: 'tasks_for == "github-pull-request"'
then: ${event.pull_request.head.sha}
else:
$if: 'tasks_for == "github-push"'
then: ${event.after}
else: ${event.release.tag_name}
repository:
$if: 'tasks_for == "github-pull-request"'
then: ${event.pull_request.head.repo.html_url}
else: ${event.repository.html_url}
taskboot_image: "mozilla/taskboot:0.1.10"
in:
$if: 'tasks_for in ["github-pull-request", "github-push"]'
then:
- taskId: {$eval: as_slugid("lint_task")}
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
provisionerId: aws-provisioner-v1
workerType: github-worker
payload:
maxRunTime: 3600
image: python:3.7
command:
- "/bin/bash"
- "-lcx"
- "git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
pip install --disable-pip-version-check --quiet --no-cache-dir -r test-requirements.txt &&
pre-commit run -a"
metadata:
name: bugbug lint
description: bugbug lint
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push"'
then:
taskId: {$eval: as_slugid("version_check_task")}
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
provisionerId: aws-provisioner-v1
workerType: github-worker
payload:
maxRunTime: 3600
image: python:3.7
command:
- "/bin/bash"
- "-lcx"
- "git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
python infra/version_check.py"
metadata:
name: bugbug tag version check
description: bugbug tag version check
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- taskId: {$eval: as_slugid("tests_task")}
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
provisionerId: aws-provisioner-v1
workerType: github-worker
payload:
maxRunTime: 3600
image: python:3.7
env:
CODECOV_TOKEN: 66162f89-a4d9-420c-84bd-d10f12a428d9
command:
- "/bin/bash"
- "-lcx"
- "apt-get -qq update &&
apt-get -qq install -y python-pip libhdf5-dev &&
python2 -m pip install --disable-pip-version-check --quiet --no-cache-dir mercurial==5.1 &&
git clone --quiet https://github.com/mozilla/version-control-tools.git &&
git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
cp infra/hgrc /root/.hgrc &&
pip install --disable-pip-version-check --quiet --no-cache-dir -r requirements.txt &&
pip install --disable-pip-version-check --quiet --no-cache-dir -r extra-nlp-requirements.txt &&
pip install --disable-pip-version-check --quiet --no-cache-dir -r extra-nn-requirements.txt &&
pip install --disable-pip-version-check --quiet --no-cache-dir -r infra/spawn_pipeline_requirements.txt &&
pip install --disable-pip-version-check --quiet --no-cache-dir -r test-requirements.txt &&
python -m pytest --cov=./ tests/test_*.py &&
bash <(curl -s https://codecov.io/bash)"
metadata:
name: bugbug tests
description: bugbug tests
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- taskId: {$eval: as_slugid("http_tests_task")}
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
provisionerId: aws-provisioner-v1
workerType: github-worker
payload:
maxRunTime: 3600
image: python:3.7
env:
CODECOV_TOKEN: 66162f89-a4d9-420c-84bd-d10f12a428d9
command:
- "/bin/bash"
- "-lcx"
- "apt-get -qq update &&
apt-get -qq install -y python-pip &&
git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
pip install --disable-pip-version-check --quiet --no-cache-dir . &&
pip install --disable-pip-version-check --quiet --no-cache-dir -r test-requirements.txt &&
pip install --disable-pip-version-check --quiet --no-cache-dir -r http_service/requirements.txt &&
pytest --cov=http_service http_service/tests/ -vvv &&
bash <(curl -s https://codecov.io/bash)"
metadata:
name: bugbug http service tests
description: bugbug http service tests
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- taskId: {$eval: as_slugid("packaging_test_task")}
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
provisionerId: aws-provisioner-v1
workerType: github-worker
payload:
maxRunTime: 3600
image: python:3.7
env:
CODECOV_TOKEN: 66162f89-a4d9-420c-84bd-d10f12a428d9
command:
- "/bin/bash"
- "-lcx"
- "apt-get -qq update &&
apt-get -qq install -y libhdf5-dev &&
git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
pip install --disable-pip-version-check --quiet --no-cache-dir -r test-requirements.txt &&
python -m coverage run setup.py sdist &&
pip install --disable-pip-version-check --quiet --no-cache-dir dist/bugbug-$(cat VERSION).tar.gz &&
pip install --disable-pip-version-check --quiet --no-cache-dir dist/bugbug-$(cat VERSION).tar.gz[nlp] &&
pip install --disable-pip-version-check --quiet --no-cache-dir dist/bugbug-$(cat VERSION).tar.gz[nn] &&
bash <(curl -s https://codecov.io/bash)"
metadata:
name: bugbug packaging test
description: bugbug packaging test
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- taskId: {$eval: as_slugid("docker_build")}
created: {$fromNow: ''}
deadline: {$fromNow: '3 hours'}
provisionerId: aws-provisioner-v1
workerType: relman-svc
payload:
capabilities:
privileged: true
maxRunTime: 10800
image: "${taskboot_image}"
env:
REGISTRY: registry.hub.docker.com
VERSION:
$if: 'head_branch[:10] == "refs/tags/"'
then: {$eval: 'head_branch[10:]' }
else: "latest"
command:
- "/bin/sh"
- "-lcxe"
- "git clone --quiet ${repository} /code &&
cd /code &&
git -c advice.detachedHead=false checkout ${head_rev} &&
taskboot --cache /cache --target /code build-compose --write /images --build-arg CHECK_MODELS=0 --tag $VERSION --tag latest"
artifacts:
public/bugbug:
expires: {$fromNow: '2 weeks'}
path: /images
type: directory
cache:
bugbug-build: /cache
scopes:
- docker-worker:capability:privileged
- docker-worker:cache:bugbug-build
metadata:
name: bugbug docker build
description: bugbug docker build
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
dependencies:
- {$eval: as_slugid("lint_task")}
- {$eval: as_slugid("tests_task")}
- {$eval: as_slugid("http_tests_task")}
- {$eval: as_slugid("packaging_test_task")}
- {$eval: as_slugid("version_check_task")}
# - {$eval: as_slugid("integration_test")}
scopes:
- secrets:get:project/relman/bugbug/deploy
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
provisionerId: aws-provisioner-v1
workerType: github-worker
payload:
features:
taskclusterProxy:
true
maxRunTime: 3600
image: "${taskboot_image}"
command:
- taskboot
- deploy-pypi
env:
TASKCLUSTER_SECRET: project/relman/bugbug/deploy
GIT_REPOSITORY: "${repository}"
GIT_REVISION: "${head_rev}"
metadata:
name: bugbug PyPI release
description: bugbug PyPI release
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
dependencies:
- {$eval: as_slugid("docker_build")}
- {$eval: as_slugid("lint_task")}
- {$eval: as_slugid("version_check_task")}
- {$eval: as_slugid("tests_task")}
- {$eval: as_slugid("packaging_test_task")}
# - {$eval: as_slugid("integration_test")}
scopes:
- secrets:get:project/relman/bugbug/deploy
taskId: {$eval: as_slugid("docker_push")}
created: {$fromNow: ''}
deadline: {$fromNow: '4 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
payload:
features:
taskclusterProxy:
true
maxRunTime: 3600
image: "${taskboot_image}"
env:
TASKCLUSTER_SECRET: project/relman/bugbug/deploy
command:
- taskboot
- push-artifact
- --exclude-filter
- "*http-service*"
metadata:
name: bugbug docker push
description: bugbug docker push
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
taskId: {$eval: as_slugid("update_hook_annotate_pipeline")}
dependencies:
- {$eval: as_slugid("docker_push")}
scopes:
- hooks:modify-hook:project-relman/bugbug-annotate
- assume:hook-id:project-relman/bugbug-annotate
created: {$fromNow: ''}
deadline: {$fromNow: '5 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
payload:
features:
taskclusterProxy:
true
maxRunTime: 3600
image: "${taskboot_image}"
env:
VERSION: {$eval: 'head_branch[10:]'}
command:
- "/bin/sh"
- "-lcxe"
- "git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
python infra/set_hook_version.py $VERSION infra/taskcluster-hook-annotate.json &&
taskboot --target . build-hook infra/taskcluster-hook-annotate.json project-relman bugbug-annotate"
metadata:
name: bugbug update annotate hook
description: bugbug update annotate hook
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
taskId: {$eval: as_slugid("update_hook_data_pipeline")}
dependencies:
- {$eval: as_slugid("docker_push")}
scopes:
- hooks:modify-hook:project-relman/bugbug
- assume:hook-id:project-relman/bugbug
- queue:route:project.relman.bugbug.deploy_ending.*
created: {$fromNow: ''}
deadline: {$fromNow: '5 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
payload:
features:
taskclusterProxy:
true
maxRunTime: 3600
image: "${taskboot_image}"
command:
- "/bin/sh"
- "-lcxe"
- "git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
python infra/set_hook_version.py ${head_branch[10:]} infra/taskcluster-hook-pipeline-start.json &&
taskboot --target . build-hook infra/taskcluster-hook-pipeline-start.json project-relman bugbug"
routes:
- project.relman.bugbug.deploy_ending
metadata:
name: bugbug update data hook
description: bugbug update data hook
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
taskId: {$eval: as_slugid("update_hook_check_pipeline")}
dependencies:
- {$eval: as_slugid("docker_push")}
scopes:
- hooks:modify-hook:project-relman/bugbug-checks
- assume:hook-id:project-relman/bugbug-checks
created: {$fromNow: ''}
deadline: {$fromNow: '5 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
payload:
features:
taskclusterProxy:
true
maxRunTime: 3600
image: "${taskboot_image}"
command:
- "/bin/sh"
- "-lcxe"
- "git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
python infra/set_hook_version.py ${head_branch[10:]} infra/taskcluster-hook-check-models-start.json &&
taskboot --target . build-hook infra/taskcluster-hook-check-models-start.json project-relman bugbug-checks"
metadata:
name: bugbug update check hook
description: bugbug update check hook
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
taskId: {$eval: as_slugid("update_hook_classify_patch")}
dependencies:
- {$eval: as_slugid("docker_push")}
scopes:
- hooks:modify-hook:project-relman/bugbug-classify-patch
- assume:hook-id:project-relman/bugbug-classify-patch
created: {$fromNow: ''}
deadline: {$fromNow: '5 hours'}
provisionerId: aws-provisioner-v1
workerType: github-worker
payload:
features:
taskclusterProxy:
true
maxRunTime: 3600
image: "${taskboot_image}"
command:
- "/bin/sh"
- "-lcxe"
- "git clone --quiet ${repository} &&
cd bugbug &&
git -c advice.detachedHead=false checkout ${head_rev} &&
python infra/set_hook_version.py ${head_branch[10:]} infra/taskcluster-hook-classify-patch.json &&
taskboot --target . build-hook infra/taskcluster-hook-classify-patch.json project-relman bugbug-classify-patch"
metadata:
name: bugbug update classify patch hook
description: bugbug update classify patch hook
owner: [email protected]
source: ${repository}/raw/${head_rev}/.taskcluster.yml
# - $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
# then:
# taskId: {$eval: as_slugid("integration_test")}
# created: {$fromNow: ''}
# deadline: {$fromNow: '1 hour'}
# provisionerId: aws-provisioner-v1
# workerType: relman-svc
# scopes:
# - secrets:get:project/relman/bugbug/integration
# payload:
# features:
# taskclusterProxy:
# true
# maxRunTime: 10800
# image: mozilla/bugbug-commit-retrieval:latest
# env:
# TC_SECRET_ID: project/relman/bugbug/integration
# command:
# - "/bin/bash"
# - "-lcx"
# - "git clone --quiet ${repository} &&
# cd bugbug &&
# git -c advice.detachedHead=false checkout ${head_rev} &&
# pip install --disable-pip-version-check --quiet --no-cache-dir . &&
# pip install --disable-pip-version-check --quiet --no-cache-dir -r test-requirements.txt &&
# apt-get update &&
# apt-get install -y redis-server &&
# python -c 'import os; print(os.environ.keys())' &&
# bash ./scripts/integration_test.sh"
# metadata:
# name: bugbug integration test
# description: bugbug integration test
# owner: ${user}@users.noreply.github.com
# source: ${repository}/raw/${head_rev}/.taskcluster.yml