Skip to content

Commit 5e991e0

Browse files
committed
Fix travis builds
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
1 parent b4b1e5e commit 5e991e0

File tree

12 files changed

+61
-1
lines changed

12 files changed

+61
-1
lines changed

src/ci/docker/arm-android/Dockerfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ COPY install-ndk.sh install-sdk.sh accept-licenses.sh /android/
2525
RUN sh /android/install-ndk.sh
2626
RUN sh /android/install-sdk.sh
2727

28+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
29+
dpkg -i dumb-init_*.deb && \
30+
rm dumb-init_*.deb
31+
2832
COPY start-emulator.sh /android/
29-
ENTRYPOINT ["/android/start-emulator.sh"]
33+
34+
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/android/start-emulator.sh"]
3035

3136
ENV TARGETS=arm-linux-androideabi
3237
ENV TARGETS=$TARGETS,i686-linux-android

src/ci/docker/cross/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2323
gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross \
2424
gcc-s390x-linux-gnu libc6-dev-s390x-cross
2525

26+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
27+
dpkg -i dumb-init_*.deb && \
28+
rm dumb-init_*.deb
29+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
30+
2631
ENV TARGETS=aarch64-unknown-linux-gnu
2732
ENV TARGETS=$TARGETS,arm-unknown-linux-gnueabi
2833
ENV TARGETS=$TARGETS,arm-unknown-linux-gnueabihf

src/ci/docker/i686-gnu-nopt/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313
sudo \
1414
gdb
1515

16+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
17+
dpkg -i dumb-init_*.deb && \
18+
rm dumb-init_*.deb
19+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
20+
1621
ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu --disable-optimize-tests
1722
ENV RUST_CHECK_TARGET check
1823
RUN mkdir /tmp/obj

src/ci/docker/i686-gnu/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313
sudo \
1414
gdb
1515

16+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
17+
dpkg -i dumb-init_*.deb && \
18+
rm dumb-init_*.deb
19+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
20+
1621
ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu
1722
ENV RUST_CHECK_TARGET check
1823
RUN mkdir /tmp/obj

src/ci/docker/x86_64-freebsd/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1818
COPY build-toolchain.sh /tmp/
1919
RUN sh /tmp/build-toolchain.sh
2020

21+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
22+
dpkg -i dumb-init_*.deb && \
23+
rm dumb-init_*.deb
24+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
25+
2126
ENV \
2227
AR_x86_64_unknown_freebsd=x86_64-unknown-freebsd10-ar \
2328
CC_x86_64_unknown_freebsd=x86_64-unknown-freebsd10-gcc

src/ci/docker/x86_64-gnu-cargotest/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313
libssl-dev \
1414
sudo
1515

16+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
17+
dpkg -i dumb-init_*.deb && \
18+
rm dumb-init_*.deb
19+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
20+
1621
ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu
1722
ENV RUST_CHECK_TARGET check-cargotest
1823
ENV NO_VENDOR 1

src/ci/docker/x86_64-gnu-debug/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313
sudo \
1414
gdb
1515

16+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
17+
dpkg -i dumb-init_*.deb && \
18+
rm dumb-init_*.deb
19+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
20+
1621
ENV RUST_CONFIGURE_ARGS \
1722
--build=x86_64-unknown-linux-gnu \
1823
--enable-debug \

src/ci/docker/x86_64-gnu-llvm-3.7/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1616
libedit-dev \
1717
zlib1g-dev
1818

19+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
20+
dpkg -i dumb-init_*.deb && \
21+
rm dumb-init_*.deb
22+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
23+
1924
ENV RUST_CONFIGURE_ARGS \
2025
--build=x86_64-unknown-linux-gnu \
2126
--llvm-root=/usr/lib/llvm-3.7

src/ci/docker/x86_64-gnu-make/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313
sudo \
1414
gdb
1515

16+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
17+
dpkg -i dumb-init_*.deb && \
18+
rm dumb-init_*.deb
19+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
20+
1621
ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu --disable-rustbuild
1722
ENV RUST_CHECK_TARGET check
1823
RUN mkdir /tmp/obj

src/ci/docker/x86_64-gnu-nopt/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313
sudo \
1414
gdb
1515

16+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
17+
dpkg -i dumb-init_*.deb && \
18+
rm dumb-init_*.deb
19+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
20+
1621
ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu --disable-optimize-tests
1722
ENV RUST_CHECK_TARGET check
1823
RUN mkdir /tmp/obj

src/ci/docker/x86_64-gnu/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313
sudo \
1414
gdb
1515

16+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
17+
dpkg -i dumb-init_*.deb && \
18+
rm dumb-init_*.deb
19+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
20+
1621
ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu
1722
ENV RUST_CHECK_TARGET check
1823
RUN mkdir /tmp/obj

src/ci/docker/x86_64-musl/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ WORKDIR /build/
1818
COPY build-musl.sh /build/
1919
RUN sh /build/build-musl.sh && rm -rf /build
2020

21+
RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
22+
dpkg -i dumb-init_*.deb && \
23+
rm dumb-init_*.deb
24+
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
25+
2126
ENV RUST_CONFIGURE_ARGS \
2227
--target=x86_64-unknown-linux-musl \
2328
--musl-root-x86_64=/musl-x86_64

0 commit comments

Comments
 (0)