From 7043587cd490a7dbc8dcbdacf1f33cea075a6240 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Mon, 8 Aug 2016 13:38:06 -0700 Subject: [PATCH] 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 --- testing/docker/centos6-build/Dockerfile | 6 ++++++ testing/docker/desktop-build/Dockerfile | 5 +++++ testing/docker/desktop-test/Dockerfile | 5 +++++ testing/docker/desktop1604-test/Dockerfile | 5 +++++ 4 files changed, 21 insertions(+) diff --git a/testing/docker/centos6-build/Dockerfile b/testing/docker/centos6-build/Dockerfile index 5d384c3f77fc..9e7ce405dd8d 100644 --- a/testing/docker/centos6-build/Dockerfile +++ b/testing/docker/centos6-build/Dockerfile @@ -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 diff --git a/testing/docker/desktop-build/Dockerfile b/testing/docker/desktop-build/Dockerfile index e93065da6c91..96c1b66a79df 100644 --- a/testing/docker/desktop-build/Dockerfile +++ b/testing/docker/desktop-build/Dockerfile @@ -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 +# 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 diff --git a/testing/docker/desktop-test/Dockerfile b/testing/docker/desktop-test/Dockerfile index 76873e025901..b73dcd5f1680 100644 --- a/testing/docker/desktop-test/Dockerfile +++ b/testing/docker/desktop-test/Dockerfile @@ -1,6 +1,11 @@ FROM taskcluster/ubuntu1204-test-upd:0.1.11.20160628204600 MAINTAINER Jonas Finnemann Jensen +# 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 diff --git a/testing/docker/desktop1604-test/Dockerfile b/testing/docker/desktop1604-test/Dockerfile index b6eae86c7855..1ea457f8889b 100644 --- a/testing/docker/desktop1604-test/Dockerfile +++ b/testing/docker/desktop1604-test/Dockerfile @@ -1,6 +1,11 @@ FROM taskcluster/ubuntu1604-test:0.1.3 MAINTAINER Joel Maher +# 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