Skip to content

Commit

Permalink
Merge pull request mozilla#14 from gregarndt/linux64-mulet_build
Browse files Browse the repository at this point in the history
Linux64 mulet build
  • Loading branch information
lightsofapollo committed Nov 5, 2014
2 parents 66824a1 + 07a77e4 commit e8f7603
Show file tree
Hide file tree
Showing 14 changed files with 156 additions and 18 deletions.
17 changes: 8 additions & 9 deletions testing/docker/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ FROM quay.io/mozilla/base:0.0.2
MAINTAINER Jonas Finnemann Jensen <jopsen@gmail.com>

ENV PATH $PATH:/home/worker/bin/
ENV TOOLTOOL_CACHE /home/worker/tools/tooltool-cache

# Add utilities and configuration
RUN mkdir -p /home/worker/bin
ADD build.sh /home/worker/bin/build.sh
ADD build-b2g-desktop.sh /home/worker/bin/build-b2g-desktop.sh
ADD get-objdir.py /home/worker/bin/get-objdir.py
ADD get_gaia_repo.js /home/worker/bin/get_gaia_repo.js
ADD get_gaia_revision.js /home/worker/bin/get_gaia_revision.js
ADD build-setup.sh /home/worker/bin/build-setup.sh
RUN chown -R worker:worker /home/worker/
ADD system-setup.sh /tmp/system-setup.sh
ADD bin /home/worker/bin
RUN /tmp/system-setup.sh

USER worker
# TODO enable worker
# TODO volume mount permissions will be an issue
# USER worker

# Set a default command useful for debugging
CMD ["/bin/bash", "--login"]

2 changes: 1 addition & 1 deletion testing/docker/builder/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.14
0.0.16
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ cd $gecko_dir
hg pull -r $REVISION $REPOSITORY;
hg update $REVISION;

### Retrieve and install latest tooltool manifest
tooltool=/home/worker/tools/tooltool.py
manifest=b2g/config/tooltool-manifests/linux64/releng.manifest
tooltool_url=http://tooltool.pub.build.mozilla.org/temp-sm-stuff

python $tooltool --url $tooltool_url --overwrite -m $manifest fetch -c $TOOLTOOL_CACHE
chmod +x setup.sh
./setup.sh

### Clone gaia
if [ ! -d "$gaia_dir" ]; then
create_parent_dir $gaia_dir
hg clone https://hg.mozilla.org/integration/gaia-central/ $gaia_dir
fi

### Pull and update gaia
cd $gaia_dir
GAIA_REV=$(get_gaia_revision.js)
Expand Down
53 changes: 53 additions & 0 deletions testing/docker/builder/bin/build-mulet-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash -live

################################### build-mulet-linux.sh ###################################

. build-setup.sh

### Check that require variables are defined
test $REPOSITORY # Should be an hg repository url to pull from
test $REVISION # Should be an hg revision to pull down
test $MOZCONFIG # Should be a mozconfig file from mozconfig/ folder

### Pull and update mozilla-central
cd $gecko_dir
hg pull -r $REVISION $REPOSITORY;
hg update $REVISION;

### Retrieve and install latest tooltool manifest
tooltool=/home/worker/tools/tooltool.py
manifest=browser/config/tooltool-manifests/linux64/releng.manifest
tooltool_url=http://tooltool.pub.build.mozilla.org/temp-sm-stuff

python $tooltool --url $tooltool_url --overwrite -m $manifest fetch -c $TOOLTOOL_CACHE
chmod +x setup.sh
./setup.sh

export MOZ_OBJDIR=$(get-objdir.py $gecko_dir)

./mach build;

### Make package
cd $MOZ_OBJDIR;
make package package-tests;

### Extract artifacts
# Navigate to dist/ folder
cd $MOZ_OBJDIR/dist;

ls -lah $MOZ_OBJDIR/dist/


# Target names are cached so make sure we discard them first if found.
rm -f target.linux-x86_64.tar.bz2 target.linux-x86_64.json target.tests.zip

# Artifacts folder is outside of the cache.
mkdir -p /home/worker/artifacts/

# Discard version numbers from packaged files, they just make it hard to write
# the right filename in the task payload where artifacts are declared
mv *.linux-x86_64.tar.bz2 /home/worker/artifacts/target.linux-x86_64.tar.bz2
mv *.linux-x86_64.json /home/worker/artifacts/target.linux-x86_64.json
mv *.tests.zip /home/worker/artifacts/target.tests.zip

