Bug 1432219 - part 3: Fix bad beetmover worker type in production r=bhearsum
authorJohan Lorenzo <jlorenzo@mozilla.com>
Fri, 02 Mar 2018 15:20:50 +0100
changeset 461342 d29a3444f2bdb8fb67af7d1694a5996d4f461d07
parent 461341 42237b8f42470906c1c89257ae7a20829b384983
child 461343 f3e75a851a232cfd9dece24bc05e2f910b4526ca
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhearsum
bugs1432219
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1432219 - part 3: Fix bad beetmover worker type in production r=bhearsum
taskcluster/ci/release-generate-checksums-beetmover/kind.yml
taskcluster/taskgraph/transforms/release_generate_checksums_beetmover.py
--- a/taskcluster/ci/release-generate-checksums-beetmover/kind.yml
+++ b/taskcluster/ci/release-generate-checksums-beetmover/kind.yml
@@ -9,8 +9,14 @@ transforms:
    - taskgraph.transforms.release_notifications:transforms
    - taskgraph.transforms.task:transforms
 
 kind-dependencies:
    - release-generate-checksums-signing
 
 job-template:
    shipping-phase: promote
+   worker-type:
+      by-project:
+         mozilla-central: scriptworker-prov-v1/beetmoverworker-v1
+         mozilla-beta: scriptworker-prov-v1/beetmoverworker-v1
+         mozilla-release: scriptworker-prov-v1/beetmoverworker-v1
+         default: scriptworker-prov-v1/beetmoverworker-dev
--- a/taskcluster/taskgraph/transforms/release_generate_checksums_beetmover.py
+++ b/taskcluster/taskgraph/transforms/release_generate_checksums_beetmover.py
@@ -3,17 +3,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 """
 Transform the `release-generate-checksums-beetmover` task to also append `build` as dependency
 """
 from __future__ import absolute_import, print_function, unicode_literals
 
 from taskgraph.transforms.base import TransformSequence
 from taskgraph.util.attributes import copy_attributes_from_dependent_job
-from taskgraph.util.schema import validate_schema, Schema
+from taskgraph.util.schema import validate_schema, Schema, resolve_keyed_by, optionally_keyed_by
 from taskgraph.util.scriptworker import (get_beetmover_bucket_scope,
                                          get_beetmover_action_scope,
                                          get_phase)
 from taskgraph.transforms.beetmover import craft_release_properties
 from taskgraph.transforms.task import task_description_schema
 from voluptuous import Required, Optional
 
 transforms = TransformSequence()
@@ -49,16 +49,17 @@ release_generate_checksums_beetmover_sch
 
     # treeherder is allowed here to override any defaults we use for beetmover.  See
     # taskcluster/taskgraph/transforms/task.py for the schema details, and the
     # below transforms for defaults of various values.
     Optional('treeherder'): task_description_schema['treeherder'],
 
     Optional('shipping-phase'): task_description_schema['shipping-phase'],
     Optional('shipping-product'): task_description_schema['shipping-product'],
+    Required('worker-type'): optionally_keyed_by('project', basestring),
 })
 
 
 @transforms.add
 def validate(config, jobs):
     for job in jobs:
         label = job.get('dependent-task', object).__dict__.get('label', '?no-label?')
         validate_schema(
@@ -97,20 +98,24 @@ def make_task_description(config, jobs):
                 "Can't beetmove a signing task with multiple dependencies")
         # update the dependencies with the dependencies of the signing task
         dependencies.update(dep_job.dependencies)
 
         bucket_scope = get_beetmover_bucket_scope(config)
         action_scope = get_beetmover_action_scope(config)
         phase = get_phase(config)
 
+        resolve_keyed_by(
+            job, 'worker-type', item_name=label, project=config.params['project']
+        )
+
         task = {
             'label': label,
             'description': description,
-            'worker-type': 'scriptworker-prov-v1/beetmoverworker-dev',
+            'worker-type': job['worker-type'],
             'scopes': [bucket_scope, action_scope],
             'dependencies': dependencies,
             'attributes': attributes,
             'run-on-projects': dep_job.attributes.get('run_on_projects'),
             'treeherder': treeherder,
             'shipping-phase': phase,
         }