Bug 1426324 - Make toolchain cache indexes vary depending on the docker image name. r?dustin draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 21 Dec 2017 14:01:31 +0900
changeset 713884 421bb6560a1d06213869f4d367b7130ca0f4602e
parent 713883 0129c9d78298a093ae85833f1915377cf6cc861e
child 744464 03c0edd7a1feaf7d77eed30028e3f97a099e413b
push id93787
push userbmo:mh+mozilla@glandium.org
push dateThu, 21 Dec 2017 05:03:01 +0000
reviewersdustin
bugs1426324
milestone59.0a1
Bug 1426324 - Make toolchain cache indexes vary depending on the docker image name. r?dustin
taskcluster/taskgraph/transforms/job/toolchain.py
--- a/taskcluster/taskgraph/transforms/job/toolchain.py
+++ b/taskcluster/taskgraph/transforms/job/toolchain.py
@@ -83,16 +83,27 @@ def get_digest_data(config, run, taskdes
     # If the task has dependencies, we need those dependencies to influence
     # the index path. So take the digest from the files above, add the list
     # of its dependencies, and hash the aggregate.
     # If the task has no dependencies, just use the digest from above.
     deps = taskdesc['dependencies']
     if deps:
         data.extend(sorted(deps.values()))
 
+    # If the task uses an in-tree docker image, we want it to influence
+    # the index path as well. Ideally, the content of the docker image itself
+    # should have an influence, but at the moment, we can't get that
+    # information here. So use the docker image name as a proxy. Not a lot of
+    # changes to docker images actually have an impact on the resulting
+    # toolchain artifact, so we'll just rely on such important changes to be
+    # accompanied with a docker image name change.
+    image = taskdesc['worker'].get('docker-image', {}).get('in-tree')
+    if image:
+        data.extend(image)
+
     # Likewise script arguments should influence the index.
     args = run.get('arguments')
     if args:
         data.extend(args)
     return data
 
 
 @run_job_using("docker-worker", "toolchain-script", schema=toolchain_run_schema)