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

Update to Graal 20.3.1 and use github container registry #519

Merged
merged 1 commit into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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