akka / akka-projection

Akka Projections is intended for building systems with the CQRS pattern, and facilitate in event-based service-to-service communication.
https://doc.akka.io/docs/akka-projection/current/
Other
100 stars 34 forks source link

Document native image cross build #1034

Open johanandren opened 11 months ago

johanandren commented 11 months ago

If possible.

Right now building the graalvm samples on Apple M1/2 will result in an ARM64 image, but that is maybe not that likely to be available in cloud/edge envs.

I got as far as learning that there may be a --target flag when building the native image, but I would think that requires a GraalVM installation for the target platform as well or something?

pvlugter commented 11 months ago

Still not possible, I believe. Main issue is https://github.com/oracle/graal/issues/407

Currently need to build on the target platform. Can build for another arch in docker, but found the native image build didn't perform well under emulation. For the Kalix native image build, I used docker buildx with remote builder nodes. Can see notes on this here (lightbend private).

johanandren commented 11 months ago

I'll PR just mentioning that for now then, can't be done locally, remote builder possible, without digging deeper into documenting and users will have to figure out the details of remote buildx builders themselves.

johanandren commented 11 months ago

Ah, I see you already mentioned it in #2094 👍

Edit: that was the internal build. But maybe I can steal some text from there.

pvlugter commented 11 months ago

Adding some notes on how to cross-build using docker buildx, and pointers to remote builder nodes, sounds good.

For creating binaries in CI, there's an official github action for GraalVM, and that's the currently suggested approach for cross-platform builds: https://github.com/marketplace/actions/github-action-for-graalvm