From dcff1654b715e9755b7f17e1fc0add4d928efb6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ferreira?= Date: Tue, 18 May 2021 23:43:25 +0100 Subject: [PATCH] fix Dockerfiles so heap configuration is actually used JAVA_OPTS is not recognized by the JVM using _JAVA_OPTIONS instead. this worked in the java benchmarks because the script we use to launch accepts that --- scala_akka_bench/Dockerfile | 11 +++++++---- scala_fs2_bench/Dockerfile | 11 +++++++---- scala_zio_bench/Dockerfile | 11 +++++++---- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/scala_akka_bench/Dockerfile b/scala_akka_bench/Dockerfile index 8800be6d..d7f2c7d6 100644 --- a/scala_akka_bench/Dockerfile +++ b/scala_akka_bench/Dockerfile @@ -1,13 +1,16 @@ -FROM hseeberger/scala-sbt:11.0.7_1.3.13_2.11.12 +FROM hseeberger/scala-sbt:11.0.7_1.3.13_2.11.12 as BUILDER WORKDIR /app COPY scala_akka_bench /app COPY proto/helloworld/helloworld.proto /app/src/main/protobuf/helloworld.proto -RUN sbt compile RUN sbt assembly +FROM adoptopenjdk:16_36-jdk-hotspot + ENV GC "-XX:+UseParallelGC" -ENV JAVA_OPTS "${GC} -XX:MinRAMPercentage=70 -XX:MaxRAMPercentage=70" +ENV _JAVA_OPTIONS "${GC} -XX:MinRAMPercentage=70 -XX:MaxRAMPercentage=70" + +COPY --from=builder /app/target/scala-2.13/akka-grpc-quickstart-scala-assembly-1.0.jar . -ENTRYPOINT ["/usr/local/openjdk-11/bin/java", "-jar", "/app/target/scala-2.13/akka-grpc-quickstart-scala-assembly-1.0.jar"] +ENTRYPOINT ["java", "-jar", "akka-grpc-quickstart-scala-assembly-1.0.jar"] diff --git a/scala_fs2_bench/Dockerfile b/scala_fs2_bench/Dockerfile index beac14a1..a9c59ca2 100644 --- a/scala_fs2_bench/Dockerfile +++ b/scala_fs2_bench/Dockerfile @@ -1,13 +1,16 @@ -FROM hseeberger/scala-sbt:11.0.7_1.3.13_2.11.12 +FROM hseeberger/scala-sbt:11.0.7_1.3.13_2.11.12 as BUILDER WORKDIR /app COPY scala_fs2_bench /app COPY proto/helloworld/helloworld.proto /app/src/main/protobuf/helloworld.proto -RUN sbt compile RUN sbt assembly +FROM adoptopenjdk:16_36-jdk-hotspot + ENV GC "-XX:+UseParallelGC" -ENV JAVA_OPTS "${GC} -XX:MinRAMPercentage=70 -XX:MaxRAMPercentage=70" +ENV _JAVA_OPTIONS "${GC} -XX:MinRAMPercentage=70 -XX:MaxRAMPercentage=70" + +COPY --from=builder /app/target/scala-2.13/fs2-grpc-quickstart-scala-assembly-1.0.jar . -ENTRYPOINT ["/usr/local/openjdk-11/bin/java", "-jar", "/app/target/scala-2.13/fs2-grpc-quickstart-scala-assembly-1.0.jar"] +ENTRYPOINT ["java", "-jar", "fs2-grpc-quickstart-scala-assembly-1.0.jar"] diff --git a/scala_zio_bench/Dockerfile b/scala_zio_bench/Dockerfile index 44bcab90..15f647b9 100644 --- a/scala_zio_bench/Dockerfile +++ b/scala_zio_bench/Dockerfile @@ -1,13 +1,16 @@ -FROM hseeberger/scala-sbt:11.0.7_1.3.13_2.11.12 +FROM hseeberger/scala-sbt:11.0.7_1.3.13_2.11.12 as BUILDER WORKDIR /app COPY scala_zio_bench /app COPY proto/helloworld/helloworld.proto /app/src/main/protobuf/helloworld.proto -RUN sbt compile RUN sbt assembly +FROM adoptopenjdk:16_36-jdk-hotspot + ENV GC "-XX:+UseParallelGC" -ENV JAVA_OPTS "${GC} -XX:MinRAMPercentage=70 -XX:MaxRAMPercentage=70" +ENV _JAVA_OPTIONS "${GC} -XX:MinRAMPercentage=70 -XX:MaxRAMPercentage=70" + +COPY --from=builder /app/target/scala-2.13/zio-grpc-quickstart-scala-assembly-1.0.jar . -ENTRYPOINT ["/usr/local/openjdk-11/bin/java", "-jar", "/app/target/scala-2.13/zio-grpc-quickstart-scala-assembly-1.0.jar"] +ENTRYPOINT ["java", "-jar", "zio-grpc-quickstart-scala-assembly-1.0.jar"]