Skip to content

Commit

Permalink
fix Dockerfiles so heap configuration is actually used
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jtjeferreira committed May 18, 2021
1 parent da76354 commit dcff165
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
11 changes: 7 additions & 4 deletions scala_akka_bench/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
11 changes: 7 additions & 4 deletions scala_fs2_bench/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
11 changes: 7 additions & 4 deletions scala_zio_bench/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit dcff165

Please sign in to comment.