Skip to content

Commit

Permalink
Support specifying Ubuntu mirror for docker image builds (apache#14095)
Browse files Browse the repository at this point in the history
- use UBUNTU_MIRROR environment variable to specify
- default to closest mirrors (http://mirrors.ubuntu.com/mirrors.txt)
- use Azure's Ubuntu mirror in CI
  • Loading branch information
lhotari authored and nicklixinyang committed Apr 20, 2022
1 parent 33fdeb0 commit 25f81c7
Show file tree
Hide file tree
Showing 19 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-integration-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-integration-function.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-integration-messaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-integration-process.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-integration-pulsar-io-ora.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-integration-pulsar-io.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-integration-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-integration-sql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Xmx768m -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/
MALLOC_ARENA_MAX: "1"

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-integration-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-integration-thread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-integration-tiered-filesystem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-integration-tiered-jcloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-integration-transaction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-shade-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ on:

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/

jobs:

Expand Down
6 changes: 4 additions & 2 deletions docker/pulsar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ RUN mkdir /pulsar/data
FROM ubuntu:20.04

ARG DEBIAN_FRONTEND=noninteractive
ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt

# Install some utilities
RUN apt-get update \
RUN sed -i "s|http://archive\.ubuntu\.com/ubuntu/|${UBUNTU_MIRROR:-mirror://mirrors.ubuntu.com/mirrors.txt}|g" /etc/apt/sources.list \
&& apt-get update \
&& apt-get -y dist-upgrade \
&& apt-get -y install openjdk-11-jdk-headless netcat dnsutils less procps iputils-ping \
python3 python3-dev python3-setuptools python3-yaml python3-kazoo \
Expand All @@ -69,4 +71,4 @@ ENV PULSAR_ROOT_LOGGER=INFO,CONSOLE
COPY --from=pulsar /pulsar /pulsar
WORKDIR /pulsar

RUN /pulsar/bin/install-pulsar-client.sh
RUN /pulsar/bin/install-pulsar-client.sh
1 change: 1 addition & 0 deletions docker/pulsar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
<tag>${project.version}</tag>
<buildArgs>
<PULSAR_TARBALL>target/pulsar-server-distribution-${project.version}-bin.tar.gz</PULSAR_TARBALL>
<UBUNTU_MIRROR>${env.UBUNTU_MIRROR}</UBUNTU_MIRROR>
</buildArgs>
</configuration>
</plugin>
Expand Down
6 changes: 4 additions & 2 deletions tests/docker-images/java-test-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ RUN chmod a+rx /pulsar/bin/*
WORKDIR /pulsar

ARG DEBIAN_FRONTEND=noninteractive
ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt

RUN apt-get update \
RUN sed -i "s|http://archive\.ubuntu\.com/ubuntu/|${UBUNTU_MIRROR:-mirror://mirrors.ubuntu.com/mirrors.txt}|g" /etc/apt/sources.list \
&& apt-get update \
&& apt-get -y dist-upgrade \
&& apt-get -y install openjdk-11-jdk-headless

Expand Down Expand Up @@ -69,4 +71,4 @@ RUN chown -R pulsar:0 /pulsar && chmod -R g=u /pulsar
RUN apt-get -y --purge autoremove \
&& apt-get autoclean \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/*
1 change: 1 addition & 0 deletions tests/docker-images/java-test-image/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
<noCache>true</noCache>
<buildArgs>
<PULSAR_TARBALL>target/pulsar-server-distribution-bin.tar.gz</PULSAR_TARBALL>
<UBUNTU_MIRROR>${env.UBUNTU_MIRROR}</UBUNTU_MIRROR>
</buildArgs>
</configuration>
</plugin>
Expand Down

0 comments on commit 25f81c7

Please sign in to comment.