Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update EA docker files for Nov 24 preview 1 #130

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions 11-ea/jdk/ubi-minimal/ubi8/Dockerfile.open.releases.full
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# (C) Copyright IBM Corporation 2024, 2024
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

FROM registry.access.redhat.com/ubi8/ubi-minimal:latest

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

RUN microdnf install -y tzdata openssl curl ca-certificates fontconfig glibc-langpack-en gzip tar \
&& microdnf update -y; microdnf clean all

LABEL name="IBM Semeru Runtime EA" \
vendor="International Business Machines Corporation" \
version="jdk-11.0.26+2_nov_24-preview_1" \
release="11" \
run="docker run --rm -ti <image_name:tag> /bin/bash" \
summary="IBM Semeru Runtime EA Docker Image for OpenJDK with openj9 and ubi-minimal" \
description="For more information on this image please see https://github.com/ibmruntimes/semeru-containers/blob/master/README.md"

ENV JAVA_VERSION jdk-11.0.26+2_nov_24-preview_1

RUN set -eux; \
ARCH="$(uname -m)"; \
case "${ARCH}" in \
aarch64|arm64) \
ESUM='e1d84a953f104ca498772a713884482e36b8bf2da86c414b970edbd85fd06e01'; \
BINARY_URL='https://github.com/ibmruntimes/semeru11-ea-binaries/releases/download/jdk-11.0.26%2B2_nov_24-preview_1/ibm-semeru-open-jdk_aarch64_linux_11.0.26_2_november_24_preview_1.tar.gz'; \
;; \
amd64|x86_64) \
ESUM='bf4c04435e7a47cacd2ee59cc075763c94f6c6dfc0a670ff0965174c10451aa4'; \
BINARY_URL='https://github.com/ibmruntimes/semeru11-ea-binaries/releases/download/jdk-11.0.26%2B2_nov_24-preview_1/ibm-semeru-open-jdk_x64_linux_11.0.26_2_november_24_preview_1.tar.gz'; \
;; \
*) \
echo "Unsupported arch: ${ARCH}"; \
exit 1; \
;; \
esac; \
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \
echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \
mkdir -p /opt/java/java-ea; \
cd /opt/java/java-ea; \
tar -xf /tmp/openjdk.tar.gz --strip-components=1; \
rm -rf /tmp/openjdk.tar.gz;

ENV JAVA_HOME=/opt/java/java-ea \
PATH="/opt/java/java-ea/bin:$PATH"
ENV JAVA_TOOL_OPTIONS="-XX:+IgnoreUnrecognizedVMOptions -XX:+PortableSharedCache -XX:+IdleTuningGcOnIdle -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,readonly,nonFatal"

# Create OpenJ9 SharedClassCache (SCC) for bootclasses to improve the java startup.
# Downloads and runs tomcat to generate SCC for bootclasses at /opt/java/.scc/openj9_system_scc
# Does a dry-run and calculates the optimal cache size and recreates the cache with the appropriate size.
# With SCC, OpenJ9 startup is improved ~50% with an increase in image size of ~14MB
# Application classes can be create a separate cache layer with this as the base for further startup improvement

