-
Notifications
You must be signed in to change notification settings - Fork 7
635 chore use jdk 25 and aot caching on quarkus playground #636
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
Merged
fugerit79
merged 7 commits into
main
from
635-chore-use-jdk-25-and-aot-caching-on-quarkus-playground
Apr 4, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cdd047c
chore: added integration test
fugerit79 b84ef18
chore: fj-doc-playground-quarkus base image ubi9/openjdk-25-runtime:1…
fugerit79 7ae7c6a
feat: enabled AOT caching
fugerit79 312b160
feat: dockerfile with two stages
fugerit79 e31b9da
Update fj-doc-playground-quarkus/src/test/java/org/fugerit/java/doc/p…
fugerit79 ca03d20
Update fj-doc-playground-quarkus/src/test/java/org/fugerit/java/doc/p…
fugerit79 af47d91
fix: create placeholder app.aot when AOT cache generation fails to pr…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,51 @@ | ||
| # fj-doc-playground-quarkus image build 1.0.0 | ||
| # | ||
| # Public built image form amd64/arm64 linux can be found on repository : | ||
| # https://hub.docker.com/repository/docker/fugeritorg/fj-doc-playground-quarkus/general | ||
| # | ||
| # create : docker run -it -p 8080:8080 --name fj-doc-playground-quarkus fugeritorg/fj-doc-playground-quarkus:latest | ||
| # start : docker start fj-doc-playground-quarkus | ||
| # stop : docker stop fj-doc-playground-quarkus | ||
| # | ||
| # Image tag : | ||
| # docker image tag [image tag] fugeritorg/fj-doc-playground-quarkus:latest | ||
| # | ||
| # Change with any base openjdk image is preferred | ||
| FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.22-1.1753981256 | ||
| # ---- Stage 1: Build AOT cache ---- | ||
| FROM registry.access.redhat.com/ubi9/openjdk-25-runtime:1.24-2.1774011800 AS aot-builder | ||
|
|
||
| COPY --chown=185:0 target/quarkus-app/lib/ /deployments/lib/ | ||
| COPY --chown=185:0 target/quarkus-app/*.jar /deployments/ | ||
| COPY --chown=185:0 target/quarkus-app/app/ /deployments/app/ | ||
| COPY --chown=185:0 target/quarkus-app/quarkus/ /deployments/quarkus/ | ||
|
|
||
| WORKDIR /deployments | ||
|
|
||
| USER root | ||
|
|
||
| RUN timeout 120 java -XX:AOTCacheOutput=app.aot \ | ||
| -Xlog:aot*=debug:file=/tmp/aot.log \ | ||
| -Dquarkus.application.exit-on-startup=true \ | ||
| -jar quarkus-run.jar > /tmp/app.log 2>&1 || true && \ | ||
| echo "=== AOT Cache Generation Log ===" && \ | ||
| tail -50 /tmp/app.log && \ | ||
| if [ -f /tmp/aot.log ]; then echo "=== AOT Debug Log ===" && tail -50 /tmp/aot.log; fi && \ | ||
| echo "=== Checking for AOT cache ===" && \ | ||
| if [ -f /deployments/app.aot ]; then \ | ||
| echo "✓ AOT cache generated successfully"; \ | ||
| ls -lh /deployments/app.aot; \ | ||
| else \ | ||
| echo "⚠ WARNING: AOT cache file not generated, creating placeholder"; \ | ||
| touch /deployments/app.aot; \ | ||
| fi | ||
|
|
||
| USER 185:0 | ||
|
|
||
| # ---- Stage 2: Runtime image ---- | ||
| FROM registry.access.redhat.com/ubi9/openjdk-25-runtime:1.24-2.1774011800 | ||
|
|
||
| LABEL org.opencontainers.image.authors="Fugerit" \ | ||
| org.opencontainers.image.source="Quarkus" \ | ||
| org.opencontainers.image.revision="1.0.0" | ||
|
|
||
|
|
||
| COPY --chown=185:0 target/quarkus-app/lib/ /deployments/lib/ | ||
| COPY --chown=185:0 target/quarkus-app/*.jar /deployments/ | ||
| COPY --chown=185:0 target/quarkus-app/app/ /deployments/app/ | ||
| COPY --chown=185:0 target/quarkus-app/quarkus/ /deployments/quarkus/ | ||
|
|
||
| # Copia l'AOT cache generata nello stage precedente | ||
| COPY --chown=185:0 --from=aot-builder /deployments/app.aot /deployments/app.aot | ||
|
|
||
| WORKDIR /deployments | ||
|
|
||
| EXPOSE 8080 | ||
|
|
||
| # Run with AOT cache if available, otherwise normal startup | ||
| CMD ["sh", "-c", "cd /deployments && if [ -f app.aot ] && [ -s app.aot ]; then echo 'Starting with AOT cache...'; java -XX:AOTCache=app.aot -jar quarkus-run.jar; else echo 'Starting without AOT cache...'; java -jar quarkus-run.jar; fi"] | ||
8 changes: 8 additions & 0 deletions
8
fj-doc-playground-quarkus/src/test/java/org/fugerit/java/doc/playground/CatalogRestIt.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package org.fugerit.java.doc.playground; | ||
|
|
||
| import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
|
||
| @QuarkusIntegrationTest | ||
| class CatalogRestIt extends CatalogRestTest { | ||
|
|
||
| } |
8 changes: 8 additions & 0 deletions
8
...playground-quarkus/src/test/java/org/fugerit/java/doc/playground/ConfigConvertRestIt.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package org.fugerit.java.doc.playground; | ||
|
|
||
| import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
|
||
| @QuarkusIntegrationTest | ||
| class ConfigConvertRestIt extends ConfigConvertRestTest { | ||
|
|
||
| } |
8 changes: 8 additions & 0 deletions
8
fj-doc-playground-quarkus/src/test/java/org/fugerit/java/doc/playground/ConfigRestIt.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package org.fugerit.java.doc.playground; | ||
|
|
||
| import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
|
||
| @QuarkusIntegrationTest | ||
| class ConvertRestIt extends ConvertRestTest { | ||
|
|
||
| } |
8 changes: 8 additions & 0 deletions
8
fj-doc-playground-quarkus/src/test/java/org/fugerit/java/doc/playground/GenerateRestIt.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package org.fugerit.java.doc.playground; | ||
|
|
||
| import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
|
||
| @QuarkusIntegrationTest | ||
| class GenerateRestIt extends GenerateRestTest { | ||
|
|
||
| } |
8 changes: 8 additions & 0 deletions
8
fj-doc-playground-quarkus/src/test/java/org/fugerit/java/doc/playground/ValRestIt.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package org.fugerit.java.doc.playground; | ||
|
|
||
| import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
|
||
| @QuarkusIntegrationTest | ||
| class ValRestIt extends ValRestTest { | ||
|
|
||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The AOT generation step explicitly warns that
/deployments/app.aotmight not be generated, but the runtime stage unconditionallyCOPYs that file fromaot-builder. If AOT generation fails or times out, the Docker build will fail at thisCOPY. To make the build resilient, ensure the file always exists (e.g., create an empty placeholder when missing) or adjust the build so the runtime stage doesn’t depend on a conditional artifact.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.
@copilot apply changes based on this feedback
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.
Ok thanks for the feedback
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.
Fixed in af47d91. When AOT cache generation fails or times out, the builder stage now runs
touch /deployments/app.aotto create an empty placeholder, ensuring theCOPYin the runtime stage always succeeds. The existing[ -s app.aot ]check in theCMDalready handles the empty-file case by falling back to normal startup.