Bug 1314807 - Use run-task in hazard kind; r=dustin
authorGregory Szorc <gps@mozilla.com>
Wed, 02 Nov 2016 15:45:40 -0700
changeset 320925 185c111b53ece36e278c4089a28e3e87ae87ada4
parent 320924 0c2d2dfc302e8ae309926b7392deff79eecbbb72
child 320926 bf15eb2ce373ec2baf9b91d11d3f079282e4946f
push id30913
push userkwierso@gmail.com
push dateFri, 04 Nov 2016 19:14:07 +0000
treeherdermozilla-central@753433776a5e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1314807
milestone52.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 1314807 - Use run-task in hazard kind; r=dustin As part of this, we eliminate tc-vcs since it is redundant with run-task. MozReview-Commit-ID: 8HAFSM73BOU
taskcluster/ci/hazard/kind.yml
taskcluster/taskgraph/transforms/job/hazard.py
--- a/taskcluster/ci/hazard/kind.yml
+++ b/taskcluster/ci/hazard/kind.yml
@@ -28,18 +28,17 @@ jobs:
                 gecko-v2: shell-haz-debug
         treeherder:
             platform: linux64/debug
             symbol: SM-tc(H)
         run:
             using: hazard
             tooltool-manifest: "browser/config/tooltool-manifests/linux64/hazard.manifest"
             command: >
-                tc-vcs checkout workspace/gecko "$GECKO_BASE_REPOSITORY" "$GECKO_HEAD_REPOSITORY" "$GECKO_HEAD_REV" "$GECKO_HEAD_REF"
-                && cd ./workspace/gecko/taskcluster/scripts/builder
+                cd /home/worker/checkouts/gecko/taskcluster/scripts/builder
                 && ./build-haz-linux.sh --project shell $HOME/workspace
         when:
             files-changed:
                 - js/public/**
                 - js/src/**
 
     linux64-haz/debug:
         description: "Browser Hazard Analysis Linux"
@@ -50,11 +49,10 @@ jobs:
         treeherder:
             platform: linux64/debug
             symbol: tc(H)
         run:
             using: hazard
             tooltool-manifest: "browser/config/tooltool-manifests/linux64/hazard.manifest"
             mozconfig: "browser/config/mozconfigs/linux64/hazards"
             command: >
-                tc-vcs checkout workspace/gecko "$GECKO_BASE_REPOSITORY" "$GECKO_HEAD_REPOSITORY" "$GECKO_HEAD_REV" "$GECKO_HEAD_REF"
-                && cd ./workspace/gecko/taskcluster/scripts/builder
+                cd /home/worker/checkouts/gecko/taskcluster/scripts/builder
                 && ./build-haz-linux.sh --project browser $HOME/workspace
--- a/taskcluster/taskgraph/transforms/job/hazard.py
+++ b/taskcluster/taskgraph/transforms/job/hazard.py
@@ -9,19 +9,18 @@ from __future__ import absolute_import, 
 
 import time
 from voluptuous import Schema, Required, Optional, Any
 
 from taskgraph.transforms.job import run_job_using
 from taskgraph.transforms.job.common import (
     docker_worker_add_workspace_cache,
     docker_worker_setup_secrets,
-    docker_worker_add_tc_vcs_cache,
-    docker_worker_add_gecko_vcs_env_vars,
-    docker_worker_add_public_artifacts
+    docker_worker_add_public_artifacts,
+    docker_worker_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,
 
@@ -43,21 +42,20 @@ haz_run_schema = Schema({
 @run_job_using("docker-worker", "hazard", schema=haz_run_schema)
 def docker_worker_hazard(config, job, taskdesc):
     run = job['run']
 
     worker = taskdesc['worker']
     worker['artifacts'] = []
     worker['caches'] = []
 
-    docker_worker_add_tc_vcs_cache(config, job, taskdesc)
     docker_worker_add_public_artifacts(config, job, taskdesc)
     docker_worker_add_workspace_cache(config, job, taskdesc)
     docker_worker_setup_secrets(config, job, taskdesc)
-    docker_worker_add_gecko_vcs_env_vars(config, job, taskdesc)
+    docker_worker_support_vcs_checkout(config, job, taskdesc)
 
     env = worker['env']
     env.update({
         'MOZ_BUILD_DATE': time.strftime("%Y%m%d%H%M%S", time.gmtime(config.params['pushdate'])),
         'MOZ_SCM_LEVEL': config.params['level'],
     })
 
     # script parameters
@@ -75,9 +73,19 @@ def docker_worker_hazard(config, job, ta
     worker['relengapi-proxy'] = True
     taskdesc['scopes'].extend([
         'docker-worker:relengapi-proxy:tooltool.download.public',
     ])
     env['TOOLTOOL_CACHE'] = '/home/worker/tooltool-cache'
     env['TOOLTOOL_REPO'] = 'https://github.com/mozilla/build-tooltool'
     env['TOOLTOOL_REV'] = 'master'
 
-    worker['command'] = ["/bin/bash", "-c", run['command']]
+    # build-haz-linux.sh needs this otherwise it assumes the checkout is in
+    # the workspace.
+    env['GECKO_DIR'] = '/home/worker/checkouts/gecko'
+
+    worker['command'] = [
+        '/home/worker/bin/run-task',
+        '--chown-recursive', '/home/worker/tooltool-cache',
+        '--vcs-checkout', '/home/worker/checkouts/gecko',
+        '--',
+        '/bin/bash', '-c', run['command']
+    ]