This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new 58f30d9f4b0 [fix][ci][branch-3.0] Drop
UBUNTU_MIRROR/UBUNTU_SECURITY_MIRROR support in Dockerfile since it's broken
58f30d9f4b0 is described below
commit 58f30d9f4b06e37d7b64aca13322bcb66b580b76
Author: Lari Hotari <[email protected]>
AuthorDate: Wed Oct 29 00:11:33 2025 +0200
[fix][ci][branch-3.0] Drop UBUNTU_MIRROR/UBUNTU_SECURITY_MIRROR support in
Dockerfile since it's broken
- branch-3.0 is blocked since Dockerfile cannot be built in Pulsar CI
- The solution can be restored if there's still a need to have custom logic
for picking the mirror
- The solution is broken for arm64 since it uses http://ports.ubuntu.com as
the main repository
---
.github/workflows/pulsar-ci.yaml | 11 -------
build/build_java_test_image.sh | 1 -
build/pulsar_ci_tool.sh | 41 ++------------------------
docker/pulsar/Dockerfile | 6 +---
docker/pulsar/pom.xml | 2 --
pom.xml | 29 ------------------
tests/docker-images/java-test-image/Dockerfile | 6 +---
tests/docker-images/java-test-image/pom.xml | 2 --
8 files changed, 4 insertions(+), 94 deletions(-)
diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml
index 26d6d939d2f..68d484ecd36 100644
--- a/.github/workflows/pulsar-ci.yaml
+++ b/.github/workflows/pulsar-ci.yaml
@@ -433,11 +433,6 @@ jobs:
cd $HOME
$GITHUB_WORKSPACE/build/pulsar_ci_tool.sh
restore_tar_from_github_actions_artifacts pulsar-maven-repository-binaries
- - name: Pick ubuntu mirror for the docker image build
- run: |
- # pick the closest ubuntu mirror and set it to UBUNTU_MIRROR
environment variable
- $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh pick_ubuntu_mirror
-
- name: Build java-test-image docker image
run: |
# build docker image
@@ -783,17 +778,11 @@ jobs:
cd $HOME
$GITHUB_WORKSPACE/build/pulsar_ci_tool.sh
restore_tar_from_github_actions_artifacts pulsar-maven-repository-binaries
- - name: Pick ubuntu mirror for the docker image build
- run: |
- # pick the closest ubuntu mirror and set it to UBUNTU_MIRROR
environment variable
- $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh pick_ubuntu_mirror
-
- name: Build latest-version-image docker image
run: |
# build docker image
# include building of Pulsar SQL, Connectors, Offloaders and server
distros
mvn -B -am -pl
pulsar-sql/presto-distribution,distribution/io,distribution/offloaders,distribution/server,distribution/shell,tests/docker-images/latest-version-image
install \
- -DUBUNTU_MIRROR="${UBUNTU_MIRROR}"
-DUBUNTU_SECURITY_MIRROR="${UBUNTU_SECURITY_MIRROR}" \
-Pmain,docker -Dmaven.test.skip=true -Ddocker.squash=true \
-Dspotbugs.skip=true -Dlicense.skip=true -Dcheckstyle.skip=true
-Drat.skip=true
diff --git a/build/build_java_test_image.sh b/build/build_java_test_image.sh
index 459bf26f98e..0747e6dacb8 100755
--- a/build/build_java_test_image.sh
+++ b/build/build_java_test_image.sh
@@ -27,6 +27,5 @@ if [[ "$(docker version -f '{{.Server.Experimental}}'
2>/dev/null)" == "true" ]]
SQUASH_PARAM="-Ddocker.squash=true"
fi
mvn -am -pl tests/docker-images/java-test-image
-Pcore-modules,-main,integrationTests,docker \
- -DUBUNTU_MIRROR="${UBUNTU_MIRROR}"
-DUBUNTU_SECURITY_MIRROR="${UBUNTU_SECURITY_MIRROR}" \
-Dmaven.test.skip=true -DskipSourceReleaseAssembly=true -Dspotbugs.skip=true
-Dlicense.skip=true $SQUASH_PARAM \
"$@" install
\ No newline at end of file
diff --git a/build/pulsar_ci_tool.sh b/build/pulsar_ci_tool.sh
index 40b1e5d18c3..0042a9a2e69 100755
--- a/build/pulsar_ci_tool.sh
+++ b/build/pulsar_ci_tool.sh
@@ -46,8 +46,7 @@ function ci_print_thread_dumps() {
# runs maven
function _ci_mvn() {
- mvn -B -ntp -DUBUNTU_MIRROR="${UBUNTU_MIRROR}"
-DUBUNTU_SECURITY_MIRROR="${UBUNTU_SECURITY_MIRROR}" \
- "$@"
+ mvn -B -ntp "$@"
}
# runs OWASP Dependency Check for all projects
@@ -55,40 +54,6 @@ function ci_dependency_check() {
_ci_mvn -Pmain,skip-all,skipDocker,owasp-dependency-check initialize verify
-pl '!pulsar-client-tools-test' "$@"
}
-function ci_pick_ubuntu_mirror() {
- echo "Choosing fastest up-to-date ubuntu mirror based on download speed..."
- UBUNTU_MIRROR=$({
- # choose mirrors that are up-to-date by checking the Last-Modified header
for
- {
- # randomly choose up to 10 mirrors using http:// protocol
- # (https isn't supported in docker containers that don't have
ca-certificates installed)
- curl -s http://mirrors.ubuntu.com/mirrors.txt | grep '^http://' | shuf
-n 10
- # also consider Azure's Ubuntu mirror
- echo http://azure.archive.ubuntu.com/ubuntu/
- } | xargs -I {} sh -c 'echo "$(curl -m 5 -sI {}dists/$(lsb_release -c |
cut -f2)-security/Contents-$(dpkg --print-architecture).gz|sed s/\\r\$//|grep
Last-Modified|awk -F": " "{ print \$2 }" | LANG=C date -f- -u +%s)" "{}"' |
sort -rg | awk '{ if (NR==1) TS=$1; if ($1 == TS) print $2 }'
- } | xargs -I {} sh -c 'echo `curl -r 0-102400 -m 5 -s -w %{speed_download}
-o /dev/null {}ls-lR.gz` {}' \
- |sort -g -r |head -1| awk '{ print $2 }')
- if [ -z "$UBUNTU_MIRROR" ]; then
- # fallback to full mirrors list
- UBUNTU_MIRROR="mirror://mirrors.ubuntu.com/mirrors.txt"
- fi
- OLD_MIRROR=$(cat /etc/apt/sources.list | grep '^deb ' | head -1 | awk '{
print $2 }')
- echo "Picked '$UBUNTU_MIRROR'. Current mirror is '$OLD_MIRROR'."
- if [[ "$OLD_MIRROR" != "$UBUNTU_MIRROR" ]]; then
- sudo sed -i "s|$OLD_MIRROR|$UBUNTU_MIRROR|g" /etc/apt/sources.list
- sudo apt-get update
- fi
- # set the chosen mirror also in the UBUNTU_MIRROR and UBUNTU_SECURITY_MIRROR
environment variables
- # that can be used by docker builds
- export UBUNTU_MIRROR
- export UBUNTU_SECURITY_MIRROR=$UBUNTU_MIRROR
- # make environment variables available for later GitHub Actions steps
- if [ -n "$GITHUB_ENV" ]; then
- echo "UBUNTU_MIRROR=$UBUNTU_MIRROR" >> $GITHUB_ENV
- echo "UBUNTU_SECURITY_MIRROR=$UBUNTU_SECURITY_MIRROR" >> $GITHUB_ENV
- fi
-}
-
# installs a tool executable if it's not found on the PATH
function ci_install_tool() {
local tool_executable=$1
@@ -97,9 +62,7 @@ function ci_install_tool() {
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
echo "::group::Installing ${tool_package}"
sudo apt-get -y install ${tool_package} >/dev/null || {
- echo "Installing the package failed. Switching the ubuntu mirror and
retrying..."
- ci_pick_ubuntu_mirror
- # retry after picking the ubuntu mirror
+ echo "Installing the package failed. Retrying..."
sudo apt-get -y install ${tool_package}
}
echo '::endgroup::'
diff --git a/docker/pulsar/Dockerfile b/docker/pulsar/Dockerfile
index 7f1dd837e5f..817c2426377 100644
--- a/docker/pulsar/Dockerfile
+++ b/docker/pulsar/Dockerfile
@@ -56,14 +56,10 @@ RUN chmod g+w /pulsar/trino
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
-ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt
-ARG UBUNTU_SECURITY_MIRROR=http://security.ubuntu.com/ubuntu/
ARG DEFAULT_USERNAME=pulsar
# Install some utilities
-RUN sed -i -e
"s|http://archive\.ubuntu\.com/ubuntu/|${UBUNTU_MIRROR:-mirror://mirrors.ubuntu.com/mirrors.txt}|g"
\
- -e
"s|http://security\.ubuntu\.com/ubuntu/|${UBUNTU_SECURITY_MIRROR:-http://security.ubuntu.com/ubuntu/}|g"
/etc/apt/sources.list \
- && echo 'Acquire::http::Timeout "30";\nAcquire::ftp::Timeout
"30";\nAcquire::Retries "3";' > /etc/apt/apt.conf.d/99timeout_and_retries \
+RUN echo 'Acquire::http::Timeout "30";\nAcquire::ftp::Timeout
"30";\nAcquire::Retries "3";' > /etc/apt/apt.conf.d/99timeout_and_retries \
&& apt-get update \
&& apt-get -y dist-upgrade \
&& apt-get -y install netcat dnsutils less procps iputils-ping \
diff --git a/docker/pulsar/pom.xml b/docker/pulsar/pom.xml
index 2f3fb340e3d..b7077cee499 100644
--- a/docker/pulsar/pom.xml
+++ b/docker/pulsar/pom.xml
@@ -82,8 +82,6 @@
<args>
<PULSAR_TARBALL>target/pulsar-server-distribution-${project.version}-bin.tar.gz</PULSAR_TARBALL>
<PULSAR_CLIENT_PYTHON_VERSION>${pulsar.client.python.version}</PULSAR_CLIENT_PYTHON_VERSION>
- <UBUNTU_MIRROR>${UBUNTU_MIRROR}</UBUNTU_MIRROR>
-
<UBUNTU_SECURITY_MIRROR>${UBUNTU_SECURITY_MIRROR}</UBUNTU_SECURITY_MIRROR>
</args>
<contextDir>${project.basedir}</contextDir>
<tags>
diff --git a/pom.xml b/pom.xml
index 016ad8fbb10..f23c02cf547 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,9 +84,6 @@ flexible messaging model and an intuitive client
API.</description>
<pulsar.client.python.version>3.8.0</pulsar.client.python.version>
- <UBUNTU_MIRROR>http://archive.ubuntu.com/ubuntu/</UBUNTU_MIRROR>
-
<UBUNTU_SECURITY_MIRROR>http://security.ubuntu.com/ubuntu/</UBUNTU_SECURITY_MIRROR>
-
<!--config keys to configure test selection -->
<include>**/Test*.java,**/*Test.java,**/*Tests.java,**/*TestCase.java</include>
<exclude/>
@@ -2770,19 +2767,6 @@ flexible messaging model and an intuitive client
API.</description>
</modules>
</profile>
- <profile>
- <id>ubuntu-mirror-set</id>
- <activation>
- <property>
- <name>env.UBUNTU_MIRROR</name>
- </property>
- </activation>
- <properties>
- <!-- Override the default value with the environment variable -->
- <UBUNTU_MIRROR>${env.UBUNTU_MIRROR}</UBUNTU_MIRROR>
- </properties>
- </profile>
-
<profile>
<id>jdk21</id>
<activation>
@@ -2823,19 +2807,6 @@ flexible messaging model and an intuitive client
API.</description>
</build>
</profile>
- <profile>
- <id>ubuntu-security-mirror-set</id>
- <activation>
- <property>
- <name>env.UBUNTU_SECURITY_MIRROR</name>
- </property>
- </activation>
- <properties>
- <!-- Override the default value with the environment variable -->
-
<UBUNTU_SECURITY_MIRROR>${env.UBUNTU_SECURITY_MIRROR}</UBUNTU_SECURITY_MIRROR>
- </properties>
- </profile>
-
</profiles>
<repositories>
diff --git a/tests/docker-images/java-test-image/Dockerfile
b/tests/docker-images/java-test-image/Dockerfile
index 5821e6eeaea..44d9aac5f50 100644
--- a/tests/docker-images/java-test-image/Dockerfile
+++ b/tests/docker-images/java-test-image/Dockerfile
@@ -33,12 +33,8 @@ RUN chmod a+rx /pulsar/bin/*
WORKDIR /pulsar
ARG DEBIAN_FRONTEND=noninteractive
-ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt
-ARG UBUNTU_SECURITY_MIRROR=http://security.ubuntu.com/ubuntu/
-RUN sed -i -e
"s|http://archive\.ubuntu\.com/ubuntu/|${UBUNTU_MIRROR:-mirror://mirrors.ubuntu.com/mirrors.txt}|g"
\
- -e
"s|http://security\.ubuntu\.com/ubuntu/|${UBUNTU_SECURITY_MIRROR:-http://security.ubuntu.com/ubuntu/}|g"
/etc/apt/sources.list \
- && apt-get update \
+RUN apt-get update \
&& apt-get -y dist-upgrade \
&& apt-get -y install wget apt-transport-https
diff --git a/tests/docker-images/java-test-image/pom.xml
b/tests/docker-images/java-test-image/pom.xml
index 7112d9a359e..ebfeb4614d8 100644
--- a/tests/docker-images/java-test-image/pom.xml
+++ b/tests/docker-images/java-test-image/pom.xml
@@ -35,8 +35,6 @@
<id>docker</id>
<properties>
<docker.buildArg.PULSAR_TARBALL>target/pulsar-server-distribution-bin.tar.gz</docker.buildArg.PULSAR_TARBALL>
-
<docker.buildArg.UBUNTU_MIRROR>${UBUNTU_MIRROR}</docker.buildArg.UBUNTU_MIRROR>
-
<docker.buildArg.UBUNTU_SECURITY_MIRROR>${UBUNTU_SECURITY_MIRROR}</docker.buildArg.UBUNTU_SECURITY_MIRROR>
</properties>
<activation>
<property>