Bug 1295380 - Use run-task for test tasks; r=dustin
☠☠ backed out by f90d73ed0269 ☠ ☠
authorGregory Szorc <gps@mozilla.com>
Tue, 16 Aug 2016 09:25:35 -0700
changeset 309947 905fb4a53386c76d931e4a04a31d03739a00a1ff
parent 309946 213a4986ccfd71f04f822e56b1a9ad9505ed5e98
child 309948 5d17d3db2b52839af7900d68b385bfbff97df7d4
push id31500
push usergszorc@mozilla.com
push dateThu, 18 Aug 2016 16:05:10 +0000
treeherderautoland@905fb4a53386 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1295380
milestone51.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 1295380 - Use run-task for test tasks; r=dustin Before, test.sh (duplicated between the desktop-test and desktop1604-test images) was dropping permissions, creating a workspace, and executing test-linux.sh. This is functionality now provided by run-task. So, convert the test tasks to use run-task. It's worth noting that creating the workspace directory is no longer necessary because it is defined as a VOLUME in the Dockerfile or a cache in some task configurations. However, it is default owned by root:root, so we do need to instruct run-task to chown it. Since the test.sh files are no longer used after this change, they have been deleted. The desktop-test image no longer has any files in the bin/ directory, so the Dockerfile entry to copy those files has been removed. MozReview-Commit-ID: 1BiskrMs6xW
taskcluster/taskgraph/transforms/tests/make_task_description.py
testing/docker/desktop-test/Dockerfile
testing/docker/desktop-test/bin/test.sh
testing/docker/desktop1604-test/bin/test.sh
--- a/taskcluster/taskgraph/transforms/tests/make_task_description.py
+++ b/taskcluster/taskgraph/transforms/tests/make_task_description.py
@@ -188,18 +188,24 @@ def docker_worker_setup(config, test, ta
             'mount-point': '/home/worker/tooltool-cache',
         })
         taskdesc['scopes'].extend([
             'docker-worker:relengapi-proxy:tooltool.download.internal',
             'docker-worker:relengapi-proxy:tooltool.download.public',
         ])
 
     # assemble the command line
+    command = [
+        '/home/worker/bin/run-task',
+        # The workspace cache/volume is default owned by root:root.
+        '--chown', '/home/worker/workspace',
+        '--',
+        '/home/worker/bin/test-linux.sh',
+    ]
 
-    command = ["bash", "/home/worker/bin/test.sh"]
     if mozharness.get('no-read-buildbot-config'):
         command.append("--no-read-buildbot-config")
     command.extend([
         {"task-reference": "--installer-url=" + installer_url},
         {"task-reference": "--test-packages-url=" + test_packages_url},
     ])
     command.extend(mozharness.get('extra-options', []))
 
--- a/testing/docker/desktop-test/Dockerfile
+++ b/testing/docker/desktop-test/Dockerfile
@@ -37,17 +37,16 @@ ENV           USER          worker
 ENV           LOGNAME       worker
 ENV           HOSTNAME      taskcluster-worker
 ENV           LANG          en_US.UTF-8
 ENV           LC_ALL        en_US.UTF-8
 
 # Add utilities and configuration
 COPY           dot-files/config              /home/worker/.config
 COPY           dot-files/pulse               /home/worker/.pulse
-COPY           bin                           /home/worker/bin
 RUN            chmod +x bin/*
 # TODO: remove this when buildbot is gone
 COPY           buildprops.json               /home/worker/buildprops.json
 COPY           tc-vcs-config.yml /etc/taskcluster-vcs.yml
 
 # TODO: remove
 ADD            https://raw.githubusercontent.com/taskcluster/buildbot-step/master/buildbot_step /home/worker/bin/buildbot_step
 RUN chmod u+x /home/worker/bin/buildbot_step
deleted file mode 100644
--- a/testing/docker/desktop-test/bin/test.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#! /bin/bash -vex
-
-set -x -e
-
-: GECKO_HEAD_REPOSITORY         ${GECKO_HEAD_REPOSITORY:=https://hg.mozilla.org/mozilla-central}
-: GECKO_HEAD_REV                ${GECKO_HEAD_REV:=default}
-: WORKSPACE                     ${WORKSPACE:=/home/worker/workspace}
-
-
-# TODO: when bug 1093833 is solved and tasks can run as non-root, reduce this
-# to a simple fail-if-root check
-if [ $(id -u) = 0 ]; then
-    chown -R worker:worker /home/worker
-    # drop privileges by re-running this script
-    exec sudo -E -u worker bash /home/worker/bin/test.sh "${@}"
-fi
-
-[ -d $WORKSPACE ] || mkdir -p $WORKSPACE
-cd $WORKSPACE
-exec /home/worker/bin/test-linux.sh "${@}"
deleted file mode 100644
--- a/testing/docker/desktop1604-test/bin/test.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#! /bin/bash -vex
-
-set -x -e
-
-: GECKO_HEAD_REPOSITORY         ${GECKO_HEAD_REPOSITORY:=https://hg.mozilla.org/mozilla-central}
-: GECKO_HEAD_REV                ${GECKO_HEAD_REV:=default}
-: WORKSPACE                     ${WORKSPACE:=/home/worker/workspace}
-
-
-# TODO: when bug 1093833 is solved and tasks can run as non-root, reduce this
-# to a simple fail-if-root check
-if [ $(id -u) = 0 ]; then
-    chown -R worker:worker /home/worker
-    # drop privileges by re-running this script
-    exec sudo -E -u worker bash /home/worker/bin/test.sh "${@}"
-fi
-
-[ -d $WORKSPACE ] || mkdir -p $WORKSPACE
-cd $WORKSPACE
-exec /home/worker/bin/test-linux.sh "${@}"