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
--- a/taskcluster/docs/caches.rst
+++ b/taskcluster/docs/caches.rst
@@ -38,13 +38,14 @@ Workspace Caches
``level-{{level}}-*-workspace``
These caches (of various names typically ending with ``workspace``)
contain state to be shared between task invocations. Use cases are
dependent on the task.
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.
--- a/taskcluster/taskgraph/transforms/job/common.py
+++ b/taskcluster/taskgraph/transforms/job/common.py
@@ -137,19 +137,21 @@ def docker_worker_add_tooltool(config, j
Enables the tooltool cache. Adds releng proxy. Configures scopes.
By default, only public tooltool access will be granted. Access to internal
tooltool can be enabled via ``internal=True``.
"""
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',
})
taskdesc['worker'].setdefault('env', {}).update({
'TOOLTOOL_CACHE': '/home/worker/tooltool-cache',
})
job['worker']['relengapi-proxy'] = True