Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared tc dir #5

Merged
merged 31 commits into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
939744e
update .taskcluster.yml for shared
escapewindow Apr 15, 2020
14e14c0
nuke taskcluster/
escapewindow Apr 15, 2020
7794c5a
move GITHUB_CLONE_SECRET to .taskcluster.yml
escapewindow Apr 15, 2020
5413569
add new template parameters
escapewindow Apr 15, 2020
2ceb953
fix
escapewindow Apr 15, 2020
faa2c7e
to_unicode
escapewindow Apr 15, 2020
68feeb3
try backing out the new params
escapewindow Apr 15, 2020
ac74b17
try text_type(...)
escapewindow Apr 15, 2020
d69630a
project-regex
escapewindow Apr 15, 2020
c19cefb
ugh
escapewindow Apr 15, 2020
cd6002c
get env from decision task
escapewindow Apr 15, 2020
82ab504
point at real repo master (commented atm)
escapewindow Apr 15, 2020
f7b3f3a
fix githubCloneSecret
escapewindow Apr 15, 2020
6e3938c
use project-regex for xpi
escapewindow Apr 17, 2020
800d4fc
add checkout: to build and test
escapewindow Apr 17, 2020
b8b9686
default-repository for xpi-template
escapewindow Apr 17, 2020
ca54111
xpi {}
escapewindow Apr 17, 2020
2068ecb
get rid of special template parameter handling
escapewindow Apr 17, 2020
9a2e2ec
fix
escapewindow Apr 17, 2020
0e5a9d7
use --root instead of rm/ln taskcluster
escapewindow Apr 17, 2020
08431f1
back out to ca54111
escapewindow Apr 22, 2020
68d1fb9
re-add parameters.py
escapewindow Apr 22, 2020
7bd92b9
revert back to 0e5a9d7
escapewindow Apr 23, 2020
41b3133
add docker-image kind
escapewindow Apr 27, 2020
b744e36
add docker dir
escapewindow Apr 27, 2020
d196347
use johan's taskgraph-try 12d2c3fb3c584209b9caef89691e81dbffb8129e
escapewindow Apr 27, 2020
94903b9
0dbd05252def2df5c6b5e3322d196499c61ada5a
escapewindow Apr 27, 2020
c511f4e
back out to 9a2e2ec, fix one thing at a time
escapewindow Apr 27, 2020
202ec73
bump to taskgraph c78d65237c6ed064b9cbb3cd063b22e9e052a06a
escapewindow Apr 27, 2020
85da87f
back to b34543ca2f42771117fa9da33c31994913587636
escapewindow Apr 27, 2020
dbe107d
c78d65237c6ed064b9cbb3cd063b22e9e052a06a again
escapewindow Apr 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@ tasks:
- $let:
taskgraph:
branch: taskgraph
revision: 2b32db7d303dd175ed4c4abf5fcfe00c6c593acd
revision: c78d65237c6ed064b9cbb3cd063b22e9e052a06a
template:
# XXX uncomment to merge
# repo: https://github.com/mozilla-releng/xpi-template
# branch: master
repo: https://github.com/escapewindow/xpi-template
branch: shared-tc-dir
trustDomain: xpi
# XXX for private repos, uncomment this line, and comment out the next
# githubCloneSecret: project/xpi/xpi-github-clone-ssh
githubCloneSecret: ""
in:
$if: 'tasks_for in ["github-pull-request", "github-push", "action", "cron"]'
then:
Expand Down Expand Up @@ -173,12 +182,18 @@ tasks:
XPI_HEAD_REF: '${head_branch}'
XPI_HEAD_REV: '${head_sha}'
XPI_REPOSITORY_TYPE: git
TEMPLATE_BASE_REPOSITORY: '${template.repo}'
TEMPLATE_HEAD_REPOSITORY: '${template.repo}'
TEMPLATE_HEAD_REV: '${template.branch}'
TEMPLATE_HEAD_REF: '${template.branch}'
TEMPLATE_REPOSITORY_TYPE: git
TASKGRAPH_BASE_REPOSITORY: https://hg.mozilla.org/ci/taskgraph
TASKGRAPH_HEAD_REPOSITORY: https://hg.mozilla.org/ci/${taskgraph.branch}
TASKGRAPH_HEAD_REV: '${taskgraph.revision}'
TASKGRAPH_REPOSITORY_TYPE: hg
REPOSITORIES: {$json: {xpi: "XPI Manifest", taskgraph: "Taskgraph"}}
REPOSITORIES: {$json: {xpi: "XPI Manifest", taskgraph: "Taskgraph", template: "XPI Template"}}
HG_STORE_PATH: /builds/worker/checkouts/hg-store
GITHUB_CLONE_SECRET: '${githubCloneSecret}'
- $if: 'tasks_for in ["github-pull-request"]'
then:
XPI_PULL_REQUEST_NUMBER: '${event.pull_request.number}'
Expand All @@ -201,6 +216,7 @@ tasks:
command:
- /usr/local/bin/run-task
- '--xpi-checkout=/builds/worker/checkouts/src'
- '--template-checkout=/builds/worker/checkouts/template'
- '--taskgraph-checkout=/builds/worker/checkouts/taskgraph'
- '--task-cwd=/builds/worker/checkouts/src'
- '--'
Expand All @@ -213,10 +229,14 @@ tasks:
then: >
PIP_IGNORE_INSTALLED=0 pip install --user /builds/worker/checkouts/taskgraph &&
cd /builds/worker/checkouts/src &&
rm -rf taskcluster &&
ln -s /builds/worker/checkouts/template/taskcluster taskcluster &&

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not need to do this dance moving around the taskcluster directory. You can pass --root path/to/taskcluster/ci to taskgraph decision to read from a different location (this is how comm-central handles things).

