From 0c9aa8fea1ec632727f8fb42a01866bc1e1f7740 Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Wed, 25 Oct 2023 11:27:32 -0400 Subject: [PATCH] fix(python): scope checkout caches to the specific project 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}`. --- .../{{cookiecutter.__project_slug}}/.taskcluster.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reps/templates/python/{{cookiecutter.__project_slug}}/.taskcluster.yml b/reps/templates/python/{{cookiecutter.__project_slug}}/.taskcluster.yml index 910531b..49fbf89 100644 --- a/reps/templates/python/{{cookiecutter.__project_slug}}/.taskcluster.yml +++ b/reps/templates/python/{{cookiecutter.__project_slug}}/.taskcluster.yml @@ -218,7 +218,7 @@ tasks: ACTION_CALLBACK: '${action.cb_name}' cache: - "${trustDomain}-level-${level}-checkouts-sparse-v2": /builds/worker/checkouts + "${trustDomain}-project-${project}-level-${level}-checkouts-sparse-v2": /builds/worker/checkouts/${project} features: taskclusterProxy: true @@ -228,7 +228,7 @@ tasks: command: - run-task - - '--${normProject}-checkout=/builds/worker/checkouts/src' + - '--${normProject}-checkout=/builds/worker/checkouts/${project}/src' - '--' - bash - -cx @@ -237,12 +237,12 @@ tasks: in: $if: 'tasks_for == "action"' then: > - cd /builds/worker/checkouts/src && + cd /builds/worker/checkouts/${project}/src && 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}/src && ln -s /builds/worker/artifacts artifacts && ~/.local/bin/taskgraph decision --pushlog-id='0' @@ -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}/src/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