Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Commit

Permalink
Update to Graal 20.3.1 and use github container registry
Browse files Browse the repository at this point in the history
  • Loading branch information
pvlugter committed Jan 26, 2021
1 parent a7713c7 commit 78cc9b5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ val ScalaTestVersion = "3.0.8"
val ProtobufVersion = "3.11.4" // Note: sync with Protobuf version in Akka gRPC and ScalaPB
val JacksonDatabindVersion = "2.9.10.5"
val Slf4jSimpleVersion = "1.7.30"
val GraalVersion = "20.1.0"
val GraalVersion = "20.3.1"
val DockerBaseImageVersion = "adoptopenjdk/openjdk11:debianslim-jre"
val DockerBaseImageJavaLibraryPath = "${JAVA_HOME}/lib"

Expand Down Expand Up @@ -257,7 +257,7 @@ commands ++= Seq(
def nativeImageDockerSettings: Seq[Setting[_]] = dockerSettings ++ Seq(
// If this is Some(…): run the native-image generation inside a Docker image
// If this is None: run the native-image generation using a local GraalVM installation
graalVMVersion := Some(GraalVersion + "-java11"), // make sure we use the java11 version
graalVMVersion := Some("java11-" + GraalVersion), // make sure we use the java11 version
graalVMNativeImageOptions ++= sharedNativeImageSettings({
graalVMVersion.value match {
case Some(_) => new File("/opt/docker/graal-resources/")
Expand Down Expand Up @@ -299,7 +299,7 @@ def sharedNativeImageSettings(targetDir: File, buildServer: Boolean) = Seq(
"-H:IncludeResources=.+\\.conf",
"-H:IncludeResources=.+\\.properties",
"-H:+AllowVMInspection",
"-H:-RuntimeAssertions",
// "-H:-RuntimeAssertions", // broken option in GraalVM 20.3
"-H:+RemoveSaturatedTypeFlows", // GraalVM native-image 20.1 feature which speeds up the build time
"-H:+ReportExceptionStackTraces",
// "-H:+PrintAnalysisCallTree", // Uncomment to dump the entire call graph, useful for debugging native-image failing builds
Expand Down Expand Up @@ -332,7 +332,7 @@ def sharedNativeImageSettings(targetDir: File, buildServer: Boolean) = Seq(
"com.typesafe.config.impl.ConfigImpl$LoaderCacheHolder",
"akka.actor.ActorCell", // Do not initialize the actor system until runtime (native-image)
// These are to make up for the lack of shaded configuration for svm/native-image in grpc-netty-shaded
"com.sun.jndi.dns.DnsClient",
// "com.sun.jndi.dns.DnsClient", // error: trying to change RUN_TIME from the command line to RERUN Contains Random references
"com.typesafe.sslconfig.ssl.tracing.TracingSSLContext",
"io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2CodecUtil",
"io.grpc.netty.shaded.io.netty.handler.codec.http2.DefaultHttp2FrameWriter",
Expand Down Expand Up @@ -517,6 +517,7 @@ lazy val `proxy-postgres` = (project in file("proxy/postgres"))
graalVMNativeImageOptions ++= Seq(
"--initialize-at-build-time"
+ Seq(
"java.sql.DriverManager",
"org.postgresql.Driver",
"org.postgresql.util.SharedTimer"
).mkString("=", ",", "")
Expand Down
2 changes: 1 addition & 1 deletion project/GraalVMPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object GraalVMPlugin extends AutoPlugin {
import DockerPlugin.autoImport._
import UniversalPlugin.autoImport._

private val GraalVMBaseImage = "oracle/graalvm-ce"
private val GraalVMBaseImage = "ghcr.io/graalvm/graalvm-ce"
private val NativeImageCommand = "native-image"

override def requires: Plugins = JavaAppPackaging && DockerPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@ object CloudStateProxyMain {
start(Option(config))

private def start(configuration: Option[Config]): ActorSystem = {
// This should be fixed in Graal already
// Must do this first, before anything uses ThreadLocalRandom
if (isGraalVM) {
initializeThreadLocalRandom()
}
// if (isGraalVM) {
// initializeThreadLocalRandom()
// }

implicit val system = configuration.fold(ActorSystem("cloudstate-proxy"))(c => ActorSystem("cloudstate-proxy", c))
implicit val materializer = SystemMaterializer(system)
Expand Down

0 comments on commit 78cc9b5

Please sign in to comment.