-
Notifications
You must be signed in to change notification settings - Fork 2k
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
add support for Spring Framework 6 AOT engine #2402
Conversation
…lVM native images.
|
Welcome @joshlong! |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: joshlong The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pom.xml
Outdated
@@ -482,49 +487,49 @@ | |||
<include>src/test/groovy/**/*.groovy</include> | |||
</includes> | |||
|
|||
<importOrder> <!-- or a custom ordering --> |
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.
Please remove these whitespace changes.
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.
i believe this has now been addressed.
pom.xml
Outdated
@@ -482,49 +487,49 @@ | |||
<include>src/test/groovy/**/*.groovy</include> | |||
</includes> | |||
|
|||
<importOrder> <!-- or a custom ordering --> |
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.
Please remove these whitespace changes.
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.
i believe this has now been addressed.
return (generationContext, beanFactoryInitializationCode) -> { | ||
RuntimeHints hints = generationContext.getRuntimeHints(); | ||
String[] classNames = new String[]{ | ||
"com.google.gson.JsonElement",// |
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.
Is there a reason why there are empty comments after each of these lines?
I took a look at the code changes and other than the whitespace changes which need to be reverted, this looks fine to me. I will let @yue9944882 take a look at the Spring side and comment on how we want to sequence this into the released client. |
Hi, thanks for the quick replies. somehow, the biggest change of my original PR - the fact that it needs a snapshot or milestone (non-Maven central) repository was not in the original I've updated the PR |
We already have a spring component (spring-boot-actuator) marked as Regarding the milestone dependency, you're definitely right that we don't want to pull this in until it is released. So it feels like we should leave this PR open until it is released. There's not too much overlap w/ this PR so it shouldn't be too hard to keep it rebased. |
Awesome! Both of those points - delaying until Boot 3 GA and marking Reflections as Maybe we could do something where, if you try to run the code and do an AOT compilation, it can check that reflections is on the classpath and if it isn't then warn the user to add it to their classpath? That shouldn't be too hard. Spring has a I'm pretty pleased how far this has come in just a week. Thanks for a great project, and I appreciate the fast turnarounds. Hopefully, people interested in doing so will soon (before 2023, maybe?) be able to build Kubernetes clients and controllers that take 50mb of RAM and startup In no time at all soon enough. |
Adding that warning seems totally fine to me. Thanks |
@joshlong the idea SGTM, but i noticed the error messages above in the build log. is spring-boot 3 still compatible with java 8? there's still a distinct portion of users actively using java 8, so the compatibility should be preserved as well. |
@joshlong: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi - no, spring boot 3 requires a Java 17 baseline. If we're not willing to insist on java 17 here, could we extract it into a standalone .jar so that people using the Spring Boot starter in boot 2 and 3 get the same jar but those wishing to leverage the new GraalVM AOT support get the new spring boot 3-specific code? That's less than ideal, tho :) we're all gonna have to cut over to 17 eventually |
I filed an issue so we can discuss how we want to handle Spring 6 and it's dependency on Java 17 |
/close closing it b/c #2457 was merged |
@yue9944882: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @brendandburns, when is a release containing these changes scheduled for? |
Hi
Please find a proof-of-concept introduction of AOT support in Spring Boot 3, per #2398 .
I've tested the proposed changes and they work with both Spring Boot 3 and Spring Boot 2.
Spring Boot 3 is not yet GA, however. So, i've had to add
snapshot
andmilestone
repositories. Obviously, this won't do in a library like the Kubernetes Java client which needs to be releasable all the time. I'm not sure how you want to handle this. Maybe we create a separate module that doesn't get released and that has the appropriate repositories? Maybe we just stash this PR until November 24th, when Spring Boot 3 is due to go GA? (maybe a little later than that, who knows...)Also, for my contribution to work, I need to add a dependency on an external library called Reflections. This is used to capture all the code-generated types for CRDs, for example, in the Kubernetes API and in the user's auto-configured packages in a Spring Boot application. This library is only used at compile time, and only when the user is using Spring Boot 3 AOT compilation. that's not the default. I don't know how to handle that, either. I suppose you could make the package
optional
and then make sure that the interested developer who wnats to use AOT processing gets a warning or something when they try it without that class on the classpath? I don't like that approach very much. It'd be nice if the library was just there and it worked for anybody who wants to build an AOT/ GraalVM native image, out-of-the-box.Is there a Maven
scope
i don't know about that limits the lifetime of the binary explicitly to the time the AOT engine runs?I tried this new support out on a sample Kubernetes CRD+Controller demo and it works just fine, better than what I was able to do before with Spring Native, actually. From ac consumer's perspective, I didn't have to do anything to make code from the Kubernetes Java client do its magic. I was able to delete code, even.
thanks for your time and consideration