Bug 1293395 - Declare Docker volumes for cache paths; r=dustin

As bug 1291940 shows, aufs can be a real performance drag.

Most performance critical paths in containers are caches. This allows
the use of the host filesystem (instead of aufs), which is much faster
under load.

Unfortunately, most caches are stripped on Try. This means paths that
would be served from the fast host filesystem are now being handled
by aufs. This can make Try jobs slower than non-Try jobs.

This commit declares Docker volumes for popular cache paths. If the
cache is present, the cache takes precedence over the declared volume.
If the cache isn't present, Docker falls back to an empty volume that's
used for the task and only the task.

It's worth noting that desktop-build is updated redundantly with
centos6-build. We currently can't rebuild centos6-build because of
a determinism issue (bug 1272629) breaking valgrind. So, I work around
this by declaring the volume in the top-most "desktop-build" layer.
This hack can be removed once we merge the images.

MozReview-Commit-ID: 7JtxAfI7ED5

--HG--
extra : rebase_source : aec1675c3393d767f5d10130553148155190f19d
This commit is contained in:
Gregory Szorc 2016-08-08 13:38:06 -07:00
parent 77a19465e3
commit 7043587cd4
4 changed files with 21 additions and 0 deletions

View File

@ -6,6 +6,12 @@ RUN useradd -d /home/worker -s /bin/bash -m worker
# Declare default working folder
WORKDIR /home/worker
# This will create a host mounted filesystem when the cache is stripped
# on Try. This cancels out some of the performance losses of aufs. See
# bug 1291940.
VOLUME /home/worker/workspace
VOLUME /home/worker/tooltool-cache
# install non-build specific dependencies in a single layer
ADD system-setup.sh /tmp/system-setup.sh
RUN bash /tmp/system-setup.sh

View File

@ -1,6 +1,11 @@
# TODO remove VOLUME below when the base image is updated next.
FROM taskcluster/centos6-build-upd:0.1.6.20160329195300
MAINTAINER Dustin J. Mitchell <dustin@mozilla.com>
# TODO remove when base image is updated
VOLUME /home/worker/workspace
VOLUME /home/worker/tooltool-cache
# Add build scripts; these are the entry points from the taskcluster worker, and
# operate on environment variables
ADD bin /home/worker/bin

View File

@ -1,6 +1,11 @@
FROM taskcluster/ubuntu1204-test-upd:0.1.11.20160628204600
MAINTAINER Jonas Finnemann Jensen <jopsen@gmail.com>
# This will create a host mounted filesystem when the cache is stripped
# on Try. This cancels out some of the performance losses of aufs. See
# bug 1291940.
VOLUME /home/worker/workspace
# Add utilities and configuration
COPY dot-files/config /home/worker/.config
COPY dot-files/pulse /home/worker/.pulse

View File

@ -1,6 +1,11 @@
FROM taskcluster/ubuntu1604-test:0.1.3
MAINTAINER Joel Maher <joel.maher@gmail.com>
# This will create a host mounted filesystem when the cache is stripped
# on Try. This cancels out some of the performance losses of aufs. See
# bug 1291940.
VOLUME /home/worker/workspace
# Add utilities and configuration
COPY dot-files/config /home/worker/.config
COPY dot-files/pulse /home/worker/.pulse