lightbend / kalix-jvm-sdk

Java and Scala SDKs for Kalix
https://docs.kalix.io/java/index.html
Other
58 stars 39 forks source link

Document how to use codegen maven archetype with Apple M1 architecture #78

Open kikiya opened 3 years ago

kikiya commented 3 years ago

Small changes required in pom.xml also user will need to install protoc locally in order to use the maven archetype.

This needs to be documented properly.

johanandren commented 2 years ago

Upstream fixes in akka-grpc in progress in https://github.com/akka/akka-grpc/pull/1477

For the record the easiest path right now is probably using rosetta and an x86 JDK, that will pick up the x86 protoc artifacts from maven central.

Next problem is docker though, by default it will now build an arm64 image on mac which can't be run on Akka Serverless.

You can use an experimental flag in docker-desktop saying "Use the new virtualization framework" to enable buildx which allows building for a different target arch than you are on.

I'm not sure about maven yet but with sbt you can then only build up to the staged docker image with docker:stage

Then manually build and push the docker image from the generated target/docker/stage directory like so:

sbt docker:stage
docker buildx build --platform=linux/amd64 --push -t me/image-name:tag target/docker/stage
johanandren commented 2 years ago

Upstream issue for the maven docker plugin to support cross building: https://github.com/fabric8io/docker-maven-plugin/issues/1502