Skip to content
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

fix: switch to Adoptium Temurin installer instead of Docker image #154

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

dduportal
Copy link

@dduportal dduportal commented Apr 24, 2024

This PR aims at fixing the build failures on #150 #151 and #152 (ref. jenkins-infra/helpdesk#4058) as the Docker images of Adoptium Temurin are not available for the last JDK versions, by using the Temurin installer instead of the docker image. Inspired by jenkinsci/docker-agent#787

It introduces the following changes:

  • Installation of the adoptium MSIs happens in the python-core stage which uses a Windows Server Core base: misexec.exe does not exist on Nanoserver.
    • Moving ARG JAVA_VERSION into the Python stage's scope as a consequence to avoid repetition out and in the scope
    • The JDK versions specified by the ARG JAVA_VERSION build arguments is changed to allow using the same download code (for future factorization), which breaks the updatecli for now (see notes below):
    • The prefix jdk- is added for JDK11, JDK17 and JDK21. The prefix jdk is added for JDK8.
    • The character + is usedinstead of _ to avoid further transformations: the Docker images where using _ for their tags
  • Faster build due to less layers to pull (ref. feat(Windows): switch from temurin base images to temurin installer jenkinsci/docker-agent#787)
  • Retrieving the netapi32 DLL and `whoami.exe`` from the Python parent image instead of Temurin image
  • Pin JDK21 version to 21+35 to ensure a valid installer is retrieved
  • Cleanups to ensure the 4 Dockerfiles are as close as possible

Notes:

  • No updatecli manifests are changed: This PR breaks the current manifests. A subsequent PR is required to fix them.
  • No jlink to "tune" the JDK but can be done on subsequent PR (cc @lemeurherve for info). But the JDK is installed into C:\javaruntime which is static.
  • No factorization (yet?) as the pipeline library does not support passing custom build arguments to docker build, it does not support docker-compose.yml and Windows container do not work with Docker BuildX.

@dduportal dduportal changed the title Fix/jdks use installer fix: switch to Adoptium Temurin installer instead of Docker image Apr 24, 2024
@dduportal dduportal marked this pull request as ready for review April 24, 2024 15:09
It introduces the following changes:

- Faster build due to less layers to pull (ref. jenkinsci/docker-agent#787)
- Retrieving the `netapi32` DLL and `whoami.exe`` from the Python parent image instead of Temurin image
- Moving `ARG JAVA_VERSION` into the last stage's scope
- Pin JDK21 version to 21+35 to ensure a valid installer is retrieved

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
@dduportal dduportal merged commit e2b3c55 into jenkins-infra:main Apr 24, 2024
2 checks passed
@dduportal dduportal deleted the fix/jdks-use-installer branch April 24, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant