From b912a8bc39a39602f64d9b8d5f9c7fa63ea95ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20M=C3=B6llering?= Date: Mon, 8 Jul 2019 10:50:54 +0200 Subject: [PATCH] GraalVM version updated --- .../reactive-vertx/Dockerfile | 24 +++++++++++++++---- .../reactive-vertx/Dockerfile-native | 11 +++++---- .../tracking-service/reactive-vertx/pom.xml | 15 ++++++------ .../src/main/java/graal/SVMSubstitutions.java | 3 ++- .../reactive-vertx/native-image.properties | 8 ++++--- 5 files changed, 40 insertions(+), 21 deletions(-) diff --git a/services/tracking-service/reactive-vertx/Dockerfile b/services/tracking-service/reactive-vertx/Dockerfile index e33617c..920ca88 100644 --- a/services/tracking-service/reactive-vertx/Dockerfile +++ b/services/tracking-service/reactive-vertx/Dockerfile @@ -3,6 +3,21 @@ LABEL maintainer="Sascha Möllering " # First step: build java runtime module +RUN wget https://www-eu.apache.org/dist/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz -P /tmp +RUN tar xf /tmp/apache-maven-3.6.1-bin.tar.gz -C /opt +RUN ln -s /opt/apache-maven-3.6.1 /opt/maven + +ENV M2_HOME=/opt/maven +ENV MAVEN_HOME=/opt/maven +ENV PATH=${M2_HOME}/bin:${PATH} + +COPY ./pom.xml ./pom.xml +COPY src ./src/ + +ENV MAVEN_OPTS='-Xmx6g' + +RUN mvn -Dmaven.test.skip=true clean package + RUN set -ex && \ apt-get update && apt-get install -y wget unzip && \ wget https://d3pxv6yz143wms.cloudfront.net/11.0.3.7.1/amazon-corretto-11.0.3.7.1-linux-x64.tar.gz -nv && \ @@ -23,15 +38,14 @@ RUN /opt/jdk/bin/jlink \ FROM debian:9-slim LABEL maintainer="Sascha Möllering " +RUN mkdir /opt/app && apt-get update && apt-get install curl -y + COPY --from=builder /opt/jdk-minimal /opt/jdk-minimal +COPY --from=build target/target/reactive-vertx-1.6-fat.jar /opt/app ENV JAVA_HOME=/opt/jdk-minimal ENV PATH="$PATH:$JAVA_HOME/bin" -RUN mkdir /opt/app && apt-get update && apt-get install curl -y - -COPY target/reactive-vertx-1.5-fat.jar /opt/app - HEALTHCHECK --interval=5s --timeout=3s --retries=3 \ CMD curl -f http://localhost:8080/health/check || exit 1 @@ -39,4 +53,4 @@ EXPOSE 8080 CMD ["java", "-server", "-XX:+DoEscapeAnalysis", "-XX:+UseStringDeduplication", \ "-XX:+UseCompressedOops", "-XX:+UseG1GC", \ - "-jar", "opt/app/reactive-vertx-1.5-fat.jar"] + "-jar", "opt/app/reactive-vertx-1.5-fat.jar"] \ No newline at end of file diff --git a/services/tracking-service/reactive-vertx/Dockerfile-native b/services/tracking-service/reactive-vertx/Dockerfile-native index 45788f4..62ab2d3 100644 --- a/services/tracking-service/reactive-vertx/Dockerfile-native +++ b/services/tracking-service/reactive-vertx/Dockerfile-native @@ -1,12 +1,11 @@ -FROM oracle/graalvm-ce:1.0.0-rc16 AS build-aot +FROM oracle/graalvm-ce:19.1.0 AS build-aot -RUN yum update -y -RUN yum install wget -y +RUN yum clean all && yum update -y && yum install wget -y RUN wget https://www-eu.apache.org/dist/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz -P /tmp RUN tar xf /tmp/apache-maven-3.6.1-bin.tar.gz -C /opt RUN ln -s /opt/apache-maven-3.6.1 /opt/maven -RUN ln -s /opt/graalvm-ce-1.0.0-rc16 /opt/graalvm +RUN ln -s /opt/graalvm-ce-19.1.0 /opt/graalvm ENV GRAALVM_HOME=/opt/graalvm ENV JAVA_HOME=/opt/graalvm @@ -20,6 +19,8 @@ COPY src ./src/ ENV MAVEN_OPTS='-Xmx6g' +RUN gu install native-image + RUN mvn -Dmaven.test.skip=true -Pnative-image-fargate clean package FROM debian:9-slim @@ -28,7 +29,7 @@ LABEL maintainer="Sascha Möllering " ENV javax.net.ssl.trustStore /cacerts ENV javax.net.ssl.trustAnchors /cacerts -RUN apt-get update && apt-get install -y curl +RUN apt-get update && apt-get install curl -y COPY --from=build-aot target/reactive-vertx /usr/bin/reactive-vertx COPY --from=build-aot /opt/graalvm/jre/lib/amd64/libsunec.so /libsunec.so COPY --from=build-aot /opt/graalvm/jre/lib/security/cacerts /cacerts diff --git a/services/tracking-service/reactive-vertx/pom.xml b/services/tracking-service/reactive-vertx/pom.xml index 0392e7e..697c4b8 100644 --- a/services/tracking-service/reactive-vertx/pom.xml +++ b/services/tracking-service/reactive-vertx/pom.xml @@ -7,7 +7,7 @@ com.amazon reactive-vertx - 1.5 + 1.6 UTF-8 @@ -19,10 +19,10 @@ com.amazon.BootStrapVerticle com.amazon.LambdaBootstrap - 1.5 - 3.6.3 - 2.5.25 - 1.0.0-rc16 + 1.6 + 3.7.1 + 2.6.2 + 19.1.0 @@ -111,7 +111,7 @@ com.google.protobuf protobuf-java - 3.7.1 + 3.8.0 @@ -224,6 +224,7 @@ ${project.artifactId}-lambda ${vertx.lambda.verticle} --enable-all-security-services -H:+ReportUnsupportedElementsAtRuntime --allow-incomplete-classpath + --no-fallback @@ -232,4 +233,4 @@ - + \ No newline at end of file diff --git a/services/tracking-service/reactive-vertx/src/main/java/graal/SVMSubstitutions.java b/services/tracking-service/reactive-vertx/src/main/java/graal/SVMSubstitutions.java index 4906d8a..f9db459 100644 --- a/services/tracking-service/reactive-vertx/src/main/java/graal/SVMSubstitutions.java +++ b/services/tracking-service/reactive-vertx/src/main/java/graal/SVMSubstitutions.java @@ -2,7 +2,8 @@ import com.oracle.svm.core.annotate.*; -import org.graalvm.nativeimage.*; +import org.graalvm.nativeimage.hosted.Feature; +import org.graalvm.nativeimage.hosted.RuntimeReflection; /** * This substitution allows the usage of platform specific code to do low level diff --git a/services/tracking-service/reactive-vertx/src/main/resources/META-INF/native-image/com.amazon/reactive-vertx/native-image.properties b/services/tracking-service/reactive-vertx/src/main/resources/META-INF/native-image/com.amazon/reactive-vertx/native-image.properties index 8318406..7e33681 100644 --- a/services/tracking-service/reactive-vertx/src/main/resources/META-INF/native-image/com.amazon/reactive-vertx/native-image.properties +++ b/services/tracking-service/reactive-vertx/src/main/resources/META-INF/native-image/com.amazon/reactive-vertx/native-image.properties @@ -1,5 +1,7 @@ -Args = --rerun-class-initialization-at-runtime=io.netty.handler.codec.http2.Http2CodecUtil \ - --enable-url-protocols=http,https --enable-all-security-services \ - --delay-class-initialization-to-runtime=io.netty.handler.codec.http.HttpObjectEncoder,io.netty.handler.codec.http2.DefaultHttp2FrameWriter,io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder \ +Args = --enable-url-protocols=http,https --enable-all-security-services \ + --static \ + --verbose \ + --report-unsupported-elements-at-runtime \ + --initialize-at-build-time=org.slf4j.LoggerFactory,io.netty.util.internal.MathUtil,io.netty.util.internal.PlatformDependent0,io.netty.util.internal.PlatformDependent,io.netty.util.CharsetUtil,software.amazon.awssdk.protocols.core.StringToValueConverter$SimpleStringToValue,io.netty.util.AsciiString,io.netty.handler.codec.http2.Http2CodecUtil,io.netty.handler.codec.http.HttpObjectEncoder,io.netty.handler.codec.http2.DefaultHttp2FrameWriter,io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder \ -H:IncludeResources=(META-INF|vertx-default-jul-logging)/.* \ -H:ReflectionConfigurationFiles=classes/${.}/reflection.json \ No newline at end of file