-
-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(jdk): Add Java 25 preview target for all images #939
base: master
Are you sure you want to change the base?
Conversation
Fixes #6 Add Java 25 target for all images in docker bake and other necessary places. * Modify `docker-bake.hcl` to include Java 25 in various targets and functions. * Update `alpine/Dockerfile`, `debian/Dockerfile`, and `rhel/ubi9/Dockerfile` to handle Java 25 in the `jlink` command. * Modify `build.ps1` to include Java 25 in the `jdks_to_build` variable and update the `Test-Image` function. * Update `updatecli/updatecli.d/jdk21.yaml` to `updatecli/updatecli.d/jdk25.yaml` and modify relevant fields for Java 25. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/gounthar/docker-agent/issues/6?shareId=XXXX-XXXX-XXXX-XXXX).
Co-authored-by: Tim Jacomb <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thanks, Hervé! 👍 Co-authored-by: lemeurherveCB <[email protected]>
"17."*) options="--compress=2 --add-modules ALL-MODULE-PATH" ;; \ | ||
"21."*) options="--compress=zip-6 --add-modules ALL-MODULE-PATH" ;; \ | ||
"25"*) options="--compress=zip-6 --add-modules java.base,java.logging,java.xml,java.se" ;; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the $options
variable defined instead of set --
returned with $1
is more clear for L52, 👍
"17."*) options="--compress=2 --add-modules ALL-MODULE-PATH" ;; \ | ||
"21."*) options="--compress=zip-6 --add-modules ALL-MODULE-PATH" ;; \ | ||
"25"*) options="--compress=zip-6 --add-modules java.base,java.logging,java.xml,java.se" ;; \ | ||
*) echo "Unsupported Java version ($(jlink --version 2>&1))" && exit 1 ;; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: why this comment change?
I remember questioning myself about this comment and its meaning, and AFAIR that concerns a jlink version pattern, not the Java version. (Could be wrong though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with the history behind that previous comment. I made this change because the original comment didn't make sense to me, and I haven't encountered such a scenario.
Now that we have three different Java versions, I thought it would be better to use this comment about the Java version, even though I highly doubt we'll ever see it since the versions we pass as arguments are defined in docker-bake.hcl
.
I'm fine with reverting to the old comment if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would apply the Chesterton's fence principle here, but fine either way too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for bringing up Chesterton's fence—it's a great principle to ensure we don't remove something valuable without understanding its purpose.🙏
That being said, I believe it also highlights the importance of questioning the status quo when the original reasoning has been lost to time or is no longer relevant.
In this case, since no one seems to recall the exact context or reasoning behind the original comment, it feels like we're in a situation similar to the famous thought experiment with the monkeys, the bananas, and the ladder.
Sometimes practices or comments persist simply because 'that's how it's always been,' even when their original purpose no longer applies.
I made this change because the old comment didn't make sense to me in the current context, and I wanted to make it clearer for anyone reading or maintaining this code in the future.
Nevertheless, I'm open to reverting it if we think preserving the old comment is more valuable, but I do think it's worth revisiting these things from time to time. 😊
Co-authored-by: lemeurherveCB <[email protected]>
The `-preview` is replicated in the URL (https://api.adoptium.net/v3/binary/version/jdk-25%2B9-ea-beta-preview/alpine-linux/x64/jdk/hotspot/normal/eclipse?project=jdk.), leading to a 404. We have to find a workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gounthar The -preview
suffix for JDK25 can be added in the tags
sections of the targets to avoid failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposing #944 to simplify tags management and to automatically take in account JDK in preview.
nanoserver image build fails.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've compared the list of tags generated from this PR and from #944, except the "jdk25-preview" for Windows they are the same, LGTM!
Some suggestions about HCL formatting and rhel_ubi9 jdk to build.
] | ||
platforms = debian_platforms(jdk) | ||
} | ||
|
||
target "rhel_ubi9" { | ||
matrix = { | ||
type = agent_types_to_build | ||
jdk = [17, 21] | ||
jdk = [17, 21, 25] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jdk = [17, 21, 25] | |
jdk = jdks_to_build |
todo: no need for a special treatment here anymore. (Should have been part of #890 ideally), and restore spacing part of HCL formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -324,19 +350,21 @@ target "nanoserver" { | |||
target = type | |||
tags = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: keep "jdk25-preview" like in the Linux distribution instead of adding only "preview" at the end of the tag, help with consistency (as all Windows tags end with the Windows flavor), and allow regrouping tags definition together without a special case for this (cf #944)
Alternative: wait for #944 to be merged to simplify this PR.
: "", | ||
equal(ON_TAG, "true") ? | ||
"${REGISTRY}/${orgrepo(type)}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine${ALPINE_SHORT_TAG}-jdk${jdk}${equal(jdk, 25) ? "-preview" : ""}" | ||
: "", | ||
# If there is a tag and if the jdk is the default one, add Alpine short tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: restore spacing on the lines below, no need for a space indentation on them.
alternative: wait for #944 to be merged.
type = windowsagenttypes(WINDOWS_AGENT_TYPE_OVERRIDE) | ||
jdk = jdks_to_build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type = windowsagenttypes(WINDOWS_AGENT_TYPE_OVERRIDE) | |
jdk = jdks_to_build | |
type = windowsagenttypes(WINDOWS_AGENT_TYPE_OVERRIDE) | |
jdk = jdks_to_build |
suggestion: restore spacing, part of HCL formatting.
] | ||
platforms = ["windows/amd64"] | ||
} | ||
|
||
target "windowsservercore" { | ||
matrix = { | ||
type = windowsagenttypes(WINDOWS_AGENT_TYPE_OVERRIDE) | ||
jdk = jdks_to_build | ||
type = windowsagenttypes(WINDOWS_AGENT_TYPE_OVERRIDE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
@@ -352,11 +380,13 @@ target "windowsservercore" { | |||
target = type | |||
tags = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
Introduction
The upcoming release of JDK 25 in October 2025 marks a significant milestone for Java developers, bringing new features and enhancements. Early adoption and testing of JDK 25 are crucial for ensuring compatibility and leveraging its improvements. By starting with Jenkins agent images, we can iterate incrementally, eventually extending support to Jenkins controller images and the broader Jenkins infrastructure.
Why Start with Jenkins Agent Images?
These changes introduce support for JDK 25 across multiple build configurations. The Dockerfiles now feature a new conditional branch in the
jlink
command to apply"--compress=zip-6 --add-modules java.base,java.logging,java.xml,java.se"
when detecting a JDK version starting with "25." The build configurations and targets have been updated indocker-bake.hcl
, along with the necessaryupdatecli
YAML configuration adjustments. Additionally, the Windows Server Core Dockerfile is modified to install and point to JDK 25, while the build script has been reformatted without functional changes.JDK 25 requires the
--module-path
option when usingALL-MODULE-PATH
. JDK 24 and 25 of Temurin enable JEP 493.Currently, I've added a minimal set of modules (
java.base,java.logging,java.xml,java.se
) detected usingjdeps -cp "agent.jar:slave.jar" -R --print-module-deps --ignore-missing-deps agent.jar
, though this might not suffice in the long run. We will need to add more than just this limited set of modules, but not necessarily all 69 of them.Keeping the JDK25 version updated
If this PR is merged, I will then supply an
updatecli
manifest to keep the version updated.Testing done
make every-build
Submitter checklist