]> git.lizzy.rs Git - rust.git/commitdiff
Fix travis builds
authorAlex Crichton <alex@alexcrichton.com>
Tue, 13 Dec 2016 04:01:13 +0000 (20:01 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 13 Dec 2016 08:13:14 +0000 (00:13 -0800)
After reading some articles [1] [2] yesterday about Docker and the "init"
process I got to thinking about the problems that we've been seeing on Travis.
The basic problem is that a Linux system may need an "init" process to work
properly when processes become zombies. Docker by default doesn't handle this
and the root process typically isn't an init process, so this can occasionally
cause quite a few problems.

We've been seeing spurious errors on Travis inside containers which look like
OOM and such, but my guess is that zombie processes were being reparented to the
top-level shell. The shell didn't expect the zombies and then behaved very
strangely.

This commit fixes these problems by using Yelp's "dumb-init" program [2] as the
init process in all of our containers. This ensures that there's a valid init
ready to reap children when they're reparented, which our test suite apparently
generates a bunch of throughout the tests and such.

[1]: https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/
[2]: https://engineeringblog.yelp.com/2016/01/dumb-init-an-init-for-docker.html

12 files changed:
src/ci/docker/arm-android/Dockerfile
src/ci/docker/cross/Dockerfile
src/ci/docker/i686-gnu-nopt/Dockerfile
src/ci/docker/i686-gnu/Dockerfile
src/ci/docker/x86_64-freebsd/Dockerfile
src/ci/docker/x86_64-gnu-cargotest/Dockerfile
src/ci/docker/x86_64-gnu-debug/Dockerfile
src/ci/docker/x86_64-gnu-llvm-3.7/Dockerfile
src/ci/docker/x86_64-gnu-make/Dockerfile
src/ci/docker/x86_64-gnu-nopt/Dockerfile
src/ci/docker/x86_64-gnu/Dockerfile
src/ci/docker/x86_64-musl/Dockerfile

index 121c0263cbccb5f62b73a53a2f29257e75f4ebc7..5489fb7304d1c7d8b5b6335673dfa91312fc3b66 100644 (file)
@@ -25,8 +25,13 @@ COPY install-ndk.sh install-sdk.sh accept-licenses.sh /android/
 RUN sh /android/install-ndk.sh
 RUN sh /android/install-sdk.sh
 
+RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+    dpkg -i dumb-init_*.deb && \
+    rm dumb-init_*.deb
+
 COPY start-emulator.sh /android/
-ENTRYPOINT ["/android/start-emulator.sh"]
+
+ENTRYPOINT ["/usr/bin/dumb-init", "--", "/android/start-emulator.sh"]
 
 ENV TARGETS=arm-linux-androideabi
 ENV TARGETS=$TARGETS,i686-linux-android
index b7b23d74c9dadaa49c3345609dd8ee32b339c56b..eeb6c79d69bccee81d2dfffb7d6aa9d789e5690d 100644 (file)
@@ -23,6 +23,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
   gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross \
   gcc-s390x-linux-gnu libc6-dev-s390x-cross
 
+RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+    dpkg -i dumb-init_*.deb && \
+    rm dumb-init_*.deb
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+
 ENV TARGETS=aarch64-unknown-linux-gnu
 ENV TARGETS=$TARGETS,arm-unknown-linux-gnueabi
 ENV TARGETS=$TARGETS,arm-unknown-linux-gnueabihf
index a9ef29daaf1a18cd0bd46bc2666d5bc6462c5319..51161997e222708f45121db2644f336c05d4f072 100644 (file)
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
   sudo \
   gdb
 
+RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+    dpkg -i dumb-init_*.deb && \
+    rm dumb-init_*.deb
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+
 ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu --disable-optimize-tests
 ENV RUST_CHECK_TARGET check
 RUN mkdir /tmp/obj
index d0ddde95b447364f241f3f22caeff6be833ea087..1603d353275beaecdff7e73e2a2a76ebf839e67d 100644 (file)
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
   sudo \
   gdb
 
+RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+    dpkg -i dumb-init_*.deb && \
+    rm dumb-init_*.deb
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+
 ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu
 ENV RUST_CHECK_TARGET check
 RUN mkdir /tmp/obj
index a3a52f9e6ff95fcb8522993675a3b677c6d161ff..629cfbc3a9c6f1f8f1244dc4667ee543f30e70e2 100644 (file)
@@ -18,6 +18,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
 COPY build-toolchain.sh /tmp/
 RUN sh /tmp/build-toolchain.sh
 
+RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+    dpkg -i dumb-init_*.deb && \
+    rm dumb-init_*.deb
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+
 ENV \
     AR_x86_64_unknown_freebsd=x86_64-unknown-freebsd10-ar \
     CC_x86_64_unknown_freebsd=x86_64-unknown-freebsd10-gcc
index 107e2bf8a121e2bb92e6b949915f24fda341529a..78aa510ec04235821e640701e6c343ebe5ff701f 100644 (file)
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
   libssl-dev \
   sudo
 
+RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+    dpkg -i dumb-init_*.deb && \
+    rm dumb-init_*.deb
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+
 ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu
 ENV RUST_CHECK_TARGET check-cargotest
 ENV NO_VENDOR 1
index 9e98215775e51719c37ca28901a0581c2975d48a..7d00f11cbb800fa0c0920a4f64de2d087c972dc5 100644 (file)
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
   sudo \
   gdb
 
+RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+    dpkg -i dumb-init_*.deb && \
+    rm dumb-init_*.deb
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+
 ENV RUST_CONFIGURE_ARGS \
       --build=x86_64-unknown-linux-gnu \
       --enable-debug \
index c27e3d1325fe8570c7cbea4f7eb0b1edaeafabc8..95484c660e67c1d9ab08418cc6c846d3426649de 100644 (file)
@@ -16,6 +16,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
   libedit-dev \
   zlib1g-dev
 
+RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+    dpkg -i dumb-init_*.deb && \
+    rm dumb-init_*.deb
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+
 ENV RUST_CONFIGURE_ARGS \
       --build=x86_64-unknown-linux-gnu \
       --llvm-root=/usr/lib/llvm-3.7
index 93229b2a0103e91ade2b026cc4721714ea33d923..4a5c5b57ea7c402d5df486b101af4cc4ef49f0fa 100644 (file)
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
   sudo \
   gdb
 
+RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+    dpkg -i dumb-init_*.deb && \
+    rm dumb-init_*.deb
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+
 ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu --disable-rustbuild
 ENV RUST_CHECK_TARGET check
 RUN mkdir /tmp/obj
index 73a3e2c726cee601bfb2c16ab1fed5cd272d27bb..c2a5449d2e393f388890f4638b63eec365a20f6d 100644 (file)
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
   sudo \
   gdb
 
+RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+    dpkg -i dumb-init_*.deb && \
+    rm dumb-init_*.deb
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+
 ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu --disable-optimize-tests
 ENV RUST_CHECK_TARGET check
 RUN mkdir /tmp/obj
index f125693e7ae1a17468fa97e4e7a9eef1b0ae0c45..54bbc9b342150477ab63f6b8a32b4f55416bb0f0 100644 (file)
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
   sudo \
   gdb
 
+RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+    dpkg -i dumb-init_*.deb && \
+    rm dumb-init_*.deb
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+
 ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu
 ENV RUST_CHECK_TARGET check
 RUN mkdir /tmp/obj
index 967940fb1f3ae093b2caf604f9e2ac95d856816a..b3068cacd04641e9612619590bc96dce33cb459d 100644 (file)
@@ -18,6 +18,11 @@ WORKDIR /build/
 COPY build-musl.sh /build/
 RUN sh /build/build-musl.sh && rm -rf /build
 
+RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
+    dpkg -i dumb-init_*.deb && \
+    rm dumb-init_*.deb
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+
 ENV RUST_CONFIGURE_ARGS \
       --target=x86_64-unknown-linux-musl \
       --musl-root-x86_64=/musl-x86_64