Skip to content

Commit 3ead8cd

Browse files
authored
Fix potential travis failures due to network failures (#2795)
* Manually pull builder base image and let travis retry it on failure * Split base package installation in Dockerfile.builder into multiple RUN lines This allows better local cache usage on failure and retry. * Use travis_retry for docker build
1 parent 02db066 commit 3ead8cd

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ install:
5959
- ls -lah $HOST_CACHE_DIR && ls -lah $HOST_CACHE_DIR/depends && ls -lah $HOST_CACHE_DIR/ccache && ls -lah $HOST_CACHE_DIR/docker
6060
# Load cached builder image
6161
- if [ -f $HOST_CACHE_DIR/docker/dash-builder-$BUILD_TARGET.tar.gz ]; then zcat $HOST_CACHE_DIR/docker/dash-builder-$BUILD_TARGET.tar.gz | docker load || true; fi
62-
- docker build --pull -t $BUILDER_IMAGE_NAME --build-arg=USER_ID=$UID --build-arg=GROUP_ID=$UID --build-arg=BUILD_TARGET=$BUILD_TARGET -f ci/Dockerfile.builder ci
62+
- travis_retry docker pull ubuntu:bionic
63+
- travis_retry docker build -t $BUILDER_IMAGE_NAME --build-arg=USER_ID=$UID --build-arg=GROUP_ID=$UID --build-arg=BUILD_TARGET=$BUILD_TARGET -f ci/Dockerfile.builder ci
6364
before_script:
6465
# Make sure stdout is in blocking mode. Otherwise builds will fail due to large writes to stdout
6566
# See https://github.com/travis-ci/travis-ci/issues/4704. If this gets fixed, this line can also be removed.

ci/Dockerfile.builder

+10-13
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@ FROM ubuntu:bionic
22

33
# Build and base stuff
44
# (zlib1g-dev and libssl-dev are needed for the Qt host binary builds, but should not be used by target binaries)
5-
RUN apt-get update && apt-get install -y \
6-
git \
7-
g++ \
8-
autotools-dev libtool m4 automake autoconf pkg-config \
9-
zlib1g-dev \
10-
libssl1.0-dev \
11-
curl \
12-
ccache \
13-
bsdmainutils \
14-
python3-pip python3-dev \
15-
cmake \
16-
&& rm -rf /var/lib/apt/lists
5+
# We split this up into multiple RUN lines as we might need to retry multiple times on Travis. This way we allow better
6+
# cache usage.
7+
RUN apt-get update
8+
RUN apt-get update && apt-get install -y git
9+
RUN apt-get update && apt-get install -y g++
10+
RUN apt-get update && apt-get install -y autotools-dev libtool m4 automake autoconf pkg-config
11+
RUN apt-get update && apt-get install -y zlib1g-dev libssl1.0-dev curl ccache bsdmainutils cmake
12+
RUN apt-get update && apt-get install -y python3 python3-dev
13+
RUN apt-get update && apt-get install -y python3-pip
1714

1815
# Python stuff
1916
RUN pip3 install pyzmq # really needed?
@@ -36,7 +33,7 @@ ARG BUILD_TARGET=linux64
3633
ADD matrix.sh /tmp/matrix.sh
3734
RUN . /tmp/matrix.sh && \
3835
if [ -n "$DPKG_ADD_ARCH" ]; then dpkg --add-architecture "$DPKG_ADD_ARCH" ; fi && \
39-
if [ -n "$PACKAGES" ]; then apt-get update && apt-get install -y --no-install-recommends --no-upgrade $PACKAGES && rm -rf /var/lib/apt/lists; fi
36+
if [ -n "$PACKAGES" ]; then apt-get update && apt-get install -y --no-install-recommends --no-upgrade $PACKAGES; fi
4037

4138
# Make sure std::thread and friends is available
4239
# Will fail on non-win builds, but we ignore this

0 commit comments

Comments
 (0)