From bf8f8cbb209ec799610498ee1eb8e28ec7876094 Mon Sep 17 00:00:00 2001 From: "jlal@mozilla.com" Date: Fri, 6 Feb 2015 23:08:48 -0800 Subject: [PATCH] Bug 1131152 - Update tester image to use tc-vcs and download mozharness r=garndt --HG-- extra : rebase_source : 36fe51e73ba81c49d3c0861de4a25c5857699df9 --- testing/docker/tester/Dockerfile | 9 +++++---- testing/docker/tester/VERSION | 2 +- testing/docker/tester/bin/entrypoint | 12 ++++++++++++ testing/docker/tester/bin/pull_gaia.sh | 11 +---------- testing/docker/tester/test-setup.sh | 7 ------- testing/taskcluster/tasks/test.yml | 3 +++ 6 files changed, 22 insertions(+), 22 deletions(-) delete mode 100755 testing/docker/tester/test-setup.sh diff --git a/testing/docker/tester/Dockerfile b/testing/docker/tester/Dockerfile index 4d524caac05b..fb3a08f0ed60 100644 --- a/testing/docker/tester/Dockerfile +++ b/testing/docker/tester/Dockerfile @@ -3,16 +3,17 @@ MAINTAINER Jonas Finnemann Jensen # Add utilities and configuration ADD b2g-desktop-config.py /home/worker/b2g-desktop-config.py -ADD test-setup.sh /tmp/test-setup.sh ADD dot-config /home/worker/.config ADD dot-pulse /home/worker/.pulse ADD bin /home/worker/bin ADD mozharness_configs /home/worker/mozharness_configs # Run test setup script -USER root -RUN ["/tmp/test-setup.sh"] -ENV PATH $PATH:/home/worker/bin +RUN pip install virtualenv; +RUN mkdir Documents; mkdir Pictures; mkdir Music; mkdir Videos; mkdir artifacts +RUN chown -R worker:worker /home/worker/* /home/worker/.* +RUN npm install -g taskcluster-vcs@2.1.3 +ENV PATH $PATH:/home/worker/bin # TODO Re-enable worker when bug 1093833 lands #USER worker diff --git a/testing/docker/tester/VERSION b/testing/docker/tester/VERSION index c5d54ec32616..7c1886bb9f47 100644 --- a/testing/docker/tester/VERSION +++ b/testing/docker/tester/VERSION @@ -1 +1 @@ -0.0.9 +0.0.10 diff --git a/testing/docker/tester/bin/entrypoint b/testing/docker/tester/bin/entrypoint index ce41038079c6..5951784beaf9 100755 --- a/testing/docker/tester/bin/entrypoint +++ b/testing/docker/tester/bin/entrypoint @@ -1,5 +1,8 @@ #! /bin/bash -vex +test $MOZHARNESS_REPOSITORY # mozharness repository +test $MOZHARNESS_REV # mozharness revision + # This file is intended to be used as the "entrypoint" or first command in the # docker image. It uses "eval" so it takes place of the usual /bin/bash -c # conventions you need when running a docker image. Primarily it @@ -9,4 +12,13 @@ Xvfb :0 -nolisten tcp -screen 0 1600x1200x24 2>/dev/null & export DISPLAY=:0 +# First check if the mozharness directory is available. This is intended to be +# used locally in development to test mozharness changes: +# +# $ docker -v your_mozharness:/home/worker/mozharness ... +# +if [ ! -d mozharness ]; then + tc-vcs checkout mozharness $MOZHARNESS_REPOSITORY $MOZHARNESS_REPOSITORY $MOZHARNESS_REV +fi + eval $@ diff --git a/testing/docker/tester/bin/pull_gaia.sh b/testing/docker/tester/bin/pull_gaia.sh index d1d6fdafb8cb..c1bb8fe833dc 100755 --- a/testing/docker/tester/bin/pull_gaia.sh +++ b/testing/docker/tester/bin/pull_gaia.sh @@ -1,12 +1,3 @@ #!/bin/bash -vex - - gaia_dir=/home/worker/gaia - -# Some mozharness scripts are harcoded to use $PWD/gaia for the gaia repo and -# will delete the directory and clone again if .hg doesn't exist. Does not work -# well when trying to cache -if [ ! -d "$gaia_dir/.hg" ]; then - echo "Cloning gaia into $gaia_dir" - hg clone https://hg.mozilla.org/integration/gaia-central/ $gaia_dir -fi +tc-vcs checkout $gaia_dir https://hg.mozilla.org/integration/gaia-central/ diff --git a/testing/docker/tester/test-setup.sh b/testing/docker/tester/test-setup.sh deleted file mode 100755 index f43915b66f43..000000000000 --- a/testing/docker/tester/test-setup.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -ve - -pip install virtualenv; -mkdir Documents; mkdir Pictures; mkdir Music; mkdir Videos; mkdir artifacts -hg clone http://hg.mozilla.org/build/mozharness/ -echo 'Xvfb :0 -nolisten tcp -screen 0 1600x1200x24 &> /dev/null &' >> .bashrc -chown -R worker:worker /home/worker/* /home/worker/.* diff --git a/testing/taskcluster/tasks/test.yml b/testing/taskcluster/tasks/test.yml index f5fa07309ba6..a6af3599d752 100644 --- a/testing/taskcluster/tasks/test.yml +++ b/testing/taskcluster/tasks/test.yml @@ -19,6 +19,9 @@ task: payload: image: '{{#docker_image}}tester{{/docker_image}}' maxRunTime: 3600 + env: + MOZHARNESS_REPOSITORY: '{{mozharness_repository}}' + MOZHARNESS_REV: '{{mozharness_rev}}' extra: treeherder: