Skip to content

Add capability of generating native binaries using GraalVM based on v8.2.0#4325

Open
Alessandro Vermeulen (spockz) wants to merge 5 commits into
confluentinc:masterfrom
spockz:8.2.0-native
Open

Add capability of generating native binaries using GraalVM based on v8.2.0#4325
Alessandro Vermeulen (spockz) wants to merge 5 commits into
confluentinc:masterfrom
spockz:8.2.0-native

Conversation

@spockz
Copy link
Copy Markdown

@spockz Alessandro Vermeulen (spockz) commented May 22, 2026

Why

We very frequently spin up fresh environments for exhaustive testing. This environment contains the schema registry. Currently, the docker image of the schema registry is too big which causes slow downloads and reasonably slow in starting up. We are reducing the download footprint and CPU footprint by compiling our Java apps to native binaries using GraalVM so lets also give Schema Registry the same treatment.

What

I've changed the packaging of the schema registry to also support compiling into a native binary. The configuration of initialization at runtime vs at build time is taken from running with 8.2.0. The reachability information is taken from running 8.2.0 in a live setting with the GraalVM agent enabled and capturing reflection uses etc.

Result

The docker image can be significantly reduced to 214MiB and startup time is reduced to 1s. Memory usage is not tested.

Checklist

Please answer the questions with Y, N or N/A if not applicable.

  • [N/A] Contains customer facing changes? Including API/behavior changes
  • [Y] Is this change gated behind config(s)?
    • Packaging with the standalone and native profiles enabled. ./mvnw clean package -Pstandalone,native -pl package-schema-registry.
  • [N/A] Did you add sufficient unit test and/or integration test coverage for this PR?
    • It is an build setup change aimed at showing what can be achieved. Happy to add tests to confirm whether the compiled binary works later.
  • [Y] Does this change require modifying existing system tests or adding new system tests?
    • Yes, the binary version also needs to be tested going forward to ensure feature/bug parity.
  • [N] Must this be released together with other change(s), either in this repo or another one?
    • Not sure.

References

JIRA: ???

Test & Review

The repository for building the images contains a docker-compose.yaml to run a locally generated binary image.

We also rand and used this image in our local testing environment succesfully.

Open questions / Follow-ups

  • Should the initalisation instructions move to native-image.properties?
  • Should the discovered reachability live in core/src/main/resources/META-INF/native or in the package repository?
  • Out of Scope: Adding graalvm native tests for the registry itself.

…ge class to re-use the original published jar because of versions mismatch between project (containing -0 suffix) and the published version without.
@spockz Alessandro Vermeulen (spockz) requested a review from a team as a code owner May 22, 2026 19:31
@confluent-cla-assistant
Copy link
Copy Markdown

Please sign the Contributor License Agreement here before this PR can be approved.
❌ spockz
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated version and stale variant from the one in package-schema-registry. See open questions in PR.

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<?xml version="1.0" encoding="UTF-8" ?>
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Silly auto formatting, sorry.

friend Claude Opus 4.8 in lieu of just enabling all providers since that
is a deprecated option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant