Skip to content

Commit

Permalink
Merge pull request mozilla-b2g#31550 from nullaus/gaia-taskenv
Browse files Browse the repository at this point in the history
Bug 1198172 - Standardize docker image bases between gecko and gaia e…
  • Loading branch information
nullaus committed Aug 26, 2015
2 parents c1ae9f0 + 0e03613 commit 4bf0cf9
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 66 deletions.
27 changes: 4 additions & 23 deletions build/docker/gaia-taskenv/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
from lightsofapollo/ubuntu-node:latest
maintainer James Lal <[email protected]>

# start by installing all our ubuntu packages
run sudo apt-get -y upgrade --fix-missing
run sudo apt-get -y update --fix-missing
run sudo apt-get -yq install git-core curl wget firefox build-essential xvfb \
python-pip man python-virtualenv libgtk-3-0

run useradd -d /home/tester -s /bin/bash -m tester;
from taskcluster/tester:0.3.6
maintainer Aus Lacroix <[email protected]>

# install our custom git plugin
copy git/target/doc/git-ci-checkout-pr.1 /usr/local/man/man1/git-ci-checkout-pr.1
Expand All @@ -17,20 +9,9 @@ copy git/git-ci-checkout-pr /usr/local/bin/git-ci-checkout-pr
copy git/git-ci-checkout-ref /usr/local/bin/git-ci-checkout-ref
copy git/git-ci-checkout-setup /usr/local/bin/git-ci-checkout-setup

env HOME /home/tester
env SHELL /bin/bash
env USER tester
env LOGNAME tester
env PATH $PATH:/home/tester/bin
workdir /home/tester

run git config --global user.email "[email protected]"
run git config --global user.name "gaia-taskenv"
run npm install npm@latest -g
run npm install [email protected] -g
run npm install [email protected] -g

# run some more root commands which change frequently
copy ./bin/entrypoint /home/tester/bin/entrypoint
copy ./bin/buildbot_step /home/tester/bin/buildbot_step
run chmod a+x /home/tester/bin/entrypoint
copy ./bin/entrypoint /home/worker/bin/entrypoint
run chmod a+x /home/worker/bin/entrypoint
2 changes: 1 addition & 1 deletion build/docker/gaia-taskenv/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.0
1.2.0
25 changes: 7 additions & 18 deletions build/docker/gaia-taskenv/bin/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,25 @@

source ./bin/buildbot_step

export DISPLAY=:99
Xvfb :99 > /dev/null 2>&1 &
Xvfb :0 -nolisten tcp -screen 0 1600x1200x24 2>/dev/null &
export DISPLAY=:0

checkout_path="$PWD/git_checkout"

