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
[Native-image] Build a native-image for pulsar-admin #22318
Comments
Yes, this could be useful. Also for pulsar-shell (/cc @nicoloboschi). The only concern is about the increased build time and I wouldn't like to increase CI build times for building the native images. How long does it take to build the native image? |
I've tried in the past to build a native binary. The main issue is that all the reflection calls must be intercepted and declared in the configuration file. There's a tracing mechanism in graalvm to auto-generate those configurations, however not all the code paths are triggered and therefore some runtime errors could be generated at runtime (blocking users in making some operations). That's why I think it's not worth it and instead the Pulsar community should start using Pulsar shell as single CLI tool (and that's why it was born) My attempts were made more than 1 year ago and things could have changed meanwhile; however I've read the same complaints in other ASF projects |
Environment:
Only build for pulsar-admin: [INFO] Total time: 05:04 min Pulsar admin is a commonly used tool, so I plan to support that. Or we can export the native-image config to the jar, the developers can use the Graalvm to build the native-image tool. https://github.com/remkop/picocli/tree/main/picocli-codegen can help us to generate the CLI config of native-image, it is simpler, I have already done it, and I can open a PR to preview. |
It would be worth checking with GitHub Actions CI. Please run experiments in your own fork. |
Have you tested CDS? That would be easy to add. For example, Spring is leveraging this. Blog post https://spring.io/blog/2023/12/04/cds-with-spring-framework-6-1 .
|
Let me try CDS. |
Search before asking
Motivation
Using https://www.graalvm.org/ to build a native-image for pulsar-admin reduces the running time.
Comparison of running time:
This
native-pulsar-admin
reduces real by 9 times compared topulsar-admin.sh
, this is a benefit.BTW, Graalvm cannot support cross-compilation, we must use different platforms to build different native-image.
Solution
No response
Alternatives
No response
Anything else?
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: