Skip to content

Upgrade Native Image Containerization workshop (what-the-dickens) to GraalVM for JDK 24.#26

Merged
olyagpl merged 2 commits into
mainfrom
upgrade-what-the-dickens-to-jdk24
Jun 3, 2025
Merged

Upgrade Native Image Containerization workshop (what-the-dickens) to GraalVM for JDK 24.#26
olyagpl merged 2 commits into
mainfrom
upgrade-what-the-dickens-to-jdk24

Conversation

@olyagpl

@olyagpl olyagpl commented May 22, 2025

Copy link
Copy Markdown
Member
  1. Upgraded what-the-dickens Native Image workshop to GraalVM for JDK 24 and latest Native Build Tools.
  2. Added the missing GitHub workflow that run steps to testing all Docker builds.
  3. Dockerfiles required updates.

There is no Luna Labs version of this workshop.

@olyagpl olyagpl self-assigned this May 22, 2025
@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 22, 2025
@olyagpl olyagpl force-pushed the upgrade-what-the-dickens-to-jdk24 branch from 0f9179f to b152d23 Compare May 23, 2025 11:43
</parent>
<groupId>com.example</groupId>
<artifactId>What_the_Dickens</artifactId>
<artifactId>what_the_dickens</artifactId>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the artifactId for lowercase. 
Otherwise, Paketo Buildpacks build fails with:

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.5:build-image (default-cli) on project What_the_Dickens: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.0.5:build-image failed: Unable to parse name "What_the_Dickens". Image name must be in the form '[domainHost:port/][path/]name', with 'path' and 'name' containing only [a-z0-9][.][_][-] -> [Help 1]

</build>
</profile>
<profile>
<id>mostly-static</id>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a separate profile to test this Docker build with a GitHub workflow pipeline. No changes were required to the text in README. I only updated the Maven build command in native-image/what-the-dickens/lab/02-smaller-containers/Dockerfile to RUN ./mvnw --no-transfer-progress -Pnative,mostly-static -DskipTests=true clean package.

@olyagpl olyagpl force-pushed the upgrade-what-the-dickens-to-jdk24 branch from 3a0aaca to f5edfa3 Compare May 23, 2025 17:17
Stop the application before you move on, using Ctrl-C.
6. Stop the application before you move on as before (type `fg` and then Ctrl-C).

## **STEP 3**: Reducing the Startup Time of Your Native Executable

@olyagpl olyagpl May 23, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step doesn't work (and it isn't being tested with GitHub workflow).
Since the intialization strategy evolved in Native Image since JDK 17, --initialize-at-build-time=com.example.DickensController,rita.RiMarkov,rita.Util,rita.Tokenizer,rita.RiTa causes the build to fail. I need to spend more time on this step. Or we just remove it all together and don't promote class initialization options.

@olyagpl olyagpl force-pushed the upgrade-what-the-dickens-to-jdk24 branch from bb20163 to ccd6a7b Compare May 27, 2025 10:53
@olyagpl olyagpl force-pushed the upgrade-what-the-dickens-to-jdk24 branch from dab1b1f to 20b05e7 Compare May 31, 2025 11:08
shaunsmith
shaunsmith previously approved these changes Jun 2, 2025
@olyagpl olyagpl merged commit bbd6c56 into main Jun 3, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants