Bug 1375044: remove temporary load-balancing check; r?wcosta draft
authorDustin J. Mitchell <dustin@mozilla.com>
Wed, 21 Jun 2017 16:07:14 +0000
changeset 598308 88a1f4857843e6a5bcc4643521e1c99fec44f279
parent 598307 92eb911c35da48907d326604c4c92cf55e551895
child 634446 8f6f944a3af557bb950bf00f7c47b22c952ed9cb
push id65171
push userdmitchell@mozilla.com
push dateWed, 21 Jun 2017 16:12:46 +0000
reviewerswcosta
bugs1375044
milestone56.0a1
Bug 1375044: remove temporary load-balancing check; r?wcosta MozReview-Commit-ID: 7oy5C9KSpvR
taskcluster/taskgraph/transforms/tests.py
--- a/taskcluster/taskgraph/transforms/tests.py
+++ b/taskcluster/taskgraph/transforms/tests.py
@@ -30,18 +30,16 @@ from taskgraph.util.schema import (
 from voluptuous import (
     Any,
     Optional,
     Required,
 )
 
 import copy
 import logging
-import requests
-from collections import defaultdict
 
 # default worker types keyed by instance-size
 LINUX_WORKER_TYPES = {
     'large': 'aws-provisioner-v1/gecko-t-linux-large',
     'xlarge': 'aws-provisioner-v1/gecko-t-linux-xlarge',
     'legacy': 'aws-provisioner-v1/gecko-t-linux-medium',
     'default': 'aws-provisioner-v1/gecko-t-linux-large',
 }
@@ -721,43 +719,16 @@ def set_worker_type(config, tests):
                 test['worker-type'] = LINUX_WORKER_TYPES[test['instance-size']]
         else:
             raise Exception("unknown test_platform {}".format(test_platform))
 
         yield test
 
 
 @transforms.add
-def allocate_to_bbb(config, tests):
-    """Make the load balancing between taskcluster and buildbot"""
-    j = get_load_balacing_settings()
-
-    tests_set = defaultdict(list)
-    for test in tests:
-        tests_set[test['test-platform']].append(test)
-
-    # Make the load balancing between taskcluster and buildbot
-    for test_platform, t in tests_set.iteritems():
-        # We sort the list to make the order of the tasks deterministic
-        t.sort(key=lambda x: (x['test-name'], x.get('this_chunk', 1)))
-        # The json file tells the percentage of tasks that run on
-        # taskcluster. The logic here is inverted, as tasks have been
-        # previously assigned to taskcluster. Therefore we assign the
-        # 1-p tasks to buildbot-bridge.
-        n = j.get(test_platform, 1.0)
-        if not (test_platform.startswith('mac')
-                and config.config['args'].taskcluster_worker):
-            for i in range(int(n * len(t)), len(t)):
-                t[i]['worker-type'] = 'buildbot-bridge/buildbot-bridge'
-
-        for y in t:
-            yield y
-
-
-@transforms.add
 def make_job_description(config, tests):
     """Convert *test* descriptions to *job* descriptions (input to
     taskgraph.transforms.job)"""
 
     for test in tests:
         label = '{}-{}-{}'.format(config.kind, test['test-platform'], test['test-name'])
         if test['chunks'] > 1:
             label += '-{}'.format(test['this-chunk'])
@@ -835,16 +806,8 @@ def make_job_description(config, tests):
 
 def normpath(path):
     return path.replace('/', '\\')
 
 
 def get_firefox_version():
     with open('browser/config/version.txt', 'r') as f:
         return f.readline().strip()
-
-
-def get_load_balacing_settings():
-    url = "https://s3.amazonaws.com/taskcluster-graph-scheduling/tests-load.json"
-    try:
-        return requests.get(url).json()
-    except Exception:
-        return {}