From f114aa8c35ff7f16186aa5dfa981c470eb4aaafb Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Fri, 18 Aug 2017 16:15:44 -0700 Subject: [PATCH] Bug 1391789 - Make tooltool cache level dependent; r=dustin Caches shared across levels scare me, even if readers are purported to perform content verification. We shouldn't take any risks with released Firefox builds being contaminated by e.g. Try tasks. Also, the old cache name interferes with my desire to make cache names dynamic. This requires dynamic scopes. We already have have level-{{level}}-* scopes for caches. So having all caches prefixed with this makes things flexible. MozReview-Commit-ID: LsrcxIYoEh1 --HG-- extra : rebase_source : dfe97f92a726059200ed79afe215ef2cf1fd7bf1 --- taskcluster/docs/caches.rst | 11 ++++++----- taskcluster/taskgraph/transforms/job/common.py | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/taskcluster/docs/caches.rst b/taskcluster/docs/caches.rst index 2e4203520ddb..79d3620ac707 100644 --- a/taskcluster/docs/caches.rst +++ b/taskcluster/docs/caches.rst @@ -43,8 +43,9 @@ Workspace Caches Other ===== -``tooltool-cache`` - Tooltool invocations should use this cache. Tooltool will store files here - indexed by their hash, and will verify hashes before copying files from - this directory, so there is no concern with sharing the cache between jobs - of different levels. +``level-{{level}}-tooltool-cache + Tooltool invocations should use this cache. Tooltool will store files here + indexed by their hash. + +``tooltool-cache`` (deprecated) + Legacy location for tooltool files. Use the per-level one instead. diff --git a/taskcluster/taskgraph/transforms/job/common.py b/taskcluster/taskgraph/transforms/job/common.py index ece29e742d0d..198d1904d6e3 100644 --- a/taskcluster/taskgraph/transforms/job/common.py +++ b/taskcluster/taskgraph/transforms/job/common.py @@ -142,9 +142,11 @@ def docker_worker_add_tooltool(config, job, taskdesc, internal=False): assert job['worker']['implementation'] in ('docker-worker', 'docker-engine') + level = config.params['level'] + taskdesc['worker'].setdefault('caches', []).append({ 'type': 'persistent', - 'name': 'tooltool-cache', + 'name': 'level-%s-tooltool-cache' % level, 'mount-point': '/home/worker/tooltool-cache', })