Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion integration-tests/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@ 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://archive.apache.org
RUN APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && rm -f /root/base-setup.sh
ARG SETUP_RETRIES=3
# Retry mechanism for running the setup script up to limit of 3 times.
RUN set -e; \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens to this script in case of error ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It continues running the test even after 3 failed attempts, instead of erroring out:

#7 834.3 Set up script attempt 3/3 failed.


#7 DONE 836.4s

#8 [stage-1  1/21] RUN java -version
#8 0.153 openjdk version "17.0.2" 2022-01-18
#8 0.153 OpenJDK Runtime Environment (build 17.0.2+8-86)
#8 0.153 OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)
#8 DONE 0.2s

#9 [stage-1  2/21] RUN echo "[mysqld]\ncharacter-set-server=utf8\ncollation-server=utf8_bin\n" >> /etc/mysql/my.cnf
#9 DONE 0.2s

#10 [stage-1  3/21] RUN find /var/lib/mysql -type f -exec touch {} ; && /etc/init.d/mysql start       && echo "CREATE USER 'druid'@'%' IDENTIFIED BY 'diurd'; GRANT ALL ON druid.* TO 'druid'@'%'; CREATE database druid DEFAULT CHARACTER SET utf8mb4;" | mysql -u root       && /etc/init.d/mysql stop
#10 0.654 Starting MariaDB database server: mysqld.
#10 1.699 Stopping MariaDB database server: mysqldERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
#10 2.721 .
#10 DONE 2.8s

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

FROM druidbase
ARG MYSQL_VERSION
Expand Down