Skip to content

Commit da8e6df

Browse files
authored
Taskgraph (#534)
* add py310 to tox * migrate to taskgraph * no need to specify 3.9.7 * fix tox kind * let's not hammer github api
1 parent fea5bea commit da8e6df

File tree

16 files changed

+652
-81
lines changed

16 files changed

+652
-81
lines changed

.taskcluster.yml

Lines changed: 245 additions & 78 deletions
Large diffs are not rendered by default.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ recursive-exclude * __pycache__
2424
recursive-exclude * *.py[co]
2525
recursive-exclude docs *
2626
recursive-exclude tests *
27+
recursive-exclude taskcluster *

src/scriptworker/task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
from copy import deepcopy
1717

1818
import aiohttp
19-
import taskcluster
2019
import taskcluster.exceptions
2120
from taskcluster.exceptions import TaskclusterFailure
2221

22+
import taskcluster
2323
from scriptworker.constants import get_reversed_statuses
2424
from scriptworker.exceptions import ScriptWorkerTaskException, WorkerShutdownDuringTask
2525
from scriptworker.github import (

taskcluster/ci/config.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
trust-domain: scriptworker
3+
4+
task-priority: high
5+
6+
taskgraph:
7+
register: scriptworker_taskgraph:register
8+
repositories:
9+
scriptworker:
10+
name: "Scriptworker"
11+
project-regex: scriptworker$
12+
default-repository: https://github.com/mozilla-releng/scriptworker
13+
default-ref: master
14+
type: git
15+
16+
workers:
17+
aliases:
18+
b-linux:
19+
provisioner: scriptworker-{level}
20+
implementation: docker-worker
21+
os: linux
22+
worker-type: 'b-linux'
23+
images:
24+
provisioner: scriptworker-{level}
25+
implementation: docker-worker
26+
os: linux
27+
worker-type: 'images'
28+
29+
notify:
30+
email:
31+
32+
prefix: "[scriptworker]"
33+
34+
private-artifact-prefix: releng/scriptworker
35+
36+
scriptworker:
37+
scope-prefix: project:scriptworker:releng
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
---
5+
6+
loader: taskgraph.loader.transform:loader
7+
8+
transforms:
9+
- taskgraph.transforms.docker_image:transforms
10+
- taskgraph.transforms.cached_tasks:transforms
11+
- taskgraph.transforms.task:transforms
12+
13+
jobs:
14+
python3.10:
15+
definition: python
16+
args:
17+
PYTHON_VERSION: "3.10"
18+
python3.9:
19+
definition: python
20+
args:
21+
PYTHON_VERSION: "3.9"
22+
python3.8:
23+
definition: python
24+
args:
25+
PYTHON_VERSION: "3.8"
26+
python3.7:
27+
definition: python
28+
args:
29+
PYTHON_VERSION: "3.7"

taskcluster/ci/pr/kind.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
---
5+
loader: taskgraph.loader.transform:loader
6+
7+
kind-dependencies:
8+
- tox
9+
10+
transforms:
11+
- taskgraph.transforms.code_review:transforms
12+
- taskgraph.transforms.task:transforms
13+
14+
jobs:
15+
complete:
16+
description: PR Summary Task
17+
run-on-tasks-for: [github-pull-request]
18+
worker-type: succeed

taskcluster/ci/tox/kind.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
---
5+
loader: taskgraph.loader.transform:loader
6+
7+
kind-dependencies:
8+
- docker-image
9+
10+
transforms:
11+
- scriptworker_taskgraph.transforms.tox:transforms
12+
- taskgraph.transforms.job:transforms
13+
- taskgraph.transforms.task:transforms
14+
15+
job-defaults:
16+
description: "{name} tox-{targets}"
17+
run-on-tasks-for: ["action", "github-pull-request", "github-push"]
18+
attributes:
19+
code-review: true
20+
worker-type: b-linux
21+
worker:
22+
docker-image: {in-tree: 'python{python-version}'}
23+
max-run-time: 1800
24+
run:
25+
using: run-task
26+
cache-dotcache: false
27+
checkout:
28+
scriptworker: {}
29+
# sparse-profile: str/none
30+
# workdir:
31+
cwd: '{checkout}'
32+
command:
33+
- sh
34+
- -lxce
35+
- >-
36+
tox -e {targets}
37+
38+
jobs:
39+
py37:
40+
python-version: "3.7"
41+
targets: py37,check
42+
env:
43+
NO_TESTS_OVER_WIRE: "1"
44+
py38:
45+
python-version: "3.8"
46+
targets: py38,check
47+
env:
48+
NO_TESTS_OVER_WIRE: "1"
49+
py39:
50+
python-version: "3.9"
51+
targets: py39,check
52+
env:
53+
NO_TESTS_OVER_WIRE: "1"
54+
py310:
55+
python-version: "3.10"
56+
targets: py310,check
57+
env:
58+
NO_TESTS_OVER_WIRE: "1"
59+
py38-cot:
60+
python-version: "3.8"
61+
targets: py38-cot
62+
env:
63+
NO_CREDENTIALS_TESTS: "1"
64+
scopes:
65+
- secrets:get:repo:github.com/mozilla-releng/scriptworker:github
66+
py39-cot:
67+
python-version: "3.9"
68+
targets: py39-cot
69+
env:
70+
NO_CREDENTIALS_TESTS: "1"
71+
scopes:
72+
- secrets:get:repo:github.com/mozilla-releng/scriptworker:github

taskcluster/docker/REGISTRY

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mozilla-releng
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
5+
ARG PYTHON_VERSION
6+
FROM python:$PYTHON_VERSION
7+
8+
# Add worker user
9+
RUN mkdir /builds && \
10+
groupadd -g 1000 -o worker && \
11+
useradd -d /builds/worker -s /bin/bash -m worker -g 1000 -o -u 1000 && \
12+
mkdir /builds/worker/artifacts && \
13+
chown worker:worker /builds/worker/artifacts
14+
15+
RUN pip install tox
16+
17+
# %include-run-task
18+
19+
ENV SHELL=/bin/bash \
20+
HOME=/builds/worker \
21+
PATH=/builds/worker/.local/bin:$PATH
22+
23+
VOLUME /builds/worker/checkouts
24+
VOLUME /builds/worker/.cache
25+
26+
# Set a default command useful for debugging
27+
CMD ["/bin/bash", "--login"]

taskcluster/requirements.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# For instructions on managing dependencies, see:
2+
# https://taskcluster-taskgraph.readthedocs.io/en/latest/howto/bootstrap-taskgraph.html
3+
4+
taskcluster-taskgraph

0 commit comments

Comments
 (0)