-
Notifications
You must be signed in to change notification settings - Fork 41.1k
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
Document Buildpacks CDS and Spring AOT support #40762
Comments
just a (arm64) note :
To benefit from dual arch support, the users have to specify an alternative builder: Since this builder is Maven: <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions> <!-- not necessary for arm64, but better take good habits now-->
<execution>
<id>process-aot</id>
<goals>
<goal>process-aot</goal>
</goals>
</execution>
</executions>
<configuration>
<image>
<env> <!-- not necessary for arm64, but better take good habits now-->
<BP_JVM_CDS_ENABLED>true</BP_JVM_CDS_ENABLED>
<BP_SPRING_AOT_ENABLED>true</BP_SPRING_AOT_ENABLED>
</env>
<buildpacks>
<buildpack>paketobuildpacks/java</buildpack>
</buildpacks>
<builder>paketobuildpacks/builder-jammy-buildpackless-tiny</builder>
</image>
</configuration>
</plugin> Gradle: plugins {
[...]
id("org.graalvm.buildtools.native") version "0.10.1" // not necessary for arm64, but better take good habits now
}
[...]
tasks.bootBuildImage {
builder.set("paketobuildpacks/builder-jammy-buildpackless-tiny")
buildpacks.add("gcr.io/paketo-buildpacks/java")
environment.put("BP_SPRING_AOT_ENABLED","true") // not necessary for arm64, but better take good habits now
environment.put("BP_JVM_CDS_ENABLED","true") // not necessary for arm64, but better take good habits now
}
There is no scheduled date when the default builders |
I have began to document the configuration customizations required to avoid early DB interactions cc @christophstrobl: I am now working on adding CDS automated tests to https://github.com/spring-projects/spring-lifecycle-smoke-tests, so maybe the current CDS documentation can link https://github.com/spring-projects/spring-lifecycle-smoke-tests/blob/main/STATUS.adoc like what is done for CRaC. |
This is available at https://docs.spring.io/spring-boot/3.3-SNAPSHOT/how-to/class-data-sharing.html. @sdeleuze I think we should add additional sections to this "How-to Guides" page with specific guidance on CDS-related customizations. |
@scottfrederick Indeed, should I submit a related PR? |
@sdeleuze Yes, please do. |
As discussed with @philwebb today, it would be nice if Spring Boot 3.3 documentation could make CDS and Spring AOT Buildpacks support, which has just been deployed to production, more discoverable. The various configurations are now documented in https://github.com/paketo-buildpacks/spring-boot README, but from a Spring Boot POV my proposal would be to:
BP_JVM_CDS_ENABLED=true
. In practice, that means Buildpacks will perform a training run, create a related.jsa
file with the application classes cached, and use it by default when running the container.CDS_TRAINING_JAVA_TOOL_OPTIONS
can be used to fine tune the training run configuration (typical use case is to avoid early DB interactions, related documentation will be available in https://github.com/spring-projects/spring-lifecycle-smoke-tests, I plan to work on that).BP_SPRING_AOT_ENABLED=true
. That requires AOT processing upfront (already documented) and will enable the AOT mode when running the container.BPL*
configs we don't have to document on Spring Boot side).If you do tests to ensure it works as expected, be aware that for now it is expected to work only on x86. aarch64 support should be fixed (when leveraging the beta multi arch support) before Spring Boot 3.3.0 release (ongoing related work is happening).
The text was updated successfully, but these errors were encountered: