From f2b0fe70f0b0ff0b4dff517f5aded40db61f716a Mon Sep 17 00:00:00 2001 From: Younes Manton <926840+ymanton@users.noreply.github.com> Date: Mon, 5 Oct 2020 20:23:33 -0400 Subject: [PATCH] Prefer Liberty SCC to OpenJ9 SCC (#204) On some systems trying to use the OpenJ9 SCC leads to permission denied errors, despite file permissions being observably correct. For the time being we'll ignore the OpenJ9 SCC and continue to build our own SCC layers. In order to do this we switch to setting/using the OPENJ9_JAVA_OPTIONS env var in order to override the OpenJ9 image and move away from IBM_JAVA_OPTIONS, which is deprecated anyway. Signed-off-by: Younes Manton --- releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk11 | 2 +- releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk14 | 2 +- releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk8 | 2 +- releases/20.0.0.6/kernel/Dockerfile.ubuntu.adoptopenjdk8 | 2 +- releases/20.0.0.6/kernel/helpers/build/populate_scc.sh | 8 ++++---- releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk11 | 2 +- releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk14 | 2 +- releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk8 | 2 +- releases/20.0.0.9/kernel/Dockerfile.ubuntu.adoptopenjdk8 | 2 +- releases/20.0.0.9/kernel/helpers/build/populate_scc.sh | 8 ++++---- releases/latest/kernel/Dockerfile.ubi.adoptopenjdk11 | 2 +- releases/latest/kernel/Dockerfile.ubi.adoptopenjdk14 | 2 +- releases/latest/kernel/Dockerfile.ubi.adoptopenjdk8 | 2 +- releases/latest/kernel/Dockerfile.ubuntu.adoptopenjdk8 | 2 +- releases/latest/kernel/helpers/build/populate_scc.sh | 8 ++++---- 15 files changed, 24 insertions(+), 24 deletions(-) diff --git a/releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk11 b/releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk11 index 090d7a41..13c1ef45 100644 --- a/releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk11 +++ b/releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk11 @@ -83,7 +83,7 @@ RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ #These settings are needed so that we can run as a different user than 1001 after server warmup ENV RANDFILE=/tmp/.rnd \ - IBM_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/ ${IBM_JAVA_OPTIONS}" + OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/" USER 1001 diff --git a/releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk14 b/releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk14 index c9779dd6..59e00081 100644 --- a/releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk14 +++ b/releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk14 @@ -83,7 +83,7 @@ RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ #These settings are needed so that we can run as a different user than 1001 after server warmup ENV RANDFILE=/tmp/.rnd \ - IBM_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/ ${IBM_JAVA_OPTIONS}" + OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/" USER 1001 diff --git a/releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk8 b/releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk8 index f83ff1c7..cca0bc41 100644 --- a/releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk8 +++ b/releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk8 @@ -83,7 +83,7 @@ RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ #These settings are needed so that we can run as a different user than 1001 after server warmup ENV RANDFILE=/tmp/.rnd \ - IBM_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/ ${IBM_JAVA_OPTIONS}" + OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/" USER 1001 diff --git a/releases/20.0.0.6/kernel/Dockerfile.ubuntu.adoptopenjdk8 b/releases/20.0.0.6/kernel/Dockerfile.ubuntu.adoptopenjdk8 index 8ccf8905..7d1209d0 100644 --- a/releases/20.0.0.6/kernel/Dockerfile.ubuntu.adoptopenjdk8 +++ b/releases/20.0.0.6/kernel/Dockerfile.ubuntu.adoptopenjdk8 @@ -81,7 +81,7 @@ RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ #These settings are needed so that we can run as a different user than 1001 after server warmup ENV RANDFILE=/tmp/.rnd \ - IBM_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/ ${IBM_JAVA_OPTIONS}" + OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/" USER 1001 diff --git a/releases/20.0.0.6/kernel/helpers/build/populate_scc.sh b/releases/20.0.0.6/kernel/helpers/build/populate_scc.sh index 55e8aa94..188d90a2 100755 --- a/releases/20.0.0.6/kernel/helpers/build/populate_scc.sh +++ b/releases/20.0.0.6/kernel/helpers/build/populate_scc.sh @@ -17,10 +17,10 @@ TRIM_SCC=yes # Trim the SCC to eliminate any wasted space. # In order to reduce the chances of this happening we use the -XX:+OriginalJDK8HeapSizeCompatibilityMode # option to revert to the old criteria, which results in AOT code that is more compatible, on average, with typical heap sizes/positions. # The option has no effect on later JDKs. -export IBM_JAVA_OPTIONS="-XX:+OriginalJDK8HeapSizeCompatibilityMode -Xshareclasses:name=liberty,cacheDir=/output/.classCache/" -CREATE_LAYER="$IBM_JAVA_OPTIONS,createLayer,groupAccess" -DESTROY_LAYER="$IBM_JAVA_OPTIONS,destroy" -PRINT_LAYER_STATS="$IBM_JAVA_OPTIONS,printTopLayerStats" +export OPENJ9_JAVA_OPTIONS="-XX:+OriginalJDK8HeapSizeCompatibilityMode -Xshareclasses:name=liberty,cacheDir=/output/.classCache/" +CREATE_LAYER="$OPENJ9_JAVA_OPTIONS,createLayer,groupAccess" +DESTROY_LAYER="$OPENJ9_JAVA_OPTIONS,destroy" +PRINT_LAYER_STATS="$OPENJ9_JAVA_OPTIONS,printTopLayerStats" while getopts ":i:s:tdh" OPT do diff --git a/releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk11 b/releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk11 index 32663f7e..0fe249ee 100644 --- a/releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk11 +++ b/releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk11 @@ -83,7 +83,7 @@ RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ #These settings are needed so that we can run as a different user than 1001 after server warmup ENV RANDFILE=/tmp/.rnd \ - IBM_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/ ${IBM_JAVA_OPTIONS}" + OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/" USER 1001 diff --git a/releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk14 b/releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk14 index 9236ffdf..4a6ce976 100644 --- a/releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk14 +++ b/releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk14 @@ -83,7 +83,7 @@ RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ #These settings are needed so that we can run as a different user than 1001 after server warmup ENV RANDFILE=/tmp/.rnd \ - IBM_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/ ${IBM_JAVA_OPTIONS}" + OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/" USER 1001 diff --git a/releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk8 b/releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk8 index 5e441ecd..053f2581 100644 --- a/releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk8 +++ b/releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk8 @@ -83,7 +83,7 @@ RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ #These settings are needed so that we can run as a different user than 1001 after server warmup ENV RANDFILE=/tmp/.rnd \ - IBM_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/ ${IBM_JAVA_OPTIONS}" + OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/" USER 1001 diff --git a/releases/20.0.0.9/kernel/Dockerfile.ubuntu.adoptopenjdk8 b/releases/20.0.0.9/kernel/Dockerfile.ubuntu.adoptopenjdk8 index 5a564e00..f6a7f2e2 100644 --- a/releases/20.0.0.9/kernel/Dockerfile.ubuntu.adoptopenjdk8 +++ b/releases/20.0.0.9/kernel/Dockerfile.ubuntu.adoptopenjdk8 @@ -81,7 +81,7 @@ RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ #These settings are needed so that we can run as a different user than 1001 after server warmup ENV RANDFILE=/tmp/.rnd \ - IBM_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/ ${IBM_JAVA_OPTIONS}" + OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/" USER 1001 diff --git a/releases/20.0.0.9/kernel/helpers/build/populate_scc.sh b/releases/20.0.0.9/kernel/helpers/build/populate_scc.sh index 55e8aa94..188d90a2 100755 --- a/releases/20.0.0.9/kernel/helpers/build/populate_scc.sh +++ b/releases/20.0.0.9/kernel/helpers/build/populate_scc.sh @@ -17,10 +17,10 @@ TRIM_SCC=yes # Trim the SCC to eliminate any wasted space. # In order to reduce the chances of this happening we use the -XX:+OriginalJDK8HeapSizeCompatibilityMode # option to revert to the old criteria, which results in AOT code that is more compatible, on average, with typical heap sizes/positions. # The option has no effect on later JDKs. -export IBM_JAVA_OPTIONS="-XX:+OriginalJDK8HeapSizeCompatibilityMode -Xshareclasses:name=liberty,cacheDir=/output/.classCache/" -CREATE_LAYER="$IBM_JAVA_OPTIONS,createLayer,groupAccess" -DESTROY_LAYER="$IBM_JAVA_OPTIONS,destroy" -PRINT_LAYER_STATS="$IBM_JAVA_OPTIONS,printTopLayerStats" +export OPENJ9_JAVA_OPTIONS="-XX:+OriginalJDK8HeapSizeCompatibilityMode -Xshareclasses:name=liberty,cacheDir=/output/.classCache/" +CREATE_LAYER="$OPENJ9_JAVA_OPTIONS,createLayer,groupAccess" +DESTROY_LAYER="$OPENJ9_JAVA_OPTIONS,destroy" +PRINT_LAYER_STATS="$OPENJ9_JAVA_OPTIONS,printTopLayerStats" while getopts ":i:s:tdh" OPT do diff --git a/releases/latest/kernel/Dockerfile.ubi.adoptopenjdk11 b/releases/latest/kernel/Dockerfile.ubi.adoptopenjdk11 index 32663f7e..0fe249ee 100644 --- a/releases/latest/kernel/Dockerfile.ubi.adoptopenjdk11 +++ b/releases/latest/kernel/Dockerfile.ubi.adoptopenjdk11 @@ -83,7 +83,7 @@ RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ #These settings are needed so that we can run as a different user than 1001 after server warmup ENV RANDFILE=/tmp/.rnd \ - IBM_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/ ${IBM_JAVA_OPTIONS}" + OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/" USER 1001 diff --git a/releases/latest/kernel/Dockerfile.ubi.adoptopenjdk14 b/releases/latest/kernel/Dockerfile.ubi.adoptopenjdk14 index 9236ffdf..4a6ce976 100644 --- a/releases/latest/kernel/Dockerfile.ubi.adoptopenjdk14 +++ b/releases/latest/kernel/Dockerfile.ubi.adoptopenjdk14 @@ -83,7 +83,7 @@ RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ #These settings are needed so that we can run as a different user than 1001 after server warmup ENV RANDFILE=/tmp/.rnd \ - IBM_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/ ${IBM_JAVA_OPTIONS}" + OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/" USER 1001 diff --git a/releases/latest/kernel/Dockerfile.ubi.adoptopenjdk8 b/releases/latest/kernel/Dockerfile.ubi.adoptopenjdk8 index 5e441ecd..053f2581 100644 --- a/releases/latest/kernel/Dockerfile.ubi.adoptopenjdk8 +++ b/releases/latest/kernel/Dockerfile.ubi.adoptopenjdk8 @@ -83,7 +83,7 @@ RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ #These settings are needed so that we can run as a different user than 1001 after server warmup ENV RANDFILE=/tmp/.rnd \ - IBM_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/ ${IBM_JAVA_OPTIONS}" + OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/" USER 1001 diff --git a/releases/latest/kernel/Dockerfile.ubuntu.adoptopenjdk8 b/releases/latest/kernel/Dockerfile.ubuntu.adoptopenjdk8 index 5a564e00..f6a7f2e2 100644 --- a/releases/latest/kernel/Dockerfile.ubuntu.adoptopenjdk8 +++ b/releases/latest/kernel/Dockerfile.ubuntu.adoptopenjdk8 @@ -81,7 +81,7 @@ RUN if [ "$OPENJ9_SCC" = "true" ]; then populate_scc.sh; fi \ #These settings are needed so that we can run as a different user than 1001 after server warmup ENV RANDFILE=/tmp/.rnd \ - IBM_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/ ${IBM_JAVA_OPTIONS}" + OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=liberty,nonfatal,cacheDir=/output/.classCache/" USER 1001 diff --git a/releases/latest/kernel/helpers/build/populate_scc.sh b/releases/latest/kernel/helpers/build/populate_scc.sh index 55e8aa94..188d90a2 100755 --- a/releases/latest/kernel/helpers/build/populate_scc.sh +++ b/releases/latest/kernel/helpers/build/populate_scc.sh @@ -17,10 +17,10 @@ TRIM_SCC=yes # Trim the SCC to eliminate any wasted space. # In order to reduce the chances of this happening we use the -XX:+OriginalJDK8HeapSizeCompatibilityMode # option to revert to the old criteria, which results in AOT code that is more compatible, on average, with typical heap sizes/positions. # The option has no effect on later JDKs. -export IBM_JAVA_OPTIONS="-XX:+OriginalJDK8HeapSizeCompatibilityMode -Xshareclasses:name=liberty,cacheDir=/output/.classCache/" -CREATE_LAYER="$IBM_JAVA_OPTIONS,createLayer,groupAccess" -DESTROY_LAYER="$IBM_JAVA_OPTIONS,destroy" -PRINT_LAYER_STATS="$IBM_JAVA_OPTIONS,printTopLayerStats" +export OPENJ9_JAVA_OPTIONS="-XX:+OriginalJDK8HeapSizeCompatibilityMode -Xshareclasses:name=liberty,cacheDir=/output/.classCache/" +CREATE_LAYER="$OPENJ9_JAVA_OPTIONS,createLayer,groupAccess" +DESTROY_LAYER="$OPENJ9_JAVA_OPTIONS,destroy" +PRINT_LAYER_STATS="$OPENJ9_JAVA_OPTIONS,printTopLayerStats" while getopts ":i:s:tdh" OPT do