################################### build.sh ###################################
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,3 @@ mkdir -p /home/worker/.mozbuild/

# Create object-folder exists
mkdir -p /home/worker/object-folder/

### Clone gaia in too
if [ ! -d "$gaia_dir" ]; then
create_parent_dir $gaia_dir
hg clone https://hg.mozilla.org/integration/gaia-central/ $gaia_dir
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions testing/docker/builder/system-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash -ve

############################### system-setup.sh ###############################

home="/home/worker"

mkdir -p $home/bin
mkdir -p $home/tools
mkdir -p $home/tools/tooltool-cache

wget -O $home/tools/tooltool.py https://raw.githubusercontent.com/mozilla/build-tooltool/master/tooltool.py

chown -R worker:worker /home/worker/* /home/worker/.*

# Remove the setup.sh setup, we don't really need this script anymore, deleting
# it keeps the image as clean as possible.
rm $0; echo "Deleted $0";

7 changes: 7 additions & 0 deletions testing/taskcluster/job_flags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ flags:
- linux64_gecko # b2g desktop linux 64 bit
- macosx64_gecko # b2g desktop osx 64 bit
- win32_gecko # b2g desktop win 32 bit
- linux64-mulet # Firefox desktop - b2g gecko linux 64 bit

tests:
- reftest
Expand Down Expand Up @@ -55,6 +56,11 @@ builds:
types:
opt: tasks/builds/b2g_desktop.yml
debug: tasks/builds/b2g_desktop_debug.yml
linux64-mulet:
platforms:
- Mulet Linux
types:
opt: tasks/builds/mulet_linux.yml

# Test section covers the -u options in the try flags
tests:
Expand All @@ -74,5 +80,6 @@ tests:
allowed_build_tasks:
- tasks/builds/b2g_desktop.yml
- tasks/builds/b2g_desktop_debug.yml
- tasks/builds/mulet_linux.yml
task: tasks/tests/b2g_mochitest.yml
chunks: 5
2 changes: 1 addition & 1 deletion testing/taskcluster/tasks/builds/b2g_desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ task:
maxRunTime: 3600

command:
- build-b2g-desktop.sh
- bin/build-b2g-desktop.sh

artifacts:
'public/build':
Expand Down
2 changes: 1 addition & 1 deletion testing/taskcluster/tasks/builds/b2g_desktop_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ task:
maxRunTime: 3600

command:
- build-b2g-desktop.sh
- bin/build-b2g-desktop.sh

artifacts:
'public/build':
Expand Down
52 changes: 52 additions & 0 deletions testing/taskcluster/tasks/builds/mulet_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
taskId: {{build_slugid}}
task:
created: '{{now}}'
deadline: '{{#from_now}}24 hours{{/from_now}}'
metadata:
source: http://todo.com/soon
owner: {{owner}}
name: Mulet Linux x64 Opt
description: Mulet Linux x64 Opt

workerType: b2gbuild
provisionerId: aws-provisioner

scopes:
- 'docker-worker:cache:sources-mozilla-central'
- 'docker-worker:cache:build-mulet-linux-objects'
- 'docker-worker:cache:tooltool-cache'

payload:
cache:
sources-mozilla-central: '/home/worker/mozilla-central'
build-mulet-linux-objects: '/home/worker/object-folder'
tooltool-cache: '/home/worker/tools/tooltool-cache'

env:
MOZCONFIG: 'b2g/dev/config/mozconfigs/linux64/mulet'
# revision/project params defined originally here https://github.com/taskcluster/taskcluster-try/blob/master/try/instantiate.js
REVISION: '{{revision}}'
REPOSITORY: '{{repository}}'

image: '{{#docker_image}}builder{{/docker_image}}'
maxRunTime: 3600

command:
- bin/build-mulet-linux.sh

artifacts:
'public/build':
type: directory
path: '/home/worker/artifacts/'
expires: '{{#from_now}}1 year{{/from_now}}'

extra:
# Rather then enforcing particular conventions we require that all build
# tasks provide the "build" extra field to specify where the build and tests
# files are located.
locations:
build: 'public/build/target.linux-x86_64.tar.bz2'
tests: 'public/build/target.tests.zip'

treeherder:
symbol: B

0 comments on commit e8f7603

Please sign in to comment.