Bug 1399679 - Add a version string to cache names; r?glandium draft
authorGregory Szorc <gps@mozilla.com>
Mon, 22 Jan 2018 21:58:54 -0800
changeset 723426 bf6a3c53ab14f2eb249fdf57ff70dce97388f0a0
parent 723425 2b6455d1511d5e67ff284c42964a890bf6d07f36
child 746851 ef1b82ed0769eb301478b2829aa58cc6f22bc668
push id96421
push userbmo:gps@mozilla.com
push dateTue, 23 Jan 2018 05:59:40 +0000
reviewersglandium
bugs1399679
milestone60.0a1
Bug 1399679 - Add a version string to cache names; r?glandium So we can change a string in this file to force the use of new caches, thus ensuring a clean break from one changeset to the next. MozReview-Commit-ID: EZsR23a1PZE
taskcluster/taskgraph/transforms/task.py
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -860,25 +860,32 @@ def build_docker_worker_payload(config, 
         # name into consideration. This means that different Docker images will
         # never share the same cache. This is a bit unfortunate. But it is the
         # safest thing to do. Fortunately, most images are defined in-tree.
         #
         # For out-of-tree Docker images, we don't strictly need to incorporate
         # the run-task content into the cache name. However, doing so preserves
         # the mechanism whereby changing run-task results in new caches
         # everywhere.
+
+        # As an additional mechanism to force the use of different caches, the
+        # string literal in the variable below can be changed. This is
+        # preferred to changing run-task because it doesn't require images
+        # to be rebuilt.
+        cache_version = 'v1'
+
         if run_task:
-            suffix = '-%s' % _run_task_suffix()
+            suffix = '-%s-%s' % (cache_version, _run_task_suffix())
 
             if out_of_tree_image:
                 name_hash = hashlib.sha256(out_of_tree_image).hexdigest()
                 suffix += name_hash[0:12]
 
         else:
-            suffix = ''
+            suffix = '-%s' % cache_version
 
         skip_untrusted = config.params.is_try() or level == 1
 
         for cache in worker['caches']:
             # Some caches aren't enabled in environments where we can't
             # guarantee certain behavior. Filter those out.
             if cache.get('skip-untrusted') and skip_untrusted:
                 continue