Bug 1545862 - translate aws-provisioner-v1 to ec2 except for existing deployment r=tomprince
☠☠ backed out by 8887ea101536 ☠ ☠
authorDustin J. Mitchell <dustin@mozilla.com>
Wed, 15 May 2019 15:14:15 +0000
changeset 535848 0d390c4c20d6eb41bddf989346de8cf2470c85c9
parent 535847 29e91bd3091d6257e55df68a138eca54f8dad21f
child 535849 c58e444ffd0cf281ed4a708c149c834fe66fbba3
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [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/test/python.ini
taskcluster/taskgraph/util/workertypes.py
--- a/taskcluster/taskgraph/test/python.ini
+++ b/taskcluster/taskgraph/test/python.ini
@@ -22,10 +22,9 @@ skip-if = python == 3
 [test_util_parameterization.py]
 [test_util_python_path.py]
 [test_util_runnable_jobs.py]
 [test_util_schema.py]
 [test_util_taskcluster.py]
 [test_util_templates.py]
 [test_util_time.py]
 [test_util_treeherder.py]
-[test_util_workertypes.py]
 [test_util_yaml.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'),
@@ -31,16 +32,17 @@ WORKER_TYPES = {
 }
 
 
 @memoize
 def _get(graph_config, alias, level):
     """Get the configuration for this worker_type alias: {provisioner,
     worker-type, implementation, os}"""
     level = str(level)
+
     # handle the legacy (non-alias) format
     if '/' in alias:
         alias = alias.format(level=level)
         provisioner, worker_type = alias.split("/", 1)
         try:
             implementation, os = WORKER_TYPES[alias]
             return {
                 'provisioner': provisioner,
@@ -56,22 +58,22 @@ def _get(graph_config, alias, level):
 
     matches = keymatch(graph_config['workers']['aliases'], alias)
     if len(matches) > 1:
         raise KeyError("Multiple matches for worker-type alias " + alias)
     elif not matches:
         raise KeyError("No matches for worker-type alias " + alias)
     worker_config = matches[0]
 
-    def eval_field(field, value):
-        return evaluate_keyed_by(
-            value,
-            "worker-type alias {} field {}".format(alias, field),
-            {"level": level}).format(level=level, alias=alias)
-    return {field: eval_field(field, value) for field, value in worker_config.iteritems()}
+    worker_config['worker-type'] = evaluate_keyed_by(
+        worker_config['worker-type'],
+        "worker-type alias {} field worker-type".format(alias),
+        {"level": level}).format(level=level, alias=alias)
+
+    return worker_config
 
 
 @memoize
 def worker_type_implementation(graph_config, worker_type):
     """Get the worker implementation and OS for the given workerType, where the
     OS represents the host system, not the target OS, in the case of
     cross-compiles."""
     worker_config = _get(graph_config, worker_type, '1')
@@ -80,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']