Bug 1382849 - Add workspace cache to toolchain docker-worker jobs. r?dustin draft
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 21 Jul 2017 06:55:06 +0900
changeset 612649 55d069a55da0fa05970edde142952f988280cc13
parent 612644 4e8a7ad99f9f2377aa2a226e3a94550d9edfb607
child 638461 46beba99f1fb3e5a152d6cc63a5066f29c1b94ab
push id69555
push userbmo:mh+mozilla@glandium.org
push dateThu, 20 Jul 2017 22:24:15 +0000
reviewersdustin
bugs1382849
milestone56.0a1
Bug 1382849 - Add workspace cache to toolchain docker-worker jobs. r?dustin
taskcluster/ci/toolchain/kind.yml
taskcluster/taskgraph/transforms/build_attrs.py
taskcluster/taskgraph/transforms/job/toolchain.py
--- a/taskcluster/ci/toolchain/kind.yml
+++ b/taskcluster/ci/toolchain/kind.yml
@@ -1,16 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 loader: taskgraph.loader.transform:loader
 
 transforms:
    - taskgraph.transforms.try_job:transforms
+   - taskgraph.transforms.build_attrs:transforms
    - taskgraph.transforms.toolchain:transforms
    - taskgraph.transforms.job:transforms
    - taskgraph.transforms.task:transforms
 
 jobs-from:
    - linux.yml
    - macosx.yml
    - windows.yml
--- a/taskcluster/taskgraph/transforms/build_attrs.py
+++ b/taskcluster/taskgraph/transforms/build_attrs.py
@@ -12,17 +12,21 @@ transforms = TransformSequence()
 def set_build_attributes(config, jobs):
     """
     Set the build_platform and build_type attributes based on the job name.
     Although not all jobs using this transform are actual "builds", the try
     option syntax treats them as such, and this arranges the attributes
     appropriately for that purpose.
     """
     for job in jobs:
-        build_platform, build_type = job['name'].split('/')
+        if '/' in job['name']:
+            build_platform, build_type = job['name'].split('/')
+        else:
+            build_platform = job['name']
+            build_type = 'opt'
 
         # pgo builds are represented as a different platform, type opt
         if build_type == 'pgo':
             build_platform = build_platform + '-pgo'
             build_type = 'opt'
 
         attributes = job.setdefault('attributes', {})
         attributes.update({
--- a/taskcluster/taskgraph/transforms/job/toolchain.py
+++ b/taskcluster/taskgraph/transforms/job/toolchain.py
@@ -9,16 +9,17 @@ from __future__ import absolute_import, 
 
 from taskgraph.util.schema import Schema
 from voluptuous import Optional, Required, Any
 
 from taskgraph.transforms.job import run_job_using
 from taskgraph.transforms.job.common import (
     docker_worker_add_tc_vcs_cache,
     docker_worker_add_gecko_vcs_env_vars,
+    docker_worker_add_workspace_cache,
     support_vcs_checkout,
 )
 from taskgraph.util.hash import hash_paths
 from taskgraph import GECKO
 
 
 TOOLCHAIN_INDEX = 'gecko.cache.level-{level}.toolchains.v1.{name}.{digest}'
 
@@ -81,16 +82,17 @@ def docker_worker_toolchain(config, job,
     worker['caches'] = []
 
     worker['artifacts'].append({
         'name': 'public',
         'path': '/home/worker/workspace/artifacts/',
         'type': 'directory',
     })
 
+    docker_worker_add_workspace_cache(config, job, taskdesc)
     docker_worker_add_tc_vcs_cache(config, job, taskdesc)
     docker_worker_add_gecko_vcs_env_vars(config, job, taskdesc)
     support_vcs_checkout(config, job, taskdesc)
 
     env = worker['env']
     env.update({
         'MOZ_BUILD_DATE': config.params['moz_build_date'],
         'MOZ_SCM_LEVEL': config.params['level'],