Skip to content

Commit 3e4e908

Browse files
amuraruCopilot
andauthored
chore: migrate ZooKeeper images and builds to Java 25 (#68)
Update Java runtimes, Kotlin bytecode targets, CodeQL, and release metadata to Java 25. Require Java 25 and verify the zu helper starts in image smoke tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f1396d0 commit 3e4e908

6 files changed

Lines changed: 26 additions & 18 deletions

File tree

‎.github/workflows/codeql.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ jobs:
4949
with:
5050
go-version-file: go.mod
5151

52-
- name: Set up JDK 21
52+
- name: Set up JDK 25
5353
if: matrix.language == 'java'
5454
uses: actions/setup-java@v6
5555
with:
56-
java-version: '21'
56+
java-version: '25'
5757
distribution: 'temurin'
5858

5959
- name: Initialize CodeQL

‎.github/workflows/release.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ jobs:
119119
type=raw,value=${{ needs.prepare.outputs.zk_version }}-apache-${{ needs.prepare.outputs.tag }}
120120
type=raw,value=${{ needs.prepare.outputs.zk_version }}-apache
121121
labels: |
122-
org.opencontainers.image.description=Apache Zookeeper ${{ needs.prepare.outputs.zk_version }} with OpenJDK 21
123-
# Rebuilt on every release, so it also picks up the latest JDK 21 patch
122+
org.opencontainers.image.description=Apache Zookeeper ${{ needs.prepare.outputs.zk_version }} with OpenJDK 25
123+
# Rebuilt on every release, so it also picks up the latest JDK 25 patch
124124
# release and Debian security updates.
125125
- name: Build and push zookeeper Apache image
126126
id: build-zk-apache
@@ -153,7 +153,7 @@ jobs:
153153
tags: |
154154
type=raw,value=${{ needs.prepare.outputs.zk_version }}-${{ needs.prepare.outputs.tag }}
155155
labels: |
156-
org.opencontainers.image.description=Apache Zookeeper image build with java-21
156+
org.opencontainers.image.description=Apache Zookeeper image build with java-25
157157
- name: Build and push zookeeper image
158158
id: build-zk
159159
uses: docker/build-push-action@v7

‎.github/workflows/zookeeper-images.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,16 @@ jobs:
8787
run: |
8888
docker run --rm --entrypoint bash -e ZK_VERSION zookeeper:ci -ec '
8989
java -version
90+
java -XshowSettings:properties -version 2>&1 | grep -Eq "^[[:space:]]*java.specification.version = 25$"
9091
zkServer.sh version 2>/dev/null | tee /dev/stderr | grep -q "${ZK_VERSION}"
9192
test -s /opt/libs/zu.jar
93+
set +e
94+
zu_output="$(java -jar /opt/libs/zu.jar 2>&1)"
95+
zu_status=$?
96+
set -e
97+
printf "%s\n" "$zu_output"
98+
test "$zu_status" -eq 1
99+
[[ "$zu_output" == "Usage: zu "* ]]
92100
for s in zookeeperStart.sh zookeeperReady.sh zookeeperLive.sh zookeeperTeardown.sh zookeeperMetrics.sh; do
93101
test -x "/usr/local/bin/${s}"
94102
done

‎docker/Dockerfile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
# http://www.apache.org/licenses/LICENSE-2.0
1010
#
1111

12-
# Base Apache ZooKeeper + OpenJDK 21 image built from docker/zookeeper-image.
12+
# Base Apache ZooKeeper + OpenJDK 25 image built from docker/zookeeper-image.
1313
# It is not pinned here: the build-zookeeper release job builds that image
1414
# first and passes its digest in, so both always come from the same commit
1515
# and ARG ZK_VERSION. For local builds use `make build-zk-image`.
1616
ARG BASE_IMAGE
1717

1818
# zu.jar is architecture-independent bytecode, so build it once on the native
1919
# build platform instead of re-running Gradle under emulation for every target.
20-
FROM --platform=$BUILDPLATFORM gradle:jdk21 AS zu-builder
20+
FROM --platform=$BUILDPLATFORM gradle:jdk25 AS zu-builder
2121

2222
RUN mkdir /zu
2323
COPY zu /zu
@@ -34,7 +34,7 @@ RUN apt-get -q update && \
3434

3535
# OCI standard labels
3636
LABEL org.opencontainers.image.title="Apache Zookeeper"
37-
LABEL org.opencontainers.image.description="Apache Zookeeper image build with java-21"
37+
LABEL org.opencontainers.image.description="Apache Zookeeper image build with java-25"
3838
LABEL org.opencontainers.image.source="https://github.com/adobe/zookeeper-operator"
3939
LABEL org.opencontainers.image.url="https://github.com/adobe/zookeeper-operator"
4040
LABEL org.opencontainers.image.documentation="https://github.com/adobe/zookeeper-operator"

‎docker/zookeeper-image/Dockerfile‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ RUN set -eux; \
88
; \
99
rm -rf /var/lib/apt/lists/*
1010

11-
ENV JAVA_HOME=/usr/local/openjdk-21
11+
ENV JAVA_HOME=/usr/local/openjdk-25
1212
ENV PATH=$JAVA_HOME/bin:$PATH
1313

1414
# Default to UTF-8 file.encoding
1515
ENV LANG=C.UTF-8
16-
ENV JAVA_VERSION=21
16+
ENV JAVA_VERSION=25
1717

1818
RUN set -eux; \
1919
\
2020
arch="$(dpkg --print-architecture)"; \
2121
case "$arch" in \
2222
'amd64') \
23-
downloadUrl='https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz'; \
24-
downloadSha256='https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz.sha256'; \
23+
downloadUrl='https://download.oracle.com/java/25/latest/jdk-25_linux-x64_bin.tar.gz'; \
24+
downloadSha256='https://download.oracle.com/java/25/latest/jdk-25_linux-x64_bin.tar.gz.sha256'; \
2525
;; \
2626
'arm64') \
27-
downloadUrl='https://download.oracle.com/java/21/latest/jdk-21_linux-aarch64_bin.tar.gz'; \
28-
downloadSha256='https://download.oracle.com/java/21/latest/jdk-21_linux-aarch64_bin.tar.gz.sha256'; \
27+
downloadUrl='https://download.oracle.com/java/25/latest/jdk-25_linux-aarch64_bin.tar.gz'; \
28+
downloadSha256='https://download.oracle.com/java/25/latest/jdk-25_linux-aarch64_bin.tar.gz.sha256'; \
2929
;; \
3030
*) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;; \
3131
esac; \
@@ -163,7 +163,7 @@ ENV PATH=$PATH:/$DISTRO_NAME/bin \
163163

164164
# OCI standard labels
165165
LABEL org.opencontainers.image.title="Apache Zookeeper"
166-
LABEL org.opencontainers.image.description="Apache Zookeeper ${ZK_VERSION} with OpenJDK 21"
166+
LABEL org.opencontainers.image.description="Apache Zookeeper ${ZK_VERSION} with OpenJDK 25"
167167
LABEL org.opencontainers.image.source="https://github.com/adobe/zookeeper-operator"
168168
LABEL org.opencontainers.image.url="https://github.com/adobe/zookeeper-operator"
169169
LABEL org.opencontainers.image.documentation="https://github.com/adobe/zookeeper-operator"

‎docker/zu/build.gradle.kts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ repositories {
1212
}
1313

1414
java {
15-
sourceCompatibility = JavaVersion.VERSION_21
16-
targetCompatibility = JavaVersion.VERSION_21
15+
sourceCompatibility = JavaVersion.VERSION_25
16+
targetCompatibility = JavaVersion.VERSION_25
1717
}
1818

1919
dependencies {
@@ -30,6 +30,6 @@ tasks.withType<ShadowJar>() {
3030

3131
tasks.withType<KotlinCompile> {
3232
compilerOptions {
33-
jvmTarget.set(JvmTarget.JVM_21)
33+
jvmTarget.set(JvmTarget.JVM_25)
3434
}
3535
}

0 commit comments

Comments
 (0)