-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat(native): create native image #63
Comments
added runtime hints:
The native image compiles and runs fine. Tested:
Note: The current Pre Releases: |
There seems to be an issue with the native build. I'm currently trying to find the root cause. What i can tell right now is that it has something to do with the Stacktrace:
It seems to be specific to linux builds as both Windows and MacOS executables are working just fine. The error can also be reproduced in WSL by compiling via (Note, that GraalVM needs to be installed in WSL):
and then running the resulting exectuable with at least one server in the database. |
The above issue can be avoided on linux by passing Example for docker-compose:
|
progress is now tracked in the PR: #65 |
The issue
One of the biggest drawbacks of this bot is its memory consumption. With the recent upgrade to Spring Boot 3 we could try to build a native image using GraalVM.
Proposed solution
Configure the spring-boot-maven-plugin so that it builds a native image via GraalVM. This would result in near instant startup times and lower memory consumption for the bot. It would also eliminate the need for a JVM.
Notes
I've already attempted to build a native image when Spring Boot 3 was released and it didn't work out of the box. The main issue back then was that kotlin coroutines didn't play nicely with native image, see: oracle/graal#5606. Also, the database is using jackson for serialization, e.g. runtime hints are required, see: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/aot/hint/annotation/RegisterReflectionForBinding.html
The text was updated successfully, but these errors were encountered: