-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support GraalVM and native-image compilation #9402
Comments
Hi @gilles-degols. |
actually the problem here is that you use Guice @gilles-degols if you use play without guys it will work if you include everything necessary inside the image. with guice you basically need to add all classes to the image that will be included dynamically. |
@schmitch you are right! By using a project here not relying on Guice, and meddling a bit with it I was able to compile & run the native-image. Thank you very much again for your initial blog post & this comment! |
@gilles-degols @schmitch |
Are you looking for help?
Oracle has released "GraalVM", which allows, among other things, to build a native application out of any java/scala code. The drop in resource consumption (specifically the RAM) is extremely useful for a micro-service architecture.
An example of the performance improvement was done here.
And some efforts were done to use it with Akka: here, which worked fine, if you do a bit of extra-work.
Regarding Play!, an investigation was done ~1 year ago, but no significant update since then, at least, no easy-to-find documentation to make Play! compiles as a native image.
Play Version (2.5.x / etc)
Play 2.7.2 (also tested Play 2.8.0-M1, no difference)
API (Scala / Java / Neither / Both)
Scala
Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)
Centos 7.4
JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)
Library Dependencies
Native packager in the plugins.sbt:
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.22")
I also used the different dependencies described here.
Expected Behavior
sbt graalvm-native-image:packageBin
Should produce a valid native image, working the same way as "sbt run"
Actual Behavior
sbt graalvm-native-image:packageBin
produces the following output:
Even if the final output says "[success]", if you try to launch the generated application:
Reproducible Test Case
Project: https://github.com/gilles-degols/play-graal/
This is a very basic Play project generated automatically, from which I removed every service, controller and filter. The idea is first to compile it as simple as possible, then gradually try more advanced features of Play! with it.
The text was updated successfully, but these errors were encountered: