Bug 1545862 - translate aws-provisioner-v1 to ec2 except for existing deployment r=tomprince
authorDustin J. Mitchell <dustin@mozilla.com>
Wed, 15 May 2019 17:38:56 +0000
changeset 532794 23d241c9666593bd287ab3333a0227963bd28bcf
parent 532793 77efc33e0c39eebdfe1b702781e03e719c69922d
child 532795 5f88dc67d75ba1e08dad4c4e9b39a8df593b2be6
push id11272
push userapavel@mozilla.com
push dateThu, 16 May 2019 15:28:22 +0000
treeherdermozilla-beta@2265bfc5920d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstomprince
bugs1545862
milestone68.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 1545862 - translate aws-provisioner-v1 to ec2 except for existing deployment r=tomprince Differential Revision: https://phabricator.services.mozilla.com/D29493
taskcluster/taskgraph/util/workertypes.py
--- a/taskcluster/taskgraph/util/workertypes.py
+++ b/taskcluster/taskgraph/util/workertypes.py
@@ -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/.
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 from mozbuild.util import memoize
 
+from .taskcluster import get_root_url
 from .keyed_by import evaluate_keyed_by
 from .attributes import keymatch
 
 WORKER_TYPES = {
     'gce/gecko-1-b-linux': ('docker-worker', 'linux'),
     'releng-hardware/gecko-1-b-win2012-gamma': ('generic-worker', 'windows'),
     'gce/gecko-2-b-linux': ('docker-worker', 'linux'),
     'releng-hardware/gecko-2-b-win2012-gamma': ('generic-worker', 'windows'),
@@ -81,9 +82,19 @@ def worker_type_implementation(graph_con
 
 @memoize
 def get_worker_type(graph_config, worker_type, level):
     """
     Get the worker type provisioner and worker-type, optionally evaluating
     aliases from the graph config.
     """
     worker_config = _get(graph_config, worker_type, level)
-    return worker_config["provisioner"], worker_config['worker-type']
+
+    # translate the provisionerId to 'ec2' everywhere but the original
+    # https://taskcluster.net deployment.  Once that deployment is no longer in
+    # use, this can be removed and all corresponding provisioners changed to
+    # `ec2`
+    root_url = get_root_url(False)
+    provisioner = worker_config["provisioner"]
+    if root_url != 'https://taskcluster.net' and provisioner == 'aws-provisioner-v1':
+        provisioner = 'ec2'
+
+    return provisioner, worker_config['worker-type']