salesforce / salesforce/rules_spring
Create a minified application JRE using jlink
Nobody has claimed this yet.
- Dominant language
- Starlark
- Stars
- 257
- Forks
- 58
- PR merge metrics
- No merged PRs in 30d
Description
This could be a good middle ground between our current standard deployment artifact, and the GraalVM/SpringNative optimized executable (see #93). This would be an optional add-on, perhaps as a distinct rule, something like:
springboot(name = 'glory_svc', ...)
springboot_jre(name = 'glory_svc_jre', springboot_app = ':glory_svc',...)
java_docker_image(name 'glory_docker', app = ':glory_svc', jdk = ':glory_svc_jre', ...)
With the JDK jlink tool, we should be able to produce a small JDK+app executable. In one published example, this reduced the size of the runnable jre from 286MB to 39MB. This works because the jre distro will only contain the Java platform modules that are needed to run the app, and not all the extra cruft (corba, rmi, etc) that are not.
There are a few examples of Spring Boot users getting this to work online, but all of them seemed to use manual methods. Because we have the full list of deps for the Spring Boot jar, we could invoke jdeps with high fidelity, and use that when invoking jlink.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing springboot and java_docker_image rules referenced in the proposal, then investigate how jdeps and jlink could use the Spring Boot dependency list. Done means an optional springboot_jre rule can produce a minimized Java runtime for use by the Docker image rule, with its interface and behavior defined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100