RUN set -eux; \
unset OPENJ9_JAVA_OPTIONS; \
SCC_SIZE="50m"; \
DOWNLOAD_PATH_TOMCAT=/tmp/tomcat; \
INSTALL_PATH_TOMCAT=/opt/tomcat-home; \
TOMCAT_CHECKSUM="537dbbfc03b37312c2ec282c6906828298cb74e42aca6e3e6835d44bf6923fd8c5db77e98bf6ce9ef19e1922729de53b20546149176e07ac04087df786a62fd9"; \
TOMCAT_DWNLD_URL="https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.97/bin/apache-tomcat-9.0.97.tar.gz"; \
\
mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}"; \
curl -LfsSo "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; \
echo "${TOMCAT_CHECKSUM} *${DOWNLOAD_PATH_TOMCAT}/tomcat.tar.gz" | sha512sum -c -; \
tar -xf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1; \
rm -rf "${DOWNLOAD_PATH_TOMCAT}"; \
\
java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version; \
export OPENJ9_JAVA_OPTIONS="-XX:+IProfileDuringStartupPhase -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal"; \
"${INSTALL_PATH_TOMCAT}"/bin/startup.sh; \
sleep 5; \
"${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh -force; \
sleep 15; \
FULL=$( (java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,printallStats 2>&1 || true) | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}'); \
DST_CACHE=$(java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy 2>&1 || true); \
SCC_SIZE=$(echo $SCC_SIZE | sed 's/.$//'); \
SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}"); \
[ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1; \
SCC_SIZE="${SCC_SIZE}m"; \
java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version; \
unset OPENJ9_JAVA_OPTIONS; \
\
export OPENJ9_JAVA_OPTIONS="-XX:+IProfileDuringStartupPhase -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal"; \
"${INSTALL_PATH_TOMCAT}"/bin/startup.sh; \
sleep 5; \
"${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh -force; \
sleep 5; \
FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats 2>&1 || true) | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}'); \
echo "SCC layer is $FULL% full."; \
rm -rf "${INSTALL_PATH_TOMCAT}"; \
if [ -d "/opt/java/.scc" ]; then \
chmod -R 0777 /opt/java/.scc; \
fi; \
\
echo "SCC generation phase completed";

CMD ["jshell"]
USER 1001
106 changes: 17 additions & 89 deletions 11-ea/jdk/ubi-minimal/ubi9/Dockerfile.open.releases.full
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) Copyright IBM Corporation 2023, 2023
# (C) Copyright IBM Corporation 2024, 2024
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,95 +17,37 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:latest

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

RUN microdnf install -y \
# CRIU dependencies
iptables-libs iptables jansson libibverbs libmnl libnet libnftnl libpcap nftables protobuf-c \
# Semeru dependencies
tzdata openssl ca-certificates fontconfig glibc-langpack-en gzip tar \
&& microdnf update -y && microdnf clean all

RUN microdnf install -y tzdata openssl ca-certificates fontconfig glibc-langpack-en gzip tar \
&& microdnf update -y; microdnf clean all

LABEL name="IBM Semeru Runtime EA" \
vendor="International Business Machines Corporation" \
version="jdk-11.0.22+6_openj9-0.43.0-m2" \
version="jdk-11.0.26+2_nov_24-preview_1" \
release="11" \
run="docker run --rm -ti <image_name:tag> /bin/bash" \
summary="IBM Semeru Runtime EA Docker Image for OpenJDK with openj9 and ubi" \
summary="IBM Semeru Runtime EA Docker Image for OpenJDK with openj9 and ubi-minimal" \
description="For more information on this image please see https://github.com/ibmruntimes/semeru-containers/blob/master/README.md"

