Skip to content

Commit

Permalink
Prefer Liberty SCC to OpenJ9 SCC (#204)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ymanton authored Oct 6, 2020
1 parent f00edd9 commit f2b0fe7
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk11
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk14
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion releases/20.0.0.6/kernel/Dockerfile.ubi.adoptopenjdk8
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion releases/20.0.0.6/kernel/Dockerfile.ubuntu.adoptopenjdk8
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions releases/20.0.0.6/kernel/helpers/build/populate_scc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk11
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk14
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion releases/20.0.0.9/kernel/Dockerfile.ubi.adoptopenjdk8
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion releases/20.0.0.9/kernel/Dockerfile.ubuntu.adoptopenjdk8
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions releases/20.0.0.9/kernel/helpers/build/populate_scc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion releases/latest/kernel/Dockerfile.ubi.adoptopenjdk11
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion releases/latest/kernel/Dockerfile.ubi.adoptopenjdk14
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion releases/latest/kernel/Dockerfile.ubi.adoptopenjdk8
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion releases/latest/kernel/Dockerfile.ubuntu.adoptopenjdk8
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions releases/latest/kernel/helpers/build/populate_scc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f2b0fe7

Please sign in to comment.