From 731b78fb47fd8e049acb495ac54259c50eb53083 Mon Sep 17 00:00:00 2001 From: GWphua Date: Fri, 20 Dec 2024 16:56:52 +0800 Subject: [PATCH 01/19] Allow Dockerfile to exit after 3 failures --- integration-tests/docker/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/integration-tests/docker/Dockerfile b/integration-tests/docker/Dockerfile index 89fd45c97784..2320630a93a0 100644 --- a/integration-tests/docker/Dockerfile +++ b/integration-tests/docker/Dockerfile @@ -27,15 +27,17 @@ ARG ZK_VERSION ARG APACHE_ARCHIVE_MIRROR_HOST=https://archive.apache.org ARG SETUP_RETRIES=3 # Retry mechanism for running the setup script up to limit of 3 times. -RUN set -e; \ - for i in $(seq 1 $SETUP_RETRIES); do \ +RUN for i in $(seq 1 $SETUP_RETRIES); do \ echo "Attempt $i to run the setup script..."; \ APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && break || { \ echo "Set up script attempt $i/$SETUP_RETRIES failed."; \ sleep 2; \ }; \ done; \ - rm -f /root/base-setup.sh + rm -f /root/base-setup.sh; \ + if [ "$i" -eq "$SETUP_RETRIES" ]; then \ + exit 1; \ + fi; \ FROM druidbase ARG MYSQL_VERSION From 22eb5722dfb6aa297ca36594c3ba07f06d34e3e1 Mon Sep 17 00:00:00 2001 From: GWphua Date: Fri, 20 Dec 2024 17:01:43 +0800 Subject: [PATCH 02/19] Allow Dockerfile to exit with same error code as last failed .sh run --- integration-tests/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/docker/Dockerfile b/integration-tests/docker/Dockerfile index 2320630a93a0..59441ff15cc9 100644 --- a/integration-tests/docker/Dockerfile +++ b/integration-tests/docker/Dockerfile @@ -36,7 +36,7 @@ RUN for i in $(seq 1 $SETUP_RETRIES); do \ done; \ rm -f /root/base-setup.sh; \ if [ "$i" -eq "$SETUP_RETRIES" ]; then \ - exit 1; \ + exit $?; \ fi; \ FROM druidbase From 6577760a810cf25a9d0e62e05857226ab66313e1 Mon Sep 17 00:00:00 2001 From: GWphua Date: Fri, 20 Dec 2024 17:39:36 +0800 Subject: [PATCH 03/19] Remember last exit code before deleting base-setup.sh --- integration-tests/docker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration-tests/docker/Dockerfile b/integration-tests/docker/Dockerfile index 59441ff15cc9..b33c27f9bf46 100644 --- a/integration-tests/docker/Dockerfile +++ b/integration-tests/docker/Dockerfile @@ -34,9 +34,10 @@ RUN for i in $(seq 1 $SETUP_RETRIES); do \ sleep 2; \ }; \ done; \ + LAST_EXIT_CODE=$?; \ rm -f /root/base-setup.sh; \ if [ "$i" -eq "$SETUP_RETRIES" ]; then \ - exit $?; \ + exit LAST_EXIT_CODE; \ fi; \ FROM druidbase From 1f604421b1a9fc372fa6ad557dc7d351552f0a23 Mon Sep 17 00:00:00 2001 From: GWphua Date: Fri, 20 Dec 2024 17:56:34 +0800 Subject: [PATCH 04/19] Prevent exit on 3rd success --- integration-tests/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/docker/Dockerfile b/integration-tests/docker/Dockerfile index b33c27f9bf46..388edff5bec3 100644 --- a/integration-tests/docker/Dockerfile +++ b/integration-tests/docker/Dockerfile @@ -36,7 +36,7 @@ RUN for i in $(seq 1 $SETUP_RETRIES); do \ done; \ LAST_EXIT_CODE=$?; \ rm -f /root/base-setup.sh; \ - if [ "$i" -eq "$SETUP_RETRIES" ]; then \ + if [ "$i" -eq "$SETUP_RETRIES" ] && [ "$LAST_EXIT_CODE" -ne 0 ]; then \ exit LAST_EXIT_CODE; \ fi; \ From f5f9ef1f66ef3e13ba32f2e1b4dbc51543665626 Mon Sep 17 00:00:00 2001 From: GWphua Date: Fri, 20 Dec 2024 18:41:13 +0800 Subject: [PATCH 05/19] Fix bug where exit on 3rd success --- integration-tests/docker/Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/integration-tests/docker/Dockerfile b/integration-tests/docker/Dockerfile index 388edff5bec3..c31d4a71861c 100644 --- a/integration-tests/docker/Dockerfile +++ b/integration-tests/docker/Dockerfile @@ -27,18 +27,19 @@ ARG ZK_VERSION ARG APACHE_ARCHIVE_MIRROR_HOST=https://archive.apache.org ARG SETUP_RETRIES=3 # Retry mechanism for running the setup script up to limit of 3 times. -RUN for i in $(seq 1 $SETUP_RETRIES); do \ - echo "Attempt $i to run the setup script..."; \ +RUN i=0; \ + while [ $i -lt $SETUP_RETRIES ]; do \ APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && break || { \ + i=$(($i + 1)); \ echo "Set up script attempt $i/$SETUP_RETRIES failed."; \ sleep 2; \ }; \ done; \ - LAST_EXIT_CODE=$?; \ rm -f /root/base-setup.sh; \ - if [ "$i" -eq "$SETUP_RETRIES" ] && [ "$LAST_EXIT_CODE" -ne 0 ]; then \ - exit LAST_EXIT_CODE; \ - fi; \ + if [ "$i" -eq "$SETUP_RETRIES" ]; then \ + exit 1; \ + fi + FROM druidbase ARG MYSQL_VERSION From 205e39be7a98b7b2fe5e2349d67d8e4a89179813 Mon Sep 17 00:00:00 2001 From: GWphua Date: Fri, 20 Dec 2024 16:56:52 +0800 Subject: [PATCH 06/19] Allow Dockerfile to exit after 3 failures --- integration-tests/docker/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/integration-tests/docker/Dockerfile b/integration-tests/docker/Dockerfile index 1436aa5bf856..dba78f2e0840 100644 --- a/integration-tests/docker/Dockerfile +++ b/integration-tests/docker/Dockerfile @@ -27,15 +27,17 @@ ARG ZK_VERSION ARG APACHE_ARCHIVE_MIRROR_HOST=https://downloads.apache.org ARG SETUP_RETRIES=3 # Retry mechanism for running the setup script up to limit of 3 times. -RUN set -e; \ - for i in $(seq 1 $SETUP_RETRIES); do \ +RUN for i in $(seq 1 $SETUP_RETRIES); do \ echo "Attempt $i to run the setup script..."; \ APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && break || { \ echo "Set up script attempt $i/$SETUP_RETRIES failed."; \ sleep 2; \ }; \ done; \ - rm -f /root/base-setup.sh + rm -f /root/base-setup.sh; \ + if [ "$i" -eq "$SETUP_RETRIES" ]; then \ + exit 1; \ + fi; \ FROM druidbase ARG MYSQL_VERSION From e0ee51d56111898a95491470665fbd56cdb598c6 Mon Sep 17 00:00:00 2001 From: GWphua Date: Fri, 20 Dec 2024 17:01:43 +0800 Subject: [PATCH 07/19] Allow Dockerfile to exit with same error code as last failed .sh run --- integration-tests/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/docker/Dockerfile b/integration-tests/docker/Dockerfile index dba78f2e0840..4853e675802c 100644 --- a/integration-tests/docker/Dockerfile +++ b/integration-tests/docker/Dockerfile @@ -36,7 +36,7 @@ RUN for i in $(seq 1 $SETUP_RETRIES); do \ done; \ rm -f /root/base-setup.sh; \ if [ "$i" -eq "$SETUP_RETRIES" ]; then \ - exit 1; \ + exit $?; \ fi; \ FROM druidbase From 298af5bab8ca92a9509d37c36c816ade041d4b6c Mon Sep 17 00:00:00 2001 From: GWphua Date: Fri, 20 Dec 2024 17:39:36 +0800 Subject: [PATCH 08/19] Remember last exit code before deleting base-setup.sh --- integration-tests/docker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration-tests/docker/Dockerfile b/integration-tests/docker/Dockerfile index 4853e675802c..586466b68957 100644 --- a/integration-tests/docker/Dockerfile +++ b/integration-tests/docker/Dockerfile @@ -34,9 +34,10 @@ RUN for i in $(seq 1 $SETUP_RETRIES); do \ sleep 2; \ }; \ done; \ + LAST_EXIT_CODE=$?; \ rm -f /root/base-setup.sh; \ if [ "$i" -eq "$SETUP_RETRIES" ]; then \ - exit $?; \ + exit LAST_EXIT_CODE; \ fi; \ FROM druidbase From 2d1a61df94045eabfecf53c76fd3914c1e7a99d8 Mon Sep 17 00:00:00 2001 From: GWphua Date: Fri, 20 Dec 2024 17:56:34 +0800 Subject: [PATCH 09/19] Prevent exit on 3rd success --- integration-tests/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/docker/Dockerfile b/integration-tests/docker/Dockerfile index 586466b68957..28770e744b22 100644 --- a/integration-tests/docker/Dockerfile +++ b/integration-tests/docker/Dockerfile @@ -36,7 +36,7 @@ RUN for i in $(seq 1 $SETUP_RETRIES); do \ done; \ LAST_EXIT_CODE=$?; \ rm -f /root/base-setup.sh; \ - if [ "$i" -eq "$SETUP_RETRIES" ]; then \ + if [ "$i" -eq "$SETUP_RETRIES" ] && [ "$LAST_EXIT_CODE" -ne 0 ]; then \ exit LAST_EXIT_CODE; \ fi; \ From d3b440af57c930d290acf91cac55da9084fcad2c Mon Sep 17 00:00:00 2001 From: GWphua Date: Fri, 20 Dec 2024 18:41:13 +0800 Subject: [PATCH 10/19] Fix bug where exit on 3rd success --- integration-tests/docker/Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/integration-tests/docker/Dockerfile b/integration-tests/docker/Dockerfile index 28770e744b22..d3cb413dd31c 100644 --- a/integration-tests/docker/Dockerfile +++ b/integration-tests/docker/Dockerfile @@ -27,18 +27,19 @@ ARG ZK_VERSION ARG APACHE_ARCHIVE_MIRROR_HOST=https://downloads.apache.org ARG SETUP_RETRIES=3 # Retry mechanism for running the setup script up to limit of 3 times. -RUN for i in $(seq 1 $SETUP_RETRIES); do \ - echo "Attempt $i to run the setup script..."; \ +RUN i=0; \ + while [ $i -lt $SETUP_RETRIES ]; do \ APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && break || { \ + i=$(($i + 1)); \ echo "Set up script attempt $i/$SETUP_RETRIES failed."; \ sleep 2; \ }; \ done; \ - LAST_EXIT_CODE=$?; \ rm -f /root/base-setup.sh; \ - if [ "$i" -eq "$SETUP_RETRIES" ] && [ "$LAST_EXIT_CODE" -ne 0 ]; then \ - exit LAST_EXIT_CODE; \ - fi; \ + if [ "$i" -eq "$SETUP_RETRIES" ]; then \ + exit 1; \ + fi + FROM druidbase ARG MYSQL_VERSION From 62e2e89dc98bd56890acb905e69180769d5933ed Mon Sep 17 00:00:00 2001 From: GWphua Date: Mon, 13 Jan 2025 10:42:21 +0800 Subject: [PATCH 11/19] Remove quiet tag to identify wget problem --- integration-tests/docker/base-setup.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/integration-tests/docker/base-setup.sh b/integration-tests/docker/base-setup.sh index ea10e1a336b5..692492062197 100755 --- a/integration-tests/docker/base-setup.sh +++ b/integration-tests/docker/base-setup.sh @@ -32,9 +32,8 @@ apt-get install -y default-mysql-server apt-get install -y supervisor # Zookeeper - install_zk() { - wget -q -O /tmp/$ZK_TAR.tar.gz "$APACHE_ARCHIVE_MIRROR_HOST/zookeeper/zookeeper-$ZK_VERSION/$ZK_TAR.tar.gz" + wget -O /tmp/$ZK_TAR.tar.gz "$APACHE_ARCHIVE_MIRROR_HOST/dist/zookeeper/zookeeper-$ZK_VERSION/$ZK_TAR.tar.gz" tar -xzf /tmp/$ZK_TAR.tar.gz -C /usr/local cp /usr/local/$ZK_TAR/conf/zoo_sample.cfg /usr/local/$ZK_TAR/conf/zoo.cfg rm /tmp/$ZK_TAR.tar.gz @@ -46,7 +45,7 @@ ln -s /usr/local/$ZK_TAR /usr/local/zookeeper # Kafka # KAFKA_VERSION is defined by docker build arguments -wget -q -O /tmp/kafka_2.13-$KAFKA_VERSION.tgz "$APACHE_ARCHIVE_MIRROR_HOST/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz" +wget -O /tmp/kafka_2.13-$KAFKA_VERSION.tgz "$APACHE_ARCHIVE_MIRROR_HOST/dist/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz" tar -xzf /tmp/kafka_2.13-$KAFKA_VERSION.tgz -C /usr/local ln -s /usr/local/kafka_2.13-$KAFKA_VERSION /usr/local/kafka rm /tmp/kafka_2.13-$KAFKA_VERSION.tgz From 6da23fb6d799f9779db79eeb6acf1f7deda778f3 Mon Sep 17 00:00:00 2001 From: GWphua Date: Mon, 13 Jan 2025 10:47:11 +0800 Subject: [PATCH 12/19] Revert retry mechanism --- integration-tests/docker/Dockerfile | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/integration-tests/docker/Dockerfile b/integration-tests/docker/Dockerfile index d3cb413dd31c..2e8a73c35f0c 100644 --- a/integration-tests/docker/Dockerfile +++ b/integration-tests/docker/Dockerfile @@ -25,20 +25,7 @@ ARG KAFKA_VERSION # This is passed in by maven at build time to align with the client version we depend on in the pom file ARG ZK_VERSION ARG APACHE_ARCHIVE_MIRROR_HOST=https://downloads.apache.org -ARG SETUP_RETRIES=3 -# Retry mechanism for running the setup script up to limit of 3 times. -RUN i=0; \ - while [ $i -lt $SETUP_RETRIES ]; do \ - APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && break || { \ - i=$(($i + 1)); \ - echo "Set up script attempt $i/$SETUP_RETRIES failed."; \ - sleep 2; \ - }; \ - done; \ - rm -f /root/base-setup.sh; \ - if [ "$i" -eq "$SETUP_RETRIES" ]; then \ - exit 1; \ - fi +RUN APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && rm -f /root/base-setup.sh FROM druidbase From 2f1f1c7e2f1bec36c5592bdc8f91a7d735ef6312 Mon Sep 17 00:00:00 2001 From: Virushade <70288012+GWphua@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:26:59 +0800 Subject: [PATCH 13/19] Set correct wget path. --- integration-tests/docker/base-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/docker/base-setup.sh b/integration-tests/docker/base-setup.sh index 692492062197..0795cc237640 100755 --- a/integration-tests/docker/base-setup.sh +++ b/integration-tests/docker/base-setup.sh @@ -33,7 +33,7 @@ apt-get install -y supervisor # Zookeeper install_zk() { - wget -O /tmp/$ZK_TAR.tar.gz "$APACHE_ARCHIVE_MIRROR_HOST/dist/zookeeper/zookeeper-$ZK_VERSION/$ZK_TAR.tar.gz" + wget -O /tmp/$ZK_TAR.tar.gz "$APACHE_ARCHIVE_MIRROR_HOST/zookeeper/zookeeper-$ZK_VERSION/$ZK_TAR.tar.gz" tar -xzf /tmp/$ZK_TAR.tar.gz -C /usr/local cp /usr/local/$ZK_TAR/conf/zoo_sample.cfg /usr/local/$ZK_TAR/conf/zoo.cfg rm /tmp/$ZK_TAR.tar.gz @@ -45,7 +45,7 @@ ln -s /usr/local/$ZK_TAR /usr/local/zookeeper # Kafka # KAFKA_VERSION is defined by docker build arguments -wget -O /tmp/kafka_2.13-$KAFKA_VERSION.tgz "$APACHE_ARCHIVE_MIRROR_HOST/dist/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz" +wget -O /tmp/kafka_2.13-$KAFKA_VERSION.tgz "$APACHE_ARCHIVE_MIRROR_HOST/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz" tar -xzf /tmp/kafka_2.13-$KAFKA_VERSION.tgz -C /usr/local ln -s /usr/local/kafka_2.13-$KAFKA_VERSION /usr/local/kafka rm /tmp/kafka_2.13-$KAFKA_VERSION.tgz From c15ff2edbb27884cb13630856986234fa2e88de2 Mon Sep 17 00:00:00 2001 From: GWphua Date: Mon, 13 Jan 2025 16:30:32 +0800 Subject: [PATCH 14/19] Force wget to only look for ipv4 addresses --- integration-tests/docker/base-setup.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/integration-tests/docker/base-setup.sh b/integration-tests/docker/base-setup.sh index 0795cc237640..b93bd0322a20 100755 --- a/integration-tests/docker/base-setup.sh +++ b/integration-tests/docker/base-setup.sh @@ -20,20 +20,20 @@ set -u export DEBIAN_FRONTEND=noninteractive APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST:-https://downloads.apache.org} -apt-get update +apt-get -qq update # wget -apt-get install -y wget +apt-get -qq install -y wget # MySQL (Metadata store) -apt-get install -y default-mysql-server +apt-get -qq install -y default-mysql-server # Supervisor -apt-get install -y supervisor +apt-get -qq install -y supervisor # Zookeeper install_zk() { - wget -O /tmp/$ZK_TAR.tar.gz "$APACHE_ARCHIVE_MIRROR_HOST/zookeeper/zookeeper-$ZK_VERSION/$ZK_TAR.tar.gz" + wget --inet4-only -O /tmp/$ZK_TAR.tar.gz "$APACHE_ARCHIVE_MIRROR_HOST/zookeeper/zookeeper-$ZK_VERSION/$ZK_TAR.tar.gz" tar -xzf /tmp/$ZK_TAR.tar.gz -C /usr/local cp /usr/local/$ZK_TAR/conf/zoo_sample.cfg /usr/local/$ZK_TAR/conf/zoo.cfg rm /tmp/$ZK_TAR.tar.gz @@ -45,7 +45,7 @@ ln -s /usr/local/$ZK_TAR /usr/local/zookeeper # Kafka # KAFKA_VERSION is defined by docker build arguments -wget -O /tmp/kafka_2.13-$KAFKA_VERSION.tgz "$APACHE_ARCHIVE_MIRROR_HOST/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz" +wget --inet4-only -O /tmp/kafka_2.13-$KAFKA_VERSION.tgz "$APACHE_ARCHIVE_MIRROR_HOST/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz" tar -xzf /tmp/kafka_2.13-$KAFKA_VERSION.tgz -C /usr/local ln -s /usr/local/kafka_2.13-$KAFKA_VERSION /usr/local/kafka rm /tmp/kafka_2.13-$KAFKA_VERSION.tgz From f430f6273561e2a63592e8ff2a983798d5dc04c2 Mon Sep 17 00:00:00 2001 From: GWphua Date: Mon, 13 Jan 2025 18:41:10 +0800 Subject: [PATCH 15/19] Add ipv4 force and retry options --- integration-tests/docker/base-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/docker/base-setup.sh b/integration-tests/docker/base-setup.sh index b93bd0322a20..f588773696c7 100755 --- a/integration-tests/docker/base-setup.sh +++ b/integration-tests/docker/base-setup.sh @@ -33,7 +33,7 @@ apt-get -qq install -y supervisor # Zookeeper install_zk() { - wget --inet4-only -O /tmp/$ZK_TAR.tar.gz "$APACHE_ARCHIVE_MIRROR_HOST/zookeeper/zookeeper-$ZK_VERSION/$ZK_TAR.tar.gz" + wget -q4 --tries=10 --waitretry=10 -O /tmp/$ZK_TAR.tar.gz "$APACHE_ARCHIVE_MIRROR_HOST/zookeeper/zookeeper-$ZK_VERSION/$ZK_TAR.tar.gz" tar -xzf /tmp/$ZK_TAR.tar.gz -C /usr/local cp /usr/local/$ZK_TAR/conf/zoo_sample.cfg /usr/local/$ZK_TAR/conf/zoo.cfg rm /tmp/$ZK_TAR.tar.gz @@ -45,7 +45,7 @@ ln -s /usr/local/$ZK_TAR /usr/local/zookeeper # Kafka # KAFKA_VERSION is defined by docker build arguments -wget --inet4-only -O /tmp/kafka_2.13-$KAFKA_VERSION.tgz "$APACHE_ARCHIVE_MIRROR_HOST/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz" +wget -q4 --tries=10 --waitretry=10 -O /tmp/kafka_2.13-$KAFKA_VERSION.tgz "$APACHE_ARCHIVE_MIRROR_HOST/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz" tar -xzf /tmp/kafka_2.13-$KAFKA_VERSION.tgz -C /usr/local ln -s /usr/local/kafka_2.13-$KAFKA_VERSION /usr/local/kafka rm /tmp/kafka_2.13-$KAFKA_VERSION.tgz From e83fdb4c13183a2ec85164773079042d303b38ce Mon Sep 17 00:00:00 2001 From: GWphua Date: Tue, 14 Jan 2025 10:43:34 +0800 Subject: [PATCH 16/19] Add download files function to output wget status --- integration-tests/docker/base-setup.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/integration-tests/docker/base-setup.sh b/integration-tests/docker/base-setup.sh index f588773696c7..db2ea609b7fe 100755 --- a/integration-tests/docker/base-setup.sh +++ b/integration-tests/docker/base-setup.sh @@ -31,9 +31,23 @@ apt-get -qq install -y default-mysql-server # Supervisor apt-get -qq install -y supervisor +# Download function +download_file() { + local dest=$1 + local host=$2 + + if ! wget --inet4-only --quiet --continue --output-document="$dest" "$host" + then + echo "Download from $host failed!" + return 1 + fi + + echo "Download from $host succeeded!" +} + # Zookeeper install_zk() { - wget -q4 --tries=10 --waitretry=10 -O /tmp/$ZK_TAR.tar.gz "$APACHE_ARCHIVE_MIRROR_HOST/zookeeper/zookeeper-$ZK_VERSION/$ZK_TAR.tar.gz" + download_file "/tmp/$ZK_TAR.tar.gz" "$APACHE_ARCHIVE_MIRROR_HOST/zookeeper/zookeeper-$ZK_VERSION/$ZK_TAR.tar.gz" tar -xzf /tmp/$ZK_TAR.tar.gz -C /usr/local cp /usr/local/$ZK_TAR/conf/zoo_sample.cfg /usr/local/$ZK_TAR/conf/zoo.cfg rm /tmp/$ZK_TAR.tar.gz @@ -45,7 +59,7 @@ ln -s /usr/local/$ZK_TAR /usr/local/zookeeper # Kafka # KAFKA_VERSION is defined by docker build arguments -wget -q4 --tries=10 --waitretry=10 -O /tmp/kafka_2.13-$KAFKA_VERSION.tgz "$APACHE_ARCHIVE_MIRROR_HOST/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz" +download_file "/tmp/kafka_2.13-$KAFKA_VERSION.tgz" "$APACHE_ARCHIVE_MIRROR_HOST/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz" tar -xzf /tmp/kafka_2.13-$KAFKA_VERSION.tgz -C /usr/local ln -s /usr/local/kafka_2.13-$KAFKA_VERSION /usr/local/kafka rm /tmp/kafka_2.13-$KAFKA_VERSION.tgz From 389791500bbe328cf4c10738f4097308fb0aa2b2 Mon Sep 17 00:00:00 2001 From: GWphua Date: Tue, 14 Jan 2025 14:18:53 +0800 Subject: [PATCH 17/19] Revert apt-get silencers as they do not remove excessive logs --- integration-tests/docker/base-setup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration-tests/docker/base-setup.sh b/integration-tests/docker/base-setup.sh index db2ea609b7fe..4df8af273008 100755 --- a/integration-tests/docker/base-setup.sh +++ b/integration-tests/docker/base-setup.sh @@ -20,16 +20,16 @@ set -u export DEBIAN_FRONTEND=noninteractive APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST:-https://downloads.apache.org} -apt-get -qq update +apt-get update # wget -apt-get -qq install -y wget +apt-get install -y wget # MySQL (Metadata store) -apt-get -qq install -y default-mysql-server +apt-get install -y default-mysql-server # Supervisor -apt-get -qq install -y supervisor +apt-get install -y supervisor # Download function download_file() { From a28c288c5f59361b0f0feddf20ddcbedc908fd57 Mon Sep 17 00:00:00 2001 From: GWphua Date: Tue, 14 Jan 2025 17:26:22 +0800 Subject: [PATCH 18/19] Futureproof wget command --- integration-tests/docker/base-setup.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/integration-tests/docker/base-setup.sh b/integration-tests/docker/base-setup.sh index 4df8af273008..75f53b58fe6e 100755 --- a/integration-tests/docker/base-setup.sh +++ b/integration-tests/docker/base-setup.sh @@ -36,13 +36,7 @@ download_file() { local dest=$1 local host=$2 - if ! wget --inet4-only --quiet --continue --output-document="$dest" "$host" - then - echo "Download from $host failed!" - return 1 - fi - - echo "Download from $host succeeded!" + wget --retry-connrefused --no-verbose --continue --output-document="$dest" "$host" } # Zookeeper From 0e52be8e93f8106db7dacf001d3a7a13a16a9842 Mon Sep 17 00:00:00 2001 From: GWphua Date: Wed, 15 Jan 2025 10:29:57 +0800 Subject: [PATCH 19/19] Make wget verbose --- integration-tests/docker/base-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/docker/base-setup.sh b/integration-tests/docker/base-setup.sh index 75f53b58fe6e..31720fcbca9f 100755 --- a/integration-tests/docker/base-setup.sh +++ b/integration-tests/docker/base-setup.sh @@ -36,7 +36,7 @@ download_file() { local dest=$1 local host=$2 - wget --retry-connrefused --no-verbose --continue --output-document="$dest" "$host" + wget --retry-connrefused --continue --output-document="$dest" "$host" } # Zookeeper