# Install CRIU
RUN --mount=type=secret,id=criu_secrets source /run/secrets/criu_secrets; \
set -eux; \
ARCH="$(uname -m)"; \
case "${ARCH}" in \
amd64|x86_64) \
CRIU_URL='https://na-public.artifactory.swg-devops.com/artifactory/sys-rt-generic-local/hyc-runtimes-jenkins.swg-devops.com/build-scripts/criu_build/36/x64_linux/ubi9/criu.tar.gz'; \
CRIU_SHA_URL='https://na-public.artifactory.swg-devops.com/artifactory/sys-rt-generic-local/hyc-runtimes-jenkins.swg-devops.com/build-scripts/criu_build/36/x64_linux/ubi9/criu.tar.gz.sha256.txt'; \
;; \
ppc64el|ppc64le) \
CRIU_URL='https://na-public.artifactory.swg-devops.com/artifactory/sys-rt-generic-local/hyc-runtimes-jenkins.swg-devops.com/build-scripts/criu_build/36/ppc64le_linux/ubi9/criu.tar.gz'; \
CRIU_SHA_URL='https://na-public.artifactory.swg-devops.com/artifactory/sys-rt-generic-local/hyc-runtimes-jenkins.swg-devops.com/build-scripts/criu_build/36/ppc64le_linux/ubi9/criu.tar.gz.sha256.txt'; \
;; \
s390x) \
CRIU_URL='https://na-public.artifactory.swg-devops.com/artifactory/sys-rt-generic-local/hyc-runtimes-jenkins.swg-devops.com/build-scripts/criu_build/36/s390x_linux/ubi9/criu.tar.gz'; \
CRIU_SHA_URL='https://na-public.artifactory.swg-devops.com/artifactory/sys-rt-generic-local/hyc-runtimes-jenkins.swg-devops.com/build-scripts/criu_build/36/s390x_linux/ubi9/criu.tar.gz.sha256.txt'; \
;; \
aarch64) \
CRIU_URL='https://na-public.artifactory.swg-devops.com/artifactory/sys-rt-generic-local/hyc-runtimes-jenkins.swg-devops.com/build-scripts/criu_build/76/aarch64_linux/criu.tar.gz'; \
CRIU_SHA_URL='https://na-public.artifactory.swg-devops.com/artifactory/sys-rt-generic-local/hyc-runtimes-jenkins.swg-devops.com/build-scripts/criu_build/76/aarch64_linux/criu.tar.gz.sha256.txt'; \
;; \
*) \
echo "Unsupported arch: ${ARCH}"; \
exit 1; \
;; \
esac; \
cd /tmp; \
curl -H "${CRIU_AUTH_HEADER}" -LfsSo criu.tar.gz ${CRIU_URL}; \
curl -H "${CRIU_AUTH_HEADER}" -LfsSo criu.tar.gz.sha256.txt ${CRIU_SHA_URL}; \
sha256sum -c criu.tar.gz.sha256.txt; \
tar -xzf criu.tar.gz --strip-components=1; \
cp -R usr/local /usr; \
echo /usr/local/lib64 > /etc/ld.so.conf.d/criu.conf; \
ldconfig; \
setcap cap_checkpoint_restore,cap_sys_ptrace,cap_setpcap=eip /usr/local/sbin/criu; \
mkdir -p /opt/criu; \
cp /usr/local/sbin/criu /opt/criu/criu; \
setcap cap_checkpoint_restore,cap_setpcap=eip /opt/criu/criu; \
rm -fr criu criu.tar.gz;
ENV JAVA_VERSION jdk-11.0.26+2_nov_24-preview_1

ENV PATH="/usr/local/sbin:$PATH"

ENV JAVA_VERSION jdk-11.0.22+6_openj9-0.43.0-m2