# Handle initial clone and caching of the initial clone...
step_clone() {
step_checkout() {
# Extract the cached clone (this is kept as a tarball to always keep a clean
# working state without worrying about tree issues).
tc-vcs checkout $checkout_path $GITHUB_BASE_GIT
}

# Run the checkout to the correct url, etc...
step_checkout() {
# TODO: There is a high probability this would be way nicer using getopt and
# ditching the environment variables (either in bash or python)
if [ "$GITHUB_PULL_REQUEST" == "1" ];
then
time git ci-checkout-pr \
$checkout_path \
tc-vcs checkout $checkout_path \
$GITHUB_BASE_GIT \
$GITHUB_BASE_BRANCH \
$GITHUB_BASE_REV \
$GITHUB_HEAD_GIT \
$GITHUB_HEAD_BRANCH \
$GITHUB_HEAD_REV
$GITHUB_HEAD_REV_
else
time git ci-checkout-ref \
$checkout_path \
tc-vcs checkout $checkout_path \
$GITHUB_BASE_GIT \
$GITHUB_HEAD_GIT \
$GITHUB_HEAD_BRANCH \
$GITHUB_HEAD_REV
Expand All @@ -42,7 +32,6 @@ step_npm_cache() {
taskcluster-npm-cache-get --namespace gaia.npm_cache ./package.json
}

buildbot_step 'git clone cache' step_clone
buildbot_step 'git checkout' step_checkout

# From here on we to operate inside of the actual checkout mostly for
Expand Down
2 changes: 1 addition & 1 deletion build/docker/gaia-taskenv/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash -e

./build
docker run $@ -v $PWD/bin:/home/tester/bin -i -t $(cat DOCKER_TAG):$(cat VERSION) /bin/bash
docker run $@ -v $PWD/bin:/home/worker/bin -i -t $(cat DOCKER_TAG):$(cat VERSION) /bin/bash
9 changes: 6 additions & 3 deletions taskgraph.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@
"workerType": "gaia-decision",
"scopes": [
"docker-worker:cache:tc-vcs",
"docker-worker:cache:linux-cache",
"docker-worker:cache:gaia-misc-caches",
"docker-worker:image:quay.io/mozilla/raptor-tester:latest",
"queue:define-task:aws-provisioner/gaia",
"queue:create-task:aws-provisioner/gaia"
],
"payload": {
"cache": {
"gaia-misc-caches": "/home/tester/caches/"
"gaia-misc-caches": "/home/worker/caches/",
"tc-vcs":"/home/worker/.tc-vcs",
"linux-cache":"/home/worker/.cache"
},
"image": "taskcluster/gaia-taskenv:0.9.0",
"image": "taskcluster/gaia-taskenv:1.2.0",
"command": [
"entrypoint",
"echo 'what' && node tests/taskcluster/bin/graph > /graph.json && cat /graph.json"
Expand All @@ -37,7 +40,7 @@
"artifacts": {
"public/package.json": {
"type": "file",
"path": "/home/tester/git_checkout/package.json",
"path": "/home/worker/git_checkout/package.json",
"expires": "2016-03-30T11:59:00.000Z"
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/taskcluster/autolander.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ params:
provisionerId: 'aws-provisioner-v1'
workerType: gaia
# Location in image where we store the gaia contents.
gaia: '/home/tester/git_checkout'
gaia: '/home/worker/git_checkout'

# All task definitions
definitions:
Expand Down
2 changes: 1 addition & 1 deletion tests/taskcluster/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ task:
image: taskcluster/npm-cache:0.1.10

cache:
gaia-misc-caches: /home/tester/caches/
gaia-misc-caches: /home/worker/caches/

command:
- entrypoint
Expand Down
2 changes: 1 addition & 1 deletion tests/taskcluster/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ params:
provisionerId: 'aws-provisioner-v1'
workerType: gaia
# Location in image where we store the gaia contents.
gaia: '/home/tester/git_checkout'
gaia: '/home/worker/git_checkout'

# All task definitions
definitions:
Expand Down
2 changes: 1 addition & 1 deletion tests/taskcluster/tasks/build_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ task:

payload:
cache:
gaia-misc-caches: /home/tester/caches/
gaia-misc-caches: /home/worker/caches/

env:
REPORTER: 'mocha-tbpl-reporter'
Expand Down
2 changes: 1 addition & 1 deletion tests/taskcluster/tasks/build_unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ task:

payload:
cache:
gaia-misc-caches: /home/tester/caches/
gaia-misc-caches: /home/worker/caches/

env:
REPORTER: 'mocha-tbpl-reporter'
Expand Down
2 changes: 1 addition & 1 deletion tests/taskcluster/tasks/csslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ task:
NODE_MODULES_SRC: npm-cache

cache:
gaia-misc-caches: /home/tester/caches/
gaia-misc-caches: /home/worker/caches/

command:
- entrypoint
Expand Down
2 changes: 1 addition & 1 deletion tests/taskcluster/tasks/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ task:
NODE_MODULES_SRC: npm-cache

cache:
gaia-misc-caches: /home/tester/caches/
gaia-misc-caches: /home/worker/caches/

command:
- entrypoint
Expand Down
2 changes: 1 addition & 1 deletion tests/taskcluster/tasks/gaia_ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ task:

payload:
cache:
gaia-misc-caches: /home/tester/caches/
gaia-misc-caches: /home/worker/caches/
# See: ci/gaia_ui_tests/script for how this ties into the built in
# chunking functionality for the test scripts...
env:
Expand Down
2 changes: 1 addition & 1 deletion tests/taskcluster/tasks/jshint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ task:
env:
NODE_MODULES_SRC: npm-cache
cache:
gaia-misc-caches: /home/tester/caches/
gaia-misc-caches: /home/worker/caches/
command:
- entrypoint
- ./bin/ci run jshint
Expand Down
2 changes: 1 addition & 1 deletion tests/taskcluster/tasks/jsmarionette_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ task:

payload:
cache:
gaia-misc-caches: /home/tester/caches/
gaia-misc-caches: /home/worker/caches/

env:
REPORTER: 'mocha-tbpl-reporter'
Expand Down
2 changes: 1 addition & 1 deletion tests/taskcluster/tasks/jsonlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ task:
env:
NODE_MODULES_SRC: npm-cache
cache:
gaia-misc-caches: /home/tester/caches/
gaia-misc-caches: /home/worker/caches/
command:
- entrypoint
- ./bin/ci run jsonlint
Expand Down
8 changes: 1 addition & 7 deletions tests/taskcluster/tasks/marionette_js_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@ task:

workerType: '{{workerType}}'
provisionerId: '{{provisionerId}}'
scopes:
# Source caches contains various sources (including a tarball of gaia source
# tree)
- docker-worker:cache:gaia-misc-caches

payload:
maxRunTime: 7200
cache:
gaia-misc-caches: /home/tester/caches/

# Chunking logic is actually in the Makefile here which may make it
# confusing to figure out who calls what this should be improved.
env:
Expand Down
2 changes: 1 addition & 1 deletion tests/taskcluster/tasks/marionette_js_tv_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ task:
payload:
maxRunTime: 7200
cache:
gaia-misc-caches: /home/tester/caches/
gaia-misc-caches: /home/worker/caches/
# Chunking logic is actually in the Makefile here which may make it
# confusing to figure out who calls what this should be improved.
env:
Expand Down
2 changes: 1 addition & 1 deletion tests/taskcluster/tasks/unit_tests_b2g.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ task:

payload:
cache:
gaia-misc-caches: /home/tester/caches/
gaia-misc-caches: /home/worker/caches/

# Chunking logic is handled in ci/unit-tests-in-b2g/script
env:
Expand Down

0 comments on commit 4bf0cf9

Please sign in to comment.