Skip to content

Commit

Permalink
fix(python): scope checkout caches to the specific project
Browse files Browse the repository at this point in the history
Since the template uses the `mozilla` trust domain, it's expected for
workers to run tasks for multiple unrelated projects. Therefore we don't
want to share a checkout cache between them (and especially not call
them all `src`).

This scopes the checkout cache to just the specific project as well as
renames it from `src` -> `${project}`.
  • Loading branch information
ahal committed Oct 25, 2023
1 parent f4d3237 commit 9605ff0
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ tasks:
ACTION_CALLBACK: '${action.cb_name}'

cache:
"${trustDomain}-level-${level}-checkouts-sparse-v2": /builds/worker/checkouts
"${trustDomain}-${project}-level-${level}-checkouts-sparse-v2": /builds/worker/checkouts/${project}

features:
taskclusterProxy: true
Expand All @@ -228,7 +228,7 @@ tasks:

command:
- run-task
- '--${normProject}-checkout=/builds/worker/checkouts/src'
- '--${normProject}-checkout=/builds/worker/checkouts/${project}'
- '--'
- bash
- -cx
Expand All @@ -237,12 +237,12 @@ tasks:
in:
$if: 'tasks_for == "action"'
then: >
cd /builds/worker/checkouts/src &&
cd /builds/worker/checkouts/${project} &&
ln -s /builds/worker/artifacts artifacts &&
pip3 install -r requirements/base.txt &&
~/.local/bin/taskgraph action-callback
else: >
cd /builds/worker/checkouts/src &&
cd /builds/worker/checkouts/${project} &&
ln -s /builds/worker/artifacts artifacts &&
~/.local/bin/taskgraph decision
--pushlog-id='0'
Expand All @@ -267,7 +267,7 @@ tasks:
expires: {$fromNow: '1 year'}
'public/docker-contexts':
type: 'directory'
path: '/builds/worker/checkouts/src/docker-contexts'
path: '/builds/worker/checkouts/${project}/docker-contexts'
# This needs to be at least the deadline of the
# decision task + the docker-image task deadlines.
# It is set to a week to allow for some time for
Expand Down

0 comments on commit 9605ff0

Please sign in to comment.