Bug 1469697 - Use run-task transform for hazard tasks. r=tomprince
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 13 Aug 2019 16:40:14 +0900
changeset 488143 a90eaeb660775d216ab0c011687a9c15dbf7ee59
parent 488142 993f7ea9b2604c98fecc95225176b238b2aec491
child 488144 ef9aa40a25e1c69108af7f2b9a245db991953691
push id36435
push usercbrindusan@mozilla.com
push dateThu, 15 Aug 2019 09:46:49 +0000
treeherdermozilla-central@0db07ff50ab5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstomprince
bugs1469697
milestone70.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 1469697 - Use run-task transform for hazard tasks. r=tomprince Differential Revision: https://phabricator.services.mozilla.com/D41726
taskcluster/taskgraph/transforms/job/hazard.py
--- a/taskcluster/taskgraph/transforms/job/hazard.py
+++ b/taskcluster/taskgraph/transforms/job/hazard.py
@@ -5,23 +5,25 @@
 Support for running hazard jobs via dedicated scripts
 """
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 from taskgraph.util.schema import Schema
 from voluptuous import Required, Optional, Any
 
-from taskgraph.transforms.job import run_job_using
+from taskgraph.transforms.job import (
+    run_job_using,
+    configure_taskdesc_for_run,
+)
 from taskgraph.transforms.job.common import (
     docker_worker_add_workspace_cache,
     setup_secrets,
     docker_worker_add_artifacts,
     docker_worker_add_tooltool,
-    support_vcs_checkout,
 )
 
 haz_run_schema = Schema({
     Required('using'): 'hazard',
 
     # The command to run within the task image (passed through to the worker)
     Required('command'): basestring,
 
@@ -39,37 +41,29 @@ haz_run_schema = Schema({
     Required('workdir'): basestring,
 })
 
 
 @run_job_using("docker-worker", "hazard", schema=haz_run_schema)
 def docker_worker_hazard(config, job, taskdesc):
     run = job['run']
 
-    worker = taskdesc['worker']
+    worker = taskdesc['worker'] = job['worker']
     worker['artifacts'] = []
 
     docker_worker_add_artifacts(config, job, taskdesc)
     docker_worker_add_workspace_cache(config, job, taskdesc)
     docker_worker_add_tooltool(config, job, taskdesc)
     setup_secrets(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'],
     })
 
     # script parameters
     if run.get('mozconfig'):
-        env['MOZCONFIG'] = run['mozconfig']
-
-    # build-haz-linux.sh needs this otherwise it assumes the checkout is in
-    # the workspace.
-    env['GECKO_PATH'] = '{workdir}/checkouts/gecko'.format(**run)
+        env['MOZCONFIG'] = run.pop('mozconfig')
 
-    worker['command'] = [
-        '{workdir}/bin/run-task'.format(**run),
-        '--gecko-checkout', '{workdir}/checkouts/gecko'.format(**run),
-        '--',
-        '/bin/bash', '-c', run['command']
-    ]
+    run['using'] = 'run-task'
+    run['cwd'] = run['workdir']
+    configure_taskdesc_for_run(config, job, taskdesc, worker['implementation'])