RUN --mount=type=secret,id=criu_secrets source /run/secrets/criu_secrets; \
set -eux; \
RUN set -eux; \
ARCH="$(uname -m)"; \
case "${ARCH}" in \
amd64|x86_64) \
ESUM_URL='https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.22%2B6_openj9-0.43.0-m2/ibm-semeru-open-jdk_x64_linux_11.0.22_6_openj9-0.43.0-m2.tar.gz.sha256.txt'; \
BINARY_URL='https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.22%2B6_openj9-0.43.0-m2/ibm-semeru-open-jdk_x64_linux_11.0.22_6_openj9-0.43.0-m2.tar.gz'; \
;; \
ppc64el|ppc64le) \
ESUM_URL='https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.22%2B6_openj9-0.43.0-m2/ibm-semeru-open-jdk_ppc64le_linux_11.0.22_6_openj9-0.43.0-m2.tar.gz.sha256.txt'; \
BINARY_URL='https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.22%2B6_openj9-0.43.0-m2/ibm-semeru-open-jdk_ppc64le_linux_11.0.22_6_openj9-0.43.0-m2.tar.gz'; \
;; \
s390x) \
ESUM_URL='https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.22%2B6_openj9-0.43.0-m2/ibm-semeru-open-jdk_s390x_linux_11.0.22_6_openj9-0.43.0-m2.tar.gz.sha256.txt'; \
BINARY_URL='https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.22%2B6_openj9-0.43.0-m2/ibm-semeru-open-jdk_s390x_linux_11.0.22_6_openj9-0.43.0-m2.tar.gz'; \
;; \
aarch64|arm64) \
ESUM_URL='https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.22%2B6_openj9-0.43.0-m2/ibm-semeru-open-jdk_aarch64_linux_11.0.22_6_openj9-0.43.0-m2.tar.gz.sha256.txt'; \
BINARY_URL='https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.22%2B6_openj9-0.43.0-m2/ibm-semeru-open-jdk_aarch64_linux_11.0.22_6_openj9-0.43.0-m2.tar.gz'; \
ESUM='e1d84a953f104ca498772a713884482e36b8bf2da86c414b970edbd85fd06e01'; \
BINARY_URL='https://github.com/ibmruntimes/semeru11-ea-binaries/releases/download/jdk-11.0.26%2B2_nov_24-preview_1/ibm-semeru-open-jdk_aarch64_linux_11.0.26_2_november_24_preview_1.tar.gz'; \
;; \
amd64|x86_64) \
ESUM='bf4c04435e7a47cacd2ee59cc075763c94f6c6dfc0a670ff0965174c10451aa4'; \
BINARY_URL='https://github.com/ibmruntimes/semeru11-ea-binaries/releases/download/jdk-11.0.26%2B2_nov_24-preview_1/ibm-semeru-open-jdk_x64_linux_11.0.26_2_november_24_preview_1.tar.gz'; \
;; \
*) \
echo "Unsupported arch: ${ARCH}"; \
exit 1; \
;; \
esac; \
curl -LfsSo /tmp/openjdk.tar.gz.sha256.txt ${ESUM_URL}; \
curl -OLJSks ${BINARY_URL}; \
sha256sum -c /tmp/openjdk.tar.gz.sha256.txt; \
mv ibm-semeru-*tar.gz /tmp/openjdk.tar.gz; \
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \
echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \
mkdir -p /opt/java/java-ea; \
cd /opt/java/java-ea; \
tar -xf /tmp/openjdk.tar.gz --strip-components=1; \
Expand All @@ -126,8 +68,8 @@ RUN set -eux; \
SCC_SIZE="50m"; \
DOWNLOAD_PATH_TOMCAT=/tmp/tomcat; \
INSTALL_PATH_TOMCAT=/opt/tomcat-home; \
TOMCAT_CHECKSUM="2b13f11f4e0d0b9aee667c256c6ea5d2853b067e8b7e8293f117da050d3833fda8aa9d9ad278bd12fb7fbf0825108c7d0384509f44c05f9bad73eb099cfaa128"; \
TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.82/bin/apache-tomcat-9.0.82.tar.gz"; \
TOMCAT_CHECKSUM="537dbbfc03b37312c2ec282c6906828298cb74e42aca6e3e6835d44bf6923fd8c5db77e98bf6ce9ef19e1922729de53b20546149176e07ac04087df786a62fd9"; \
TOMCAT_DWNLD_URL="https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.97/bin/apache-tomcat-9.0.97.tar.gz"; \
\
mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}"; \
curl -LfsSo "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; \
Expand Down Expand Up @@ -164,19 +106,5 @@ RUN set -eux; \
\
echo "SCC generation phase completed";

# For InstantOn, generate instanton.ld.so.cache which excludes glibc-hwcaps directories.
# ldconfig output example lines:
# libcap-ng.so.0 (libc6,64bit) => /lib64/libcap-ng.so.0
# libc_malloc_debug.so.0 (libc6,64bit, OS ABI: Linux 3.10.0) => /lib64/libc_malloc_debug.so.0
# libc.so.6 (libc6,64bit, hwcap: "power10", OS ABI: Linux 3.10.0) => /lib64/glibc-hwcaps/power10/libc.so.6
# sed regexp filter should pass any line that looks as follows: ... => /.../glibc-hwcaps/...
RUN glibc_hwcaps_dirs=$(ldconfig --print-cache | sed --regexp-extended --silent 's,^.+[[:space:]]+=>[[:space:]]+(/.+/glibc-hwcaps)/.+$,\1,p' | sort | uniq) \
&& mv -v /etc/ld.so.cache /etc/ld.so.cache.orig \
&& for d in $glibc_hwcaps_dirs; do mv -v $d $d-hidden; done \
&& ldconfig \
&& mv -v /etc/ld.so.cache /etc/instanton.ld.so.cache \
&& for d in $glibc_hwcaps_dirs; do mv -v $d-hidden $d; done \
&& mv -v /etc/ld.so.cache.orig /etc/ld.so.cache

CMD ["jshell"]
USER 1001
Loading