You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by mc...@apache.org on 2022/11/08 12:05:56 UTC

[cassandra-builds] branch trunk updated: Increase timeouts to apt downloading and add retries to docker building to better handle slow internet connections

This is an automated email from the ASF dual-hosted git repository.

mck pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-builds.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 7823fdc  Increase timeouts to apt downloading and add retries to docker building to better handle slow internet connections
7823fdc is described below

commit 7823fdc014a3029cf72a8f5804b2f764493619b4
Author: Mick Semb Wever <mc...@apache.org>
AuthorDate: Mon Nov 7 12:58:53 2022 +0100

    Increase timeouts to apt downloading and add retries to docker building to better handle slow internet connections
---
 build-scripts/cassandra-deb-packaging.sh |  5 +++--
 build-scripts/cassandra-rpm-packaging.sh |  4 ++--
 docker/bullseye-image.docker             | 25 ++++++++++++-------------
 docker/testing/ubuntu2004_j11.docker     |  4 +++-
 4 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/build-scripts/cassandra-deb-packaging.sh b/build-scripts/cassandra-deb-packaging.sh
index 980e9a5..363133a 100755
--- a/build-scripts/cassandra-deb-packaging.sh
+++ b/build-scripts/cassandra-deb-packaging.sh
@@ -34,8 +34,9 @@ docker image prune --all --force --filter label=org.cassandra.buildenv=bullseye
 
 pushd $cassandra_builds_dir
 
-# Create build images containing the build tool-chain, Java and an Apache Cassandra git working directory
-docker build --build-arg CASSANDRA_GIT_URL=$CASSANDRA_GIT_URL --build-arg UID_ARG=`id -u` --build-arg GID_ARG=`id -g` -t cassandra-artifacts-bullseye:${sha} -f docker/bullseye-image.docker docker/
+# Create build images containing the build tool-chain, Java and an Apache Cassandra git working directory, with retry
+until docker build --build-arg CASSANDRA_GIT_URL=$CASSANDRA_GIT_URL --build-arg UID_ARG=`id -u` --build-arg GID_ARG=`id -g` -t cassandra-artifacts-bullseye:${sha} -f docker/bullseye-image.docker docker/  ; do echo "docker build failed… trying again in 10s… " ; sleep 10 ; done
+
 
 # Run build script through docker (specify branch, tag, or sha)
 docker run --rm -v "${deb_dir}":/dist -v ~/.m2/repository/:/home/build/.m2/repository/ cassandra-artifacts-bullseye:${sha} /home/build/build-debs.sh ${sha} ${java_version}
diff --git a/build-scripts/cassandra-rpm-packaging.sh b/build-scripts/cassandra-rpm-packaging.sh
index 8fdb2ef..ca5e26a 100755
--- a/build-scripts/cassandra-rpm-packaging.sh
+++ b/build-scripts/cassandra-rpm-packaging.sh
@@ -45,8 +45,8 @@ docker image prune --all --force --filter label=org.cassandra.buildenv=${dist_na
 
 pushd $cassandra_builds_dir
 
-# Create build images containing the build tool-chain, Java and an Apache Cassandra git working directory
-docker build --build-arg CASSANDRA_GIT_URL=$CASSANDRA_GIT_URL --build-arg UID_ARG=`id -u` --build-arg GID_ARG=`id -g` -t cassandra-artifacts-${dist_name}:${sha} -f docker/${dist_name}-image.docker docker/
+# Create build images containing the build tool-chain, Java and an Apache Cassandra git working directory, with retry
+until docker build --build-arg CASSANDRA_GIT_URL=$CASSANDRA_GIT_URL --build-arg UID_ARG=`id -u` --build-arg GID_ARG=`id -g` -t cassandra-artifacts-${dist_name}:${sha} -f docker/${dist_name}-image.docker docker/  ; do echo "docker build failed… trying again in 10s… " ; sleep 10 ; done
 
 # Run build script through docker (specify branch, tag, or sha)
 docker run --rm -v "${rpm_dir}":/dist -v ~/.m2/repository/:/home/build/.m2/repository/ cassandra-artifacts-${dist_name}:${sha} /home/build/build-rpms.sh ${sha} ${java_version} ${rpm_dist}
diff --git a/docker/bullseye-image.docker b/docker/bullseye-image.docker
index 976e433..b5d801b 100644
--- a/docker/bullseye-image.docker
+++ b/docker/bullseye-image.docker
@@ -18,23 +18,22 @@ RUN echo "Building with arguments:" \
     && echo " - GID_ARG=${GID_ARG}"
 
 # configure apt to retry downloads
-RUN echo 'APT::Acquire::Retries "9";' > /etc/apt/apt.conf.d/80-retries
+RUN echo 'APT::Acquire::Retries "99";' > /etc/apt/apt.conf.d/80-retries
+RUN echo 'Acquire::http::Timeout "60";' > /etc/apt/apt.conf.d/80proxy.conf
+RUN echo 'Acquire::ftp::Timeout "60";' >> /etc/apt/apt.conf.d/80proxy.conf
 
 # install deps
-RUN apt-get update && apt-get -y install \
-   ant \
-   build-essential \
-   curl \
-   devscripts \
-   git \
-   python2 \
-   sudo
+RUN until apt-get update && apt-get -y install ant build-essential curl devscripts git python2 sudo ; \
+    do echo "apt failed… trying again in 10s… " ; sleep 10 ; done
 
 RUN echo 'deb http://ftp.debian.org/debian bullseye main' >> /etc/apt/sources.list \
-    && echo 'deb http://ftp.debian.org/debian stretch main' >> /etc/apt/sources.list \
-    && apt-get update \
-    && apt-get install -y --no-install-recommends openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk \
-    && sed -i '$d' /etc/apt/sources.list \
+    && echo 'deb http://ftp.debian.org/debian stretch main' >> /etc/apt/sources.list
+
+RUN until apt-get update \
+    && apt-get install -y --no-install-recommends openjdk-8-jdk openjdk-11-jdk openjdk-17-jdk ; \
+    do echo "apt failed… trying again in 10s… " ; sleep 10 ; done
+
+RUN sed -i '$d' /etc/apt/sources.list \
     && apt-get update \
     && update-java-alternatives --set java-1.8.0-openjdk-$(dpkg --print-architecture)
 
diff --git a/docker/testing/ubuntu2004_j11.docker b/docker/testing/ubuntu2004_j11.docker
index 19521bb..38bb63a 100644
--- a/docker/testing/ubuntu2004_j11.docker
+++ b/docker/testing/ubuntu2004_j11.docker
@@ -14,7 +14,9 @@ FROM ubuntu:20.04
 MAINTAINER Apache Cassandra <de...@cassandra.apache.org>
 
 # configure apt to retry downloads
-RUN echo 'APT::Acquire::Retries "9";' > /etc/apt/apt.conf.d/80-retries
+RUN echo 'APT::Acquire::Retries "99";' > /etc/apt/apt.conf.d/80-retries
+RUN echo 'Acquire::http::Timeout "60";' > /etc/apt/apt.conf.d/80proxy.conf
+RUN echo 'Acquire::ftp::Timeout "60";' >> /etc/apt/apt.conf.d/80proxy.conf
 
 # install our python dependencies and some other stuff we need
 # libev4 libev-dev are for the python driver / libssl-dev is for python3.6


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org