diff options
Diffstat (limited to '')
13 files changed, 304 insertions, 0 deletions
diff --git a/taskcluster/docker/debian10-test-iris/Dockerfile b/taskcluster/docker/debian10-test-iris/Dockerfile new file mode 100644 index 0000000000..ef8ec5df77 --- /dev/null +++ b/taskcluster/docker/debian10-test-iris/Dockerfile @@ -0,0 +1,28 @@ +FROM $DOCKER_IMAGE_PARENT +MAINTAINER Wes Kocher <wkocher@mozilla.com> + +RUN mkdir -p /builds +RUN id worker || useradd -d /builds/worker -s /bin/bash -m worker +WORKDIR /builds/worker + +# We need to declare all potentially cache volumes as caches. Also, +# making high I/O paths volumes increase I/O throughput because of +# AUFS slowness. +VOLUME /builds/worker/.cache +VOLUME /builds/worker/checkouts +VOLUME /builds/worker/tooltool-cache +VOLUME /builds/worker/workspace + +# %include taskcluster/docker/debian10-test-iris/install_iris_deps.sh +ADD topsrcdir/taskcluster/docker/debian10-test-iris/install_iris_deps.sh /setup/install_iris_deps.sh +RUN bash /setup/install_iris_deps.sh + +# Set up first-run experience for interactive mode +ADD motd /etc/taskcluster-motd +ADD taskcluster-interactive-shell /bin/taskcluster-interactive-shell +RUN chmod +x /bin/taskcluster-interactive-shell + +RUN chown -R worker:worker /builds/worker + +# Set a default command useful for debugging +CMD ["/bin/bash", "--login"] diff --git a/taskcluster/docker/debian10-test-iris/install_iris_deps.sh b/taskcluster/docker/debian10-test-iris/install_iris_deps.sh new file mode 100755 index 0000000000..c1b7152c06 --- /dev/null +++ b/taskcluster/docker/debian10-test-iris/install_iris_deps.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# This script installs and configures everything the iris +# testing suite requires. +#!/usr/bin/env bash + +set -ve + +apt_packages=() + +apt_packages+=('apt-utils') +apt_packages+=('autoconf') +apt_packages+=('autoconf-archive') +apt_packages+=('automake') +apt_packages+=('fluxbox') +apt_packages+=('libcairo2-dev') +apt_packages+=('libgtk2.0-dev') +apt_packages+=('libicu-dev') +apt_packages+=('libjpeg62-turbo-dev') +apt_packages+=('libopencv-contrib-dev') +apt_packages+=('libopencv-dev') +apt_packages+=('libopencv-objdetect-dev') +apt_packages+=('libopencv-superres-dev') +apt_packages+=('libopencv-videostab-dev') +apt_packages+=('libpango1.0-dev') +apt_packages+=('libpng-dev') +apt_packages+=('libpng16-16') +apt_packages+=('libtiff5-dev') +apt_packages+=('libtool') +apt_packages+=('p7zip-full') +apt_packages+=('pkg-config') +apt_packages+=('python3.7-tk') +apt_packages+=('python3.7-dev') +apt_packages+=('python3-pip') +apt_packages+=('scrot') +apt_packages+=('wmctrl') +apt_packages+=('xdotool') +apt_packages+=('xsel') +apt_packages+=('zlib1g-dev') + +apt-get update +# This allows packages to be installed without human interaction +export DEBIAN_FRONTEND=noninteractive +apt-get install -y -f "${apt_packages[@]}" + +python3.7 -m pip install pipenv +python3.7 -m pip install psutil +python3.7 -m pip install zstandard + +mkdir -p /setup +cd /setup + +wget http://www.leptonica.org/source/leptonica-1.76.0.tar.gz +tar xopf leptonica-1.76.0.tar.gz +cd leptonica-1.76.0 +./configure && make && make install + +cd /setup +wget https://github.com/tesseract-ocr/tesseract/archive/4.0.0.tar.gz +tar xopf 4.0.0.tar.gz +cd tesseract-4.0.0 +./autogen.sh &&\ +./configure --enable-debug &&\ +LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make &&\ +make install &&\ +make install -langs &&\ +ldconfig + +cd /setup +wget https://github.com/tesseract-ocr/tessdata/archive/4.0.0.zip +unzip 4.0.0.zip +cd tessdata-4.0.0 +ls /usr/local/share/tessdata/ +mv ./* /usr/local/share/tessdata/ + + +cd / +rm -rf /setup +rm -rf ~/.ccache + +ls ~/.cache + +rm -rf ~/.npm + +apt-get clean +apt-get autoclean +rm -f "$0" diff --git a/taskcluster/docker/debian10-test-iris/motd b/taskcluster/docker/debian10-test-iris/motd new file mode 100644 index 0000000000..35017be2a2 --- /dev/null +++ b/taskcluster/docker/debian10-test-iris/motd @@ -0,0 +1,5 @@ +Welcome to your taskcluster interactive shell! The regularly scheduled task +has been paused to give you a chance to set up your debugging environment. + +For your convenience, the exact mozharness command needed for this task can +be invoked using the 'run-mozharness' command. diff --git a/taskcluster/docker/debian10-test-iris/taskcluster-interactive-shell b/taskcluster/docker/debian10-test-iris/taskcluster-interactive-shell new file mode 100644 index 0000000000..c782c0ea96 --- /dev/null +++ b/taskcluster/docker/debian10-test-iris/taskcluster-interactive-shell @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +download() { + name=`basename $1` + url=${GECKO_HEAD_REPOSITORY}/raw-file/${GECKO_HEAD_REV}/$1 + if ! curl --fail --silent -o ./$name --retry 10 $url; then + fail "failed downloading $1 from ${GECKO_HEAD_REPOSITORY}" + fi +} + +cd $HOME/bin; +download taskcluster/scripts/tester/run-wizard; +chmod +x run-wizard; +./run-wizard; + +SPAWN="$SHELL"; +if [ "$SHELL" = "bash" ]; then + SPAWN="bash -li"; +fi; + +cd $HOME; +exec $SPAWN; diff --git a/taskcluster/docker/debian10-test/Dockerfile b/taskcluster/docker/debian10-test/Dockerfile new file mode 100644 index 0000000000..fd114aec95 --- /dev/null +++ b/taskcluster/docker/debian10-test/Dockerfile @@ -0,0 +1,106 @@ +FROM debian:buster +MAINTAINER Edwin Takahashi <egao@mozilla.com> + +RUN mkdir -p /builds +RUN id worker || useradd -d /builds/worker -s /bin/bash -m worker +WORKDIR /builds/worker + +# We need to declare all potentially cache volumes as caches. Also, +# making high I/O paths volumes increase I/O throughput because of +# AUFS slowness. +VOLUME /builds/worker/.cache +VOLUME /builds/worker/checkouts +VOLUME /builds/worker/tooltool-cache +VOLUME /builds/worker/workspace + +# %include python/mozbuild/mozbuild/action/tooltool.py +ADD topsrcdir/python/mozbuild/mozbuild/action/tooltool.py /setup/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/common.sh +ADD topsrcdir/taskcluster/docker/recipes/common.sh /setup/common.sh + +# %include taskcluster/docker/recipes/install-mercurial.sh +ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh + +# %include taskcluster/docker/recipes/install-node.sh +ADD topsrcdir/taskcluster/docker/recipes/install-node.sh /setup/install-node.sh + +# %include taskcluster/docker/recipes/debian-test-system-setup.sh +ADD topsrcdir/taskcluster/docker/recipes/debian-test-system-setup.sh /setup/system-setup.sh +RUN bash /setup/system-setup.sh + +# Add wrapper scripts for xvfb allowing tasks to easily retry starting up xvfb +# %include taskcluster/docker/recipes/xvfb.sh +ADD topsrcdir/taskcluster/docker/recipes/xvfb.sh /builds/worker/scripts/xvfb.sh + +# %include taskcluster/scripts/run-task +ADD topsrcdir/taskcluster/scripts/run-task /builds/worker/bin/run-task + +# %include taskcluster/scripts/misc/fetch-content +ADD topsrcdir/taskcluster/scripts/misc/fetch-content /builds/worker/bin/fetch-content + +ADD topsrcdir/python/mozbuild/mozbuild/action/tooltool.py /builds/worker/scripts/tooltool.py + +# Locale related setup for debian:buster +RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment +RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen +RUN echo "LANG=en_US.UTF-8" > /etc/locale.conf +RUN locale-gen en_US.UTF-8 + +# 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 + +# Add utilities and configuration +COPY dot-files/config /builds/worker/.config +COPY dot-files/pulse /builds/worker/.pulse +RUN chmod +x bin/* + +# allow the worker user to access video devices +RUN usermod -a -G video worker + +RUN mkdir -p artifacts + +ENV PATH $PATH:/builds/worker/bin + +# In test.sh we accept START_VNC to start a vnc daemon. +# Exposing this port allows it to work. +EXPOSE 5900 + +# This helps not forgetting setting DISPLAY=:0 when running +# tests outside of test.sh +ENV DISPLAY :0 + +# Disable apport (app crash reporter) to avoid stealing focus from test runs +ADD apport /etc/default/apport + +# Disable font antialiasing for now to match releng's setup +ADD fonts.conf /builds/worker/.fonts.conf + +# Set up first-run experience for interactive mode +ADD motd /etc/taskcluster-motd +ADD taskcluster-interactive-shell /bin/taskcluster-interactive-shell +RUN chmod +x /bin/taskcluster-interactive-shell + +RUN chown -R worker:worker /builds/worker + +# gnome-keyring-daemon is configured to have the IPC_LOCK capability (to lock pages with secrets in +# memory), but docker isn't run with that capability granted. So, if we were to try running +# gnome-keyring-daemon without first clearing the capability, it would just exit with the message +# "Operation not permitted". Luckily it doesn't actually require the capability. +RUN setcap -r /usr/bin/gnome-keyring-daemon + +# Set a default command useful for debugging +CMD ["/bin/bash", "--login"] diff --git a/taskcluster/docker/debian10-test/apport b/taskcluster/docker/debian10-test/apport new file mode 100644 index 0000000000..42e5f8d3a1 --- /dev/null +++ b/taskcluster/docker/debian10-test/apport @@ -0,0 +1 @@ +enabled=0 diff --git a/taskcluster/docker/debian10-test/dot-files/config/pip/pip.conf b/taskcluster/docker/debian10-test/dot-files/config/pip/pip.conf new file mode 100644 index 0000000000..73c2b2a52c --- /dev/null +++ b/taskcluster/docker/debian10-test/dot-files/config/pip/pip.conf @@ -0,0 +1,2 @@ +[global] +disable-pip-version-check = true diff --git a/taskcluster/docker/debian10-test/dot-files/config/user-dirs.dirs b/taskcluster/docker/debian10-test/dot-files/config/user-dirs.dirs new file mode 100644 index 0000000000..2db2718d24 --- /dev/null +++ b/taskcluster/docker/debian10-test/dot-files/config/user-dirs.dirs @@ -0,0 +1,15 @@ +# This file is written by xdg-user-dirs-update +# If you want to change or add directories, just edit the line you're +# interested in. All local changes will be retained on the next run +# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped +# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an +# absolute path. No other format is supported. + +XDG_DESKTOP_DIR="$HOME/Desktop" +XDG_DOWNLOAD_DIR="$HOME/Downloads" +XDG_TEMPLATES_DIR="$HOME/Templates" +XDG_PUBLICSHARE_DIR="$HOME/Public" +XDG_DOCUMENTS_DIR="$HOME/Documents" +XDG_MUSIC_DIR="$HOME/Music" +XDG_PICTURES_DIR="$HOME/Pictures" +XDG_VIDEOS_DIR="$HOME/Videos" diff --git a/taskcluster/docker/debian10-test/dot-files/config/user-dirs.locale b/taskcluster/docker/debian10-test/dot-files/config/user-dirs.locale new file mode 100644 index 0000000000..7741b83a3e --- /dev/null +++ b/taskcluster/docker/debian10-test/dot-files/config/user-dirs.locale @@ -0,0 +1 @@ +en_US diff --git a/taskcluster/docker/debian10-test/dot-files/pulse/client.conf b/taskcluster/docker/debian10-test/dot-files/pulse/client.conf new file mode 100644 index 0000000000..4b2dab2a66 --- /dev/null +++ b/taskcluster/docker/debian10-test/dot-files/pulse/client.conf @@ -0,0 +1 @@ +autospawn = no
\ No newline at end of file diff --git a/taskcluster/docker/debian10-test/fonts.conf b/taskcluster/docker/debian10-test/fonts.conf new file mode 100644 index 0000000000..9784fcc981 --- /dev/null +++ b/taskcluster/docker/debian10-test/fonts.conf @@ -0,0 +1,5 @@ +<match target="font"> + <edit name="antialias" mode="assign"> + <bool>false</bool> + </edit> +</match> diff --git a/taskcluster/docker/debian10-test/motd b/taskcluster/docker/debian10-test/motd new file mode 100644 index 0000000000..f958393cd8 --- /dev/null +++ b/taskcluster/docker/debian10-test/motd @@ -0,0 +1,6 @@ +Welcome to your taskcluster interactive shell! The regularly scheduled task +has been paused to give you a chance to set up your debugging environment. + +For your convenience, the exact mozharness command needed for this task can +be invoked using the 'run-mozharness' command. + diff --git a/taskcluster/docker/debian10-test/taskcluster-interactive-shell b/taskcluster/docker/debian10-test/taskcluster-interactive-shell new file mode 100644 index 0000000000..c782c0ea96 --- /dev/null +++ b/taskcluster/docker/debian10-test/taskcluster-interactive-shell @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +download() { + name=`basename $1` + url=${GECKO_HEAD_REPOSITORY}/raw-file/${GECKO_HEAD_REV}/$1 + if ! curl --fail --silent -o ./$name --retry 10 $url; then + fail "failed downloading $1 from ${GECKO_HEAD_REPOSITORY}" + fi +} + +cd $HOME/bin; +download taskcluster/scripts/tester/run-wizard; +chmod +x run-wizard; +./run-wizard; + +SPAWN="$SHELL"; +if [ "$SHELL" = "bash" ]; then + SPAWN="bash -li"; +fi; + +cd $HOME; +exec $SPAWN; |