bug 1398799: make the update verify docker image support run-task. r=aki

--HG--
extra : amend_source : 9cfbf429c7078dd004a713ff6c6120a7b6a212cf
This commit is contained in:
Ben Hearsum 2018-02-07 14:50:46 -05:00
parent 3403f15207
commit 35948d295c
3 changed files with 158 additions and 3 deletions

View File

@ -0,0 +1,5 @@
%include build/sparse-profiles/mach
[include]
path:build/mozrelease
path:testing/mozharness

View File

@ -1,11 +1,61 @@
FROM python:2-slim-stretch
FROM ubuntu:16.04
MAINTAINER release@mozilla.com
RUN dpkg --add-architecture i386 && apt-get -q update \
# p7zip-full is for extracting Windows and OS X packages
# Mercurial is for cloning required repositories
# wget is for downloading update.xml, installers, and MARs
# libgtk-3-0 and libgtk2.0-0 are required to run the Firefox updater
&& apt-get -q --yes install p7zip-full mercurial wget libgtk-3-0 libgtk-3.0:i386 libgtk2.0-0 libgtk2.0-0:i386 \
&& apt-get -q --yes install p7zip-full wget libgtk-3-0 libgtk-3.0:i386 libgtk2.0-0 libgtk2.0-0:i386 \
&& apt-get clean
RUN mkdir /builds
RUN groupadd -g 500 worker
RUN useradd -u 500 -g 500 -d /builds/worker -s /bin/bash -m worker
WORKDIR /builds/worker
VOLUME /builds/worker/.cache
VOLUME /builds/worker/checkouts
RUN mkdir /build
# %include python/mozbuild/mozbuild/action/tooltool.py
ADD topsrcdir/python/mozbuild/mozbuild/action/tooltool.py /build/tooltool.py
# %include testing/mozharness/external_tools/robustcheckout.py
ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py
# %include taskcluster/docker/recipes/hgrc
COPY topsrcdir/taskcluster/docker/recipes/hgrc /etc/mercurial/hgrc.d/mozilla.rc
# %include taskcluster/docker/recipes/install-node.sh
ADD topsrcdir/taskcluster/docker/recipes/install-node.sh /build/install-node.sh
# %include taskcluster/docker/recipes/install-mercurial.sh
ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /build/install-mercurial.sh
ADD system-setup.sh /tmp/system-setup.sh
# %include tools/lint/eslint/manifest.tt
ADD topsrcdir/tools/lint/eslint/manifest.tt /tmp/eslint.tt
# %include tools/lint/eslint/eslint-plugin-mozilla/manifest.tt
ADD topsrcdir/tools/lint/eslint/eslint-plugin-mozilla/manifest.tt /tmp/eslint-plugin-mozilla.tt
# %include tools/lint/python/flake8_requirements.txt
ADD topsrcdir/tools/lint/python/flake8_requirements.txt /tmp/flake8_requirements.txt
# %include tools/lint/tox/tox_requirements.txt
ADD topsrcdir/tools/lint/tox/tox_requirements.txt /tmp/tox_requirements.txt
RUN bash /tmp/system-setup.sh
# %include taskcluster/docker/recipes/run-task
ADD topsrcdir/taskcluster/docker/recipes/run-task /builds/worker/bin/run-task
RUN chown -R worker:worker /builds/worker/bin && chmod 755 /builds/worker/bin/*
# Set variable normally configured at login, by the shells parent process, these
# are taken from GNU su manual
ENV HOME /builds/worker
ENV SHELL /bin/bash
ENV USER worker
ENV LOGNAME worker
ENV HOSTNAME taskcluster-worker
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
# Set a default command useful for debugging
CMD ["/bin/bash", "--login"]

View File

@ -0,0 +1,100 @@
#!/usr/bin/env bash
# This allows ubuntu-desktop to be installed without human interaction
export DEBIAN_FRONTEND=noninteractive
set -ve
test "$(whoami)" == 'root'
mkdir -p /setup
cd /setup
apt_packages=()
apt_packages+=('codespell')
apt_packages+=('curl')
apt_packages+=('locales')
apt_packages+=('git')
apt_packages+=('python')
apt_packages+=('python-pip')
apt_packages+=('python3')
apt_packages+=('python3-pip')
apt_packages+=('shellcheck')
apt_packages+=('sudo')
apt_packages+=('wget')
apt_packages+=('xz-utils')
apt-get update
apt-get install -y "${apt_packages[@]}"
# Without this we get spurious "LC_ALL: cannot change locale (en_US.UTF-8)" errors,
# and python scripts raise UnicodeEncodeError when trying to print unicode characters.
locale-gen en_US.UTF-8
dpkg-reconfigure locales
su -c 'git config --global user.email "worker@mozilla.test"' worker
su -c 'git config --global user.name "worker"' worker
tooltool_fetch() {
cat >manifest.tt
/build/tooltool.py fetch
rm manifest.tt
}
cd /build
# shellcheck disable=SC1091
. install-mercurial.sh
###
# ESLint Setup
###
# install node
# shellcheck disable=SC1091
. install-node.sh
###
# jsdoc Setup
###
npm install -g jsdoc@3.5.5
/build/tooltool.py fetch -m /tmp/eslint.tt
mv /build/node_modules /build/node_modules_eslint
/build/tooltool.py fetch -m /tmp/eslint-plugin-mozilla.tt
mv /build/node_modules /build/node_modules_eslint-plugin-mozilla
###
# fzf setup
###
tooltool_fetch <<EOF
[
{
"size": 866160,
"digest": "9f0ef6bf44b8622bd0e4e8b0b5b5c714c0a2ce4487e6f234e7d4caac458164c521949f4d84b8296274e8bd20966f835e26f6492ba499405d38b620181e82429e",
"algorithm": "sha512",
"filename": "fzf-0.16.11-linux_amd64.tgz",
"unpack": true
}
]
EOF
mv fzf /usr/local/bin
###
# Flake8 Setup
###
cd /setup
pip install --require-hashes -r /tmp/flake8_requirements.txt
###
# tox Setup
###
cd /setup
pip install --require-hashes -r /tmp/tox_requirements.txt
cd /
rm -rf /setup