Skip to content

Introduce support for JEP 483's new AOT cache#46169

Merged
geoand merged 3 commits intoquarkusio:mainfrom
geoand:jep-483
Feb 11, 2025
Merged

Introduce support for JEP 483's new AOT cache#46169
geoand merged 3 commits intoquarkusio:mainfrom
geoand:jep-483

Conversation

@geoand
Copy link
Copy Markdown
Contributor

@geoand geoand commented Feb 10, 2025

This works in much the same way as AppCDS does -
it allows us to create an archive at build time
without the training run.
This is done by launching the application up to
a known point where no connections are made,
therefore capturing a good portion of the classes
that will be needed for the entire startup without
the hassle of introducing a proper training run.

This obviously only work on JDK 24+

@quarkus-bot

This comment has been minimized.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 10, 2025

🙈 The PR is closed and the preview is expired.

@quarkus-bot

This comment has been minimized.

Comment thread docs/src/main/asciidoc/appcds.adoc Outdated
@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@geoand geoand requested a review from maxandersen February 11, 2025 06:26
@geoand
Copy link
Copy Markdown
Contributor Author

geoand commented Feb 11, 2025

Given that it would be very nice to have this for 3.19, can we get this merged?

cc @gsmet

Copy link
Copy Markdown
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

I added some comments.

Maybe let's get this in to make sure it's in the CR1 and then we can polish before Final?

I let you judge of that, we need things merged before tomorrow morning early, latest.

this.type = type;
}

public Path getAppCDSDir() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally, we would change this name but let's do it in a follow-up so that we can make sure we push this one to 3.19.

private final Path dir;
private final JvmStartupOptimizerArchiveType type;

public AppCDSRequestedBuildItem(Path appCDSDir) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The name of the build item is not ideal if we want to make it something generic.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I know, but I didn't want to rename it until after the next LTS (although it's highly unlikely to be used anywhere)

Comment on lines 21 to +23
public AppCDSResultBuildItem(Path appCDS) {
this(appCDS, JvmStartupOptimizerArchiveType.AppCDS);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here about the names of build items and variables/fields.

this.type = type;
}

public Path getAppCDS() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here for the method name.

Comment thread docs/src/main/asciidoc/appcds.adoc Outdated
Comment thread docs/src/main/asciidoc/appcds.adoc Outdated
This works in much the same way as AppCDS does -
it allows us to create an archive at build time
without the training run.
This is done by launching the application up to
a known point where no connections are made,
therefore capturing a good portion of the classes
that will be needed for the entire startup without
the hassle of introducing a proper training run.
@quarkus-bot
Copy link
Copy Markdown

quarkus-bot Bot commented Feb 11, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 8035406.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

@gsmet
Copy link
Copy Markdown
Member

gsmet commented Feb 11, 2025

FWIW, one approach we use quite often is:

  • Deprecate the old build item
  • Use brand new build items
  • Have a small compatibility layer than produces either one based on the other depending on the requirements

Now I'm not entirely sure it's worth it in this case and I agree we can keep it as is for the current LTS and change it after that.

@geoand
Copy link
Copy Markdown
Contributor Author

geoand commented Feb 11, 2025

👌.

Let's revisit once we branch for 3.19

@quarkus-bot
Copy link
Copy Markdown

quarkus-bot Bot commented Feb 11, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 8035406.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 17

📦 extensions/infinispan-cache/deployment

io.quarkus.cache.infinispan.InfinispanCacheTest.testGetAsyncWithParallelCalls - History

  • expected: "thread1" but was: "thread2" - org.opentest4j.AssertionFailedError
Details
org.opentest4j.AssertionFailedError: 

expected: "thread1"
 but was: "thread2"
	at io.quarkus.cache.infinispan.InfinispanCacheTest.testGetAsyncWithParallelCalls(InfinispanCacheTest.java:283)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at io.quarkus.test.QuarkusUnitTest.runExtensionMethod(QuarkusUnitTest.java:513)
	at io.quarkus.test.QuarkusUnitTest.interceptTestMethod(QuarkusUnitTest.java:427)

@geoand geoand merged commit f94c611 into quarkusio:main Feb 11, 2025
@quarkus-bot quarkus-bot Bot added this to the 3.19 - main milestone Feb 11, 2025
@geoand geoand deleted the jep-483 branch February 11, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants