[Native-image] Build a native-image for pulsar-admin
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Motivation
Using https://www.graalvm.org/ to build a native-image for pulsar-admin reduces the running time.
Comparison of running time:
```
❯ ./native-pulsar-admin.sh
+ echo native-pulsar-admin
native-pulsar-admin
+ ./target/./native-pulsar-admin ../conf/client.conf tenants list
public
pulsar
real 0m0.264s
user 0m0.208s
sys 0m0.049s
+ echo ----------------
----------------
+ echo 'default pulsar-admin'
default pulsar-admin
+ ../bin/pulsar-admin tenants list
2024-03-21T08:27:30.697167Z main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release
2024-03-21T08:27:30.703654Z main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release
2024-03-21T08:27:30.729035Z main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release
2024-03-21T08:27:30.732848Z main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release
public
pulsar
real 0m2.429s
user 0m4.667s
sys 0m0.318s
```
This `native-pulsar-admin` reduces real by 9 times compared to `pulsar-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?
- [X] I'm willing to submit a PR!
Contributor guide
Research direction
Start by reproducing the commands in native-pulsar-admin.sh, comparing target/./native-pulsar-admin with ../bin/pulsar-admin and reviewing the GraalVM native-image requirements. Done would require a defined, platform-specific way to build native pulsar-admin binaries, but the issue does not specify build files, supported platforms, tests, or acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100