vmencik / akka-graal-native

Example of Akka HTTP server compiled with GraalVM native-image
93 stars 15 forks source link

Akka Graal native tooling #8

Open jroper opened 4 years ago

jroper commented 4 years ago

I'm creating this issue just to start a discussion - not because I think this project should provide this feature, but I thought this is probably the right place to start the discussion since this is where everyone that has done work on Akka and Graal native has come together.

While Graal does provide some tooling to help generate config, it misses a lot of things. For example, the self/context fields in an actor are reflected on not just when watching, but also when the actor is restarted. That only occurs when the actor fails, and it's highly unlikely that in the environment where you run your Graal tooling that you're going to trigger all the failure possibilities, more likely, it'll happen some day in production, and your system will have big problems because an actor couldn't be restarted. Likewise, a lot of things relating to clustering may not be triggered in the environment where you run your Graal tooling, eg, a lot of reflection config is needed to run kubernetes based cluster bootstrap, and that can only run inside a kubernetes cluster.

So, we need something better. The idea is that we could automate much of the generation of reflection config, both for Akka itself, as well as for end user libraries. Such a tool would work with one "artifact" at a time, for Akka libraries, an artifact would be a jar, for an end user library, an artifact would be all the class files and resources on disk that are about to be packaged into a jar. It would do the following:

The above is all the things that I can think of off the top of my head, there's likely more.

jroper commented 4 years ago

Given the above tooling, we could run it against all the Akka artifacts to assist in producing the artifacts that this project currently provides. It could also some day be incorporated into Akka itself, so that Akka provides it's own graal reflection config.

jroper commented 4 years ago

I just realised I probably should have created this issue here:

https://github.com/vmencik/akka-graal-config

shafqatevo commented 3 years ago

Hi @jroper, has there been any progress on this? What do you recommend to do in order to compile latest Akka artifacts with Graal?

Is following the configs and method of these two repos here still the best approach?