Alternatively, you could run taskgraph from the template repository, with the xpi repository in a known place. (This is closer to what ci-admin/ci-config does, but ci-config isn't even checked out).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this breaks any automation on xpi-template itself, but perhaps we want to turn that off anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it breaks for test-xpi-public as well. I'm guessing --root also keeps us from looking in test-xpi-public for the xpi source, and instead looks in xpi-template ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, you could run taskgraph from the template repository, with the xpi repository in a known place. (This is closer to what ci-admin/ci-config does, but ci-config isn't even checked out).

I think I was avoiding this, because a) we need to translate paths, and b) xpi-template is level 3; the xpi source repo will be level 1. We could make xpi-template level 1. Is going back to the taskcluster/ dance a blocker?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

busted test-xpi-public: mozilla-releng/staging-xpi-public#6

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#7

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--root seems to break everything. I'm going to punt on that.

ln -s /builds/worker/artifacts artifacts &&
~/.local/bin/taskgraph action-callback
else: >
PIP_IGNORE_INSTALLED=0 pip install --user /builds/worker/checkouts/taskgraph &&
rm -rf taskcluster &&
ln -s /builds/worker/checkouts/template/taskcluster taskcluster &&
ln -s /builds/worker/artifacts artifacts &&
~/.local/bin/taskgraph decision
--pushlog-id='0'
Expand Down
2 changes: 2 additions & 0 deletions taskcluster/ci/build/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ job-defaults:
docker-image:
indexed: xpi.cache.level-3.docker-images.v2.node-latest.latest
run:
checkout:
xpi: {}
use-caches: false

jobs:
Expand Down
13 changes: 10 additions & 3 deletions taskcluster/ci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ taskgraph:
repositories:
xpi:
name: "XPI source"
escapewindow marked this conversation as resolved.
Show resolved Hide resolved
project-regex: '(?!xpi-template)'
template:
name: "XPI template"
project-regex: 'xpi-template'
# XXX
#default-repository: https://github.com/mozilla-extensions/xpi-template
#default-ref: master
default-repository: https://github.com/escapewindow/xpi-template
default-ref: shared-tc-dir
type: git

workers:
aliases:
Expand All @@ -16,6 +26,3 @@ workers:
implementation: docker-worker
os: linux
worker-type: 'b-linux'

# Uncomment if this is a private repo
# github_clone_secret: project/xpi/xpi-github-clone-ssh
2 changes: 2 additions & 0 deletions taskcluster/ci/test/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ job-defaults:
docker-image:
indexed: xpi.cache.level-3.docker-images.v2.node-latest.latest
run:
checkout:
xpi: {}
use-caches: false

jobs:
Expand Down
12 changes: 11 additions & 1 deletion taskcluster/xpi_taskgraph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@ def register(graph_config):
Import all modules that are siblings of this one, triggering decorators in
the process.
"""
pass
_import_modules([
"build",
"cached",
"test",
"xpi_manifest",
])


def _import_modules(modules):
for module in modules:
import_module(".{}".format(module), package=__name__)
8 changes: 3 additions & 5 deletions taskcluster/xpi_taskgraph/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ def tasks_from_manifest(config, jobs):
task["label"] = "build-{}".format(xpi_config["name"])
env["XPI_NAME"] = xpi_config["name"]
task.setdefault("extra", {})["xpi-name"] = xpi_config["name"]
try:
checkout_config["ssh_secret_name"] = config.graph_config[
"github_clone_secret"
]
if env.get("GITHUB_CLONE_SECRET", ""):
checkout_config["ssh_secret_name"] = env["GITHUB_CLONE_SECRET"]
artifact_prefix = "xpi/build"
except KeyError:
else:
artifact_prefix = "public/build"
env["ARTIFACT_PREFIX"] = artifact_prefix
artifacts = task["worker"].setdefault("artifacts", [])
Expand Down
8 changes: 3 additions & 5 deletions taskcluster/xpi_taskgraph/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ def test_tasks_from_manifest(config, jobs):
run["cwd"] = "{checkout}"
run["command"] = run["command"].format(target=target)
task["label"] = "t-{}-{}".format(target, xpi_name)
try:
checkout_config["ssh_secret_name"] = config.graph_config[
"github_clone_secret"
]
if env.get("GITHUB_CLONE_SECRET", ""):
checkout_config["ssh_secret_name"] = env["GITHUB_CLONE_SECRET"]
artifact_prefix = "xpi/build"
except KeyError:
else:
artifact_prefix = "public/build"
env["ARTIFACT_PREFIX"] = artifact_prefix
yield task