Skip to content

Commit

Permalink
GraalVM version updated
Browse files Browse the repository at this point in the history
  • Loading branch information
smoell committed Jul 8, 2019
1 parent e32e916 commit b912a8b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 21 deletions.
24 changes: 19 additions & 5 deletions services/tracking-service/reactive-vertx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ LABEL maintainer="Sascha Möllering <[email protected]>"

# 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 && \
Expand All @@ -23,20 +38,19 @@ RUN /opt/jdk/bin/jlink \
FROM debian:9-slim
LABEL maintainer="Sascha Möllering <[email protected]>"

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

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"]
11 changes: 6 additions & 5 deletions services/tracking-service/reactive-vertx/Dockerfile-native
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -28,7 +29,7 @@ LABEL maintainer="Sascha Möllering <[email protected]>"
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
Expand Down
15 changes: 8 additions & 7 deletions services/tracking-service/reactive-vertx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>com.amazon</groupId>
<artifactId>reactive-vertx</artifactId>
<version>1.5</version>
<version>1.6</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -19,10 +19,10 @@
<!-- the main verticle class name -->
<vertx.verticle>com.amazon.BootStrapVerticle</vertx.verticle>
<vertx.lambda.verticle>com.amazon.LambdaBootstrap</vertx.lambda.verticle>
<app.version>1.5</app.version>
<vertx.version>3.6.3</vertx.version>
<awssdk.version>2.5.25</awssdk.version>
<graal.version>1.0.0-rc16</graal.version>
<app.version>1.6</app.version>
<vertx.version>3.7.1</vertx.version>
<awssdk.version>2.6.2</awssdk.version>
<graal.version>19.1.0</graal.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -111,7 +111,7 @@
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.7.1</version>
<version>3.8.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -224,6 +224,7 @@
<imageName>${project.artifactId}-lambda</imageName>
<mainClass>${vertx.lambda.verticle}</mainClass>
<buildArgs>--enable-all-security-services -H:+ReportUnsupportedElementsAtRuntime --allow-incomplete-classpath</buildArgs>
<additionalBuildArgs>--no-fallback</additionalBuildArgs>
</configuration>
</plugin>
</plugins>
Expand All @@ -232,4 +233,4 @@

</profiles>

</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b912a8b

Please sign in to comment.