diff --git a/11/jdk/alpine/Dockerfile.hotspot.nightly.full b/11/jdk/alpine/Dockerfile.hotspot.nightly.full index 518e1bf2f..eecc668a8 100644 --- a/11/jdk/alpine/Dockerfile.hotspot.nightly.full +++ b/11/jdk/alpine/Dockerfile.hotspot.nightly.full @@ -61,24 +61,24 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/alpine/Dockerfile.hotspot.nightly.slim b/11/jdk/alpine/Dockerfile.hotspot.nightly.slim index 2d189fe24..975018614 100644 --- a/11/jdk/alpine/Dockerfile.hotspot.nightly.slim +++ b/11/jdk/alpine/Dockerfile.hotspot.nightly.slim @@ -63,24 +63,24 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/alpine/Dockerfile.openj9.nightly.full b/11/jdk/alpine/Dockerfile.openj9.nightly.full index 1f241cf80..89031baf5 100644 --- a/11/jdk/alpine/Dockerfile.openj9.nightly.full +++ b/11/jdk/alpine/Dockerfile.openj9.nightly.full @@ -61,20 +61,20 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/alpine/Dockerfile.openj9.nightly.slim b/11/jdk/alpine/Dockerfile.openj9.nightly.slim index 5edfa73fc..efbe60e8f 100644 --- a/11/jdk/alpine/Dockerfile.openj9.nightly.slim +++ b/11/jdk/alpine/Dockerfile.openj9.nightly.slim @@ -63,20 +63,20 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/alpine/generate_openj9_scc.sh b/11/jdk/alpine/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jdk/alpine/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jdk/centos/Dockerfile.hotspot.nightly.full b/11/jdk/centos/Dockerfile.hotspot.nightly.full index 76f7defdc..ab4f45201 100644 --- a/11/jdk/centos/Dockerfile.hotspot.nightly.full +++ b/11/jdk/centos/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/centos/Dockerfile.hotspot.nightly.slim b/11/jdk/centos/Dockerfile.hotspot.nightly.slim index 0f19cf60c..7066dbc63 100644 --- a/11/jdk/centos/Dockerfile.hotspot.nightly.slim +++ b/11/jdk/centos/Dockerfile.hotspot.nightly.slim @@ -32,24 +32,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/centos/Dockerfile.openj9.nightly.full b/11/jdk/centos/Dockerfile.openj9.nightly.full index 6c19d4904..acf687342 100644 --- a/11/jdk/centos/Dockerfile.openj9.nightly.full +++ b/11/jdk/centos/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/centos/Dockerfile.openj9.nightly.slim b/11/jdk/centos/Dockerfile.openj9.nightly.slim index 40644a713..676ad2310 100644 --- a/11/jdk/centos/Dockerfile.openj9.nightly.slim +++ b/11/jdk/centos/Dockerfile.openj9.nightly.slim @@ -32,20 +32,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/centos/generate_openj9_scc.sh b/11/jdk/centos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jdk/centos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jdk/clefos/Dockerfile.hotspot.nightly.full b/11/jdk/clefos/Dockerfile.hotspot.nightly.full index 781bc1e94..c1bf3ea66 100644 --- a/11/jdk/clefos/Dockerfile.hotspot.nightly.full +++ b/11/jdk/clefos/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/clefos/Dockerfile.hotspot.nightly.slim b/11/jdk/clefos/Dockerfile.hotspot.nightly.slim index b7da50020..7cb1106f0 100644 --- a/11/jdk/clefos/Dockerfile.hotspot.nightly.slim +++ b/11/jdk/clefos/Dockerfile.hotspot.nightly.slim @@ -32,24 +32,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/clefos/Dockerfile.openj9.nightly.full b/11/jdk/clefos/Dockerfile.openj9.nightly.full index 97ca9a28e..44c5cb3fd 100644 --- a/11/jdk/clefos/Dockerfile.openj9.nightly.full +++ b/11/jdk/clefos/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/clefos/Dockerfile.openj9.nightly.slim b/11/jdk/clefos/Dockerfile.openj9.nightly.slim index 2f87b0225..30ad9074f 100644 --- a/11/jdk/clefos/Dockerfile.openj9.nightly.slim +++ b/11/jdk/clefos/Dockerfile.openj9.nightly.slim @@ -32,20 +32,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/clefos/generate_openj9_scc.sh b/11/jdk/clefos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jdk/clefos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jdk/debian/Dockerfile.hotspot.nightly.full b/11/jdk/debian/Dockerfile.hotspot.nightly.full index 9b440a3b5..0fa348288 100644 --- a/11/jdk/debian/Dockerfile.hotspot.nightly.full +++ b/11/jdk/debian/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/debian/Dockerfile.hotspot.nightly.slim b/11/jdk/debian/Dockerfile.hotspot.nightly.slim index 1a95c4316..781a34602 100644 --- a/11/jdk/debian/Dockerfile.hotspot.nightly.slim +++ b/11/jdk/debian/Dockerfile.hotspot.nightly.slim @@ -35,24 +35,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/debian/Dockerfile.openj9.nightly.full b/11/jdk/debian/Dockerfile.openj9.nightly.full index 9568aa06e..c9688bd5e 100644 --- a/11/jdk/debian/Dockerfile.openj9.nightly.full +++ b/11/jdk/debian/Dockerfile.openj9.nightly.full @@ -33,20 +33,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/debian/Dockerfile.openj9.nightly.slim b/11/jdk/debian/Dockerfile.openj9.nightly.slim index dff4092fe..9b27b525b 100644 --- a/11/jdk/debian/Dockerfile.openj9.nightly.slim +++ b/11/jdk/debian/Dockerfile.openj9.nightly.slim @@ -35,20 +35,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/debian/generate_openj9_scc.sh b/11/jdk/debian/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jdk/debian/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jdk/debianslim/Dockerfile.hotspot.nightly.full b/11/jdk/debianslim/Dockerfile.hotspot.nightly.full index 1350811d8..059285da2 100644 --- a/11/jdk/debianslim/Dockerfile.hotspot.nightly.full +++ b/11/jdk/debianslim/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/debianslim/Dockerfile.hotspot.nightly.slim b/11/jdk/debianslim/Dockerfile.hotspot.nightly.slim index 21dbff7f6..0839e56ab 100644 --- a/11/jdk/debianslim/Dockerfile.hotspot.nightly.slim +++ b/11/jdk/debianslim/Dockerfile.hotspot.nightly.slim @@ -35,24 +35,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/debianslim/Dockerfile.openj9.nightly.full b/11/jdk/debianslim/Dockerfile.openj9.nightly.full index f4a0df97d..a7108ea31 100644 --- a/11/jdk/debianslim/Dockerfile.openj9.nightly.full +++ b/11/jdk/debianslim/Dockerfile.openj9.nightly.full @@ -33,20 +33,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/debianslim/Dockerfile.openj9.nightly.slim b/11/jdk/debianslim/Dockerfile.openj9.nightly.slim index fcce3c1b4..060aadec2 100644 --- a/11/jdk/debianslim/Dockerfile.openj9.nightly.slim +++ b/11/jdk/debianslim/Dockerfile.openj9.nightly.slim @@ -35,20 +35,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/debianslim/generate_openj9_scc.sh b/11/jdk/debianslim/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jdk/debianslim/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jdk/leap/Dockerfile.hotspot.nightly.full b/11/jdk/leap/Dockerfile.hotspot.nightly.full index 65db79b8e..b515f1b94 100644 --- a/11/jdk/leap/Dockerfile.hotspot.nightly.full +++ b/11/jdk/leap/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/leap/Dockerfile.openj9.nightly.full b/11/jdk/leap/Dockerfile.openj9.nightly.full index d52a53d0d..98df3655b 100644 --- a/11/jdk/leap/Dockerfile.openj9.nightly.full +++ b/11/jdk/leap/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/leap/generate_openj9_scc.sh b/11/jdk/leap/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jdk/leap/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jdk/tumbleweed/Dockerfile.hotspot.nightly.full b/11/jdk/tumbleweed/Dockerfile.hotspot.nightly.full index 048b03cc4..ad4607aa9 100644 --- a/11/jdk/tumbleweed/Dockerfile.hotspot.nightly.full +++ b/11/jdk/tumbleweed/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/tumbleweed/Dockerfile.openj9.nightly.full b/11/jdk/tumbleweed/Dockerfile.openj9.nightly.full index 9d5bad496..ca201a54f 100644 --- a/11/jdk/tumbleweed/Dockerfile.openj9.nightly.full +++ b/11/jdk/tumbleweed/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/tumbleweed/generate_openj9_scc.sh b/11/jdk/tumbleweed/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jdk/tumbleweed/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jdk/ubi-minimal/Dockerfile.hotspot.nightly.full b/11/jdk/ubi-minimal/Dockerfile.hotspot.nightly.full index d54e77a06..46046d189 100644 --- a/11/jdk/ubi-minimal/Dockerfile.hotspot.nightly.full +++ b/11/jdk/ubi-minimal/Dockerfile.hotspot.nightly.full @@ -38,24 +38,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/ubi-minimal/Dockerfile.openj9.nightly.full b/11/jdk/ubi-minimal/Dockerfile.openj9.nightly.full index a6af9de78..236a9bdf9 100644 --- a/11/jdk/ubi-minimal/Dockerfile.openj9.nightly.full +++ b/11/jdk/ubi-minimal/Dockerfile.openj9.nightly.full @@ -38,20 +38,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/ubi-minimal/generate_openj9_scc.sh b/11/jdk/ubi-minimal/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jdk/ubi-minimal/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jdk/ubi/Dockerfile.hotspot.nightly.full b/11/jdk/ubi/Dockerfile.hotspot.nightly.full index 1312841f0..82642da93 100644 --- a/11/jdk/ubi/Dockerfile.hotspot.nightly.full +++ b/11/jdk/ubi/Dockerfile.hotspot.nightly.full @@ -38,24 +38,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/ubi/Dockerfile.hotspot.nightly.slim b/11/jdk/ubi/Dockerfile.hotspot.nightly.slim index 0159e69da..4022d0de5 100644 --- a/11/jdk/ubi/Dockerfile.hotspot.nightly.slim +++ b/11/jdk/ubi/Dockerfile.hotspot.nightly.slim @@ -40,24 +40,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/ubi/Dockerfile.openj9.nightly.full b/11/jdk/ubi/Dockerfile.openj9.nightly.full index 0f34a6575..382047e51 100644 --- a/11/jdk/ubi/Dockerfile.openj9.nightly.full +++ b/11/jdk/ubi/Dockerfile.openj9.nightly.full @@ -38,20 +38,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/ubi/Dockerfile.openj9.nightly.slim b/11/jdk/ubi/Dockerfile.openj9.nightly.slim index 31f4340b1..bfa485fe4 100644 --- a/11/jdk/ubi/Dockerfile.openj9.nightly.slim +++ b/11/jdk/ubi/Dockerfile.openj9.nightly.slim @@ -40,20 +40,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/ubi/generate_openj9_scc.sh b/11/jdk/ubi/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jdk/ubi/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jdk/ubuntu/Dockerfile.hotspot.nightly.full b/11/jdk/ubuntu/Dockerfile.hotspot.nightly.full index b4c0ed4af..089aadc09 100644 --- a/11/jdk/ubuntu/Dockerfile.hotspot.nightly.full +++ b/11/jdk/ubuntu/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/ubuntu/Dockerfile.hotspot.nightly.slim b/11/jdk/ubuntu/Dockerfile.hotspot.nightly.slim index 0e267fa5c..941107d66 100644 --- a/11/jdk/ubuntu/Dockerfile.hotspot.nightly.slim +++ b/11/jdk/ubuntu/Dockerfile.hotspot.nightly.slim @@ -35,24 +35,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='f989a9d3621a7952c61ce8858d31de64ca3e064b5c4802c8d7da998155696482'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='ffc8e2f57143a3ceb2fc8dc64705d4ff1cbeb38efdda0185363c1dec05c53cc1'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='887dc016ca18b9b6ee3047b8d03af609a80512488503dcc07ae74a9f8b9d0894'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8704272ead3cc197533ace95631ff2c0430af17a3cccedb48196a2a65dc82944'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b8018907830ab1d480e816ff4eeefa2600008c501c67c3a1121f7ac7f4130921'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='ef0fb83512d109b99a4dcce9d787f0fad62899860ad003e0e9b60aa57ce21c4e'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='fb771dbab8f23cf46941a9f10ce185dd2ff047b76b801421d1d234a094527f7a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8f97c1297127d53dae3ccad54530b806c660f18b8bcc76ac165f4e55f56589a7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='88f2d09a1682fdb91a313b916a8ac05596a9256e975c80c8d169ecc4e78dfce0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jdk_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='abc0c4380a7a89ff799c164d8afc0f8857bb2bf8766d9735b97c03fd6ec1b65f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/ubuntu/Dockerfile.openj9.nightly.full b/11/jdk/ubuntu/Dockerfile.openj9.nightly.full index cb51b8016..e1478a2b7 100644 --- a/11/jdk/ubuntu/Dockerfile.openj9.nightly.full +++ b/11/jdk/ubuntu/Dockerfile.openj9.nightly.full @@ -33,20 +33,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/ubuntu/Dockerfile.openj9.nightly.slim b/11/jdk/ubuntu/Dockerfile.openj9.nightly.slim index 526840b65..c76ff2528 100644 --- a/11/jdk/ubuntu/Dockerfile.openj9.nightly.slim +++ b/11/jdk/ubuntu/Dockerfile.openj9.nightly.slim @@ -35,20 +35,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='8306506754bfb128a874839ee41aaa5bf6f18748fb92f050d3da29ed99ff7eb9'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='a8435cad6d1d31ba365c5146f733ca435c873b6b8d64c0028f483ed850284ef8'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='be702c783ee9c753e93ebfebb1a9009a91095d5051af7f1ba6c5884385695a3c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='5e44150373272ebb55f3a8edd758acc769b4f01baadc21d1e5e42e778c0fe23b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='dfb48cdc79c4834c9de929e6832366b459826bee0c3f92c6c512ce5d6be4d394'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1e5e89d1ed7161e55d88bcd9c1109ec95681dba823bfb90a948b2b294424b09c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='0728d852e4aebe5ffd3bf2af1c882906c94fa76ad5a6b103177f7314a0535b1c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='41db6124a61f8e09707f54d62c53abf76f415a6acdb522bff2abc2e1ae5fcaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jdk/ubuntu/generate_openj9_scc.sh b/11/jdk/ubuntu/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jdk/ubuntu/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full b/11/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full index f9e7680e2..8636bffd3 100644 --- a/11/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full +++ b/11/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk11u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (83d31876eb8d421babf59bcd7ff883d72ffe2c6254fd29b73f9dfed2dde6e398) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '83d31876eb8d421babf59bcd7ff883d72ffe2c6254fd29b73f9dfed2dde6e398') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (69041f2dbb0cb3619304aedfe1225c0c8f5a877a5c5e124ff9629a04f5feda90) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '69041f2dbb0cb3619304aedfe1225c0c8f5a877a5c5e124ff9629a04f5feda90') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim b/11/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim index d536ecd2c..8dc6f30ee 100644 --- a/11/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim +++ b/11/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk11u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (83d31876eb8d421babf59bcd7ff883d72ffe2c6254fd29b73f9dfed2dde6e398) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '83d31876eb8d421babf59bcd7ff883d72ffe2c6254fd29b73f9dfed2dde6e398') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (69041f2dbb0cb3619304aedfe1225c0c8f5a877a5c5e124ff9629a04f5feda90) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '69041f2dbb0cb3619304aedfe1225c0c8f5a877a5c5e124ff9629a04f5feda90') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full b/11/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full index c4711495a..f9407cd15 100644 --- a/11/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full +++ b/11/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] diff --git a/11/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.full b/11/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.full index 79101ae96..2a6b0e786 100644 --- a/11/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.full +++ b/11/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk11u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (8e0cd904295fde68e7ca8ca179b476cfa9deee79a35caf2501b39fa88064d5eb) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '8e0cd904295fde68e7ca8ca179b476cfa9deee79a35caf2501b39fa88064d5eb') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (fadf971af6d5834212f6902099c1e647913c32597eb4cccf8ab14b3a9bed39cd) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'fadf971af6d5834212f6902099c1e647913c32597eb4cccf8ab14b3a9bed39cd') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim b/11/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim index 30e3b8ef5..c6e926eac 100644 --- a/11/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim +++ b/11/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk11u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (8e0cd904295fde68e7ca8ca179b476cfa9deee79a35caf2501b39fa88064d5eb) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '8e0cd904295fde68e7ca8ca179b476cfa9deee79a35caf2501b39fa88064d5eb') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (fadf971af6d5834212f6902099c1e647913c32597eb4cccf8ab14b3a9bed39cd) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'fadf971af6d5834212f6902099c1e647913c32597eb4cccf8ab14b3a9bed39cd') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full b/11/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full index 72741b275..b471ee562 100644 --- a/11/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full +++ b/11/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk11u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (83d31876eb8d421babf59bcd7ff883d72ffe2c6254fd29b73f9dfed2dde6e398) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '83d31876eb8d421babf59bcd7ff883d72ffe2c6254fd29b73f9dfed2dde6e398') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (69041f2dbb0cb3619304aedfe1225c0c8f5a877a5c5e124ff9629a04f5feda90) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '69041f2dbb0cb3619304aedfe1225c0c8f5a877a5c5e124ff9629a04f5feda90') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim b/11/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim index 29e300737..15a145d97 100644 --- a/11/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim +++ b/11/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk11u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (83d31876eb8d421babf59bcd7ff883d72ffe2c6254fd29b73f9dfed2dde6e398) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '83d31876eb8d421babf59bcd7ff883d72ffe2c6254fd29b73f9dfed2dde6e398') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (69041f2dbb0cb3619304aedfe1225c0c8f5a877a5c5e124ff9629a04f5feda90) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '69041f2dbb0cb3619304aedfe1225c0c8f5a877a5c5e124ff9629a04f5feda90') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.full b/11/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.full index f78e9d570..d7a6415f9 100644 --- a/11/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.full +++ b/11/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk11u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (8e0cd904295fde68e7ca8ca179b476cfa9deee79a35caf2501b39fa88064d5eb) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '8e0cd904295fde68e7ca8ca179b476cfa9deee79a35caf2501b39fa88064d5eb') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (fadf971af6d5834212f6902099c1e647913c32597eb4cccf8ab14b3a9bed39cd) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'fadf971af6d5834212f6902099c1e647913c32597eb4cccf8ab14b3a9bed39cd') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim b/11/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim index 7139407ec..ae934da5c 100644 --- a/11/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim +++ b/11/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk11u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (8e0cd904295fde68e7ca8ca179b476cfa9deee79a35caf2501b39fa88064d5eb) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '8e0cd904295fde68e7ca8ca179b476cfa9deee79a35caf2501b39fa88064d5eb') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (fadf971af6d5834212f6902099c1e647913c32597eb4cccf8ab14b3a9bed39cd) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'fadf971af6d5834212f6902099c1e647913c32597eb4cccf8ab14b3a9bed39cd') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full b/11/jdk/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full index 2dff1722e..0cf33b2c9 100644 --- a/11/jdk/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full +++ b/11/jdk/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (8eb600f29476c5276042027b9a88c392ca5d254bb97b7b6287f2b5d84a7c2b41) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '8eb600f29476c5276042027b9a88c392ca5d254bb97b7b6287f2b5d84a7c2b41') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (b26e8864741d21842d2f89a2c12b9f9f78a07411b4bd4863e0ec4e0055d0fe2f) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'b26e8864741d21842d2f89a2c12b9f9f78a07411b4bd4863e0ec4e0055d0fe2f') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full b/11/jdk/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full index 2b6a09db4..7ee83fb74 100644 --- a/11/jdk/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full +++ b/11/jdk/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (9935786c9b862db82c3aebf047e9f6f88feae757b022c9b2ca102b64e38ed3e4) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9935786c9b862db82c3aebf047e9f6f88feae757b022c9b2ca102b64e38ed3e4') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (5fcb54a8d0c618b87847a174b4903c49a1d2d8860ebac743f85674ac3facc7b5) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '5fcb54a8d0c618b87847a174b4903c49a1d2d8860ebac743f85674ac3facc7b5') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full b/11/jdk/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full index c569a12f7..90f08a380 100644 --- a/11/jdk/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full +++ b/11/jdk/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (8eb600f29476c5276042027b9a88c392ca5d254bb97b7b6287f2b5d84a7c2b41) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '8eb600f29476c5276042027b9a88c392ca5d254bb97b7b6287f2b5d84a7c2b41') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (b26e8864741d21842d2f89a2c12b9f9f78a07411b4bd4863e0ec4e0055d0fe2f) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'b26e8864741d21842d2f89a2c12b9f9f78a07411b4bd4863e0ec4e0055d0fe2f') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full b/11/jdk/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full index 2c7cd2ce2..11fc4c18a 100644 --- a/11/jdk/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full +++ b/11/jdk/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (9935786c9b862db82c3aebf047e9f6f88feae757b022c9b2ca102b64e38ed3e4) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9935786c9b862db82c3aebf047e9f6f88feae757b022c9b2ca102b64e38ed3e4') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (5fcb54a8d0c618b87847a174b4903c49a1d2d8860ebac743f85674ac3facc7b5) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '5fcb54a8d0c618b87847a174b4903c49a1d2d8860ebac743f85674ac3facc7b5') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full b/11/jdk/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full index fe4911a5b..b673e61b2 100644 --- a/11/jdk/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full +++ b/11/jdk/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (8eb600f29476c5276042027b9a88c392ca5d254bb97b7b6287f2b5d84a7c2b41) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '8eb600f29476c5276042027b9a88c392ca5d254bb97b7b6287f2b5d84a7c2b41') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (b26e8864741d21842d2f89a2c12b9f9f78a07411b4bd4863e0ec4e0055d0fe2f) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'b26e8864741d21842d2f89a2c12b9f9f78a07411b4bd4863e0ec4e0055d0fe2f') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full b/11/jdk/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full index 3c301addb..7dc572d6b 100644 --- a/11/jdk/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full +++ b/11/jdk/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (9935786c9b862db82c3aebf047e9f6f88feae757b022c9b2ca102b64e38ed3e4) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9935786c9b862db82c3aebf047e9f6f88feae757b022c9b2ca102b64e38ed3e4') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (5fcb54a8d0c618b87847a174b4903c49a1d2d8860ebac743f85674ac3facc7b5) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '5fcb54a8d0c618b87847a174b4903c49a1d2d8860ebac743f85674ac3facc7b5') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full b/11/jdk/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full index 52cf8895f..2a9066513 100644 --- a/11/jdk/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full +++ b/11/jdk/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (8eb600f29476c5276042027b9a88c392ca5d254bb97b7b6287f2b5d84a7c2b41) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '8eb600f29476c5276042027b9a88c392ca5d254bb97b7b6287f2b5d84a7c2b41') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_hotspot_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (b26e8864741d21842d2f89a2c12b9f9f78a07411b4bd4863e0ec4e0055d0fe2f) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'b26e8864741d21842d2f89a2c12b9f9f78a07411b4bd4863e0ec4e0055d0fe2f') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jdk/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full b/11/jdk/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full index f0375c648..886911440 100644 --- a/11/jdk/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full +++ b/11/jdk/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jdk_x64_windows_openj9_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (9935786c9b862db82c3aebf047e9f6f88feae757b022c9b2ca102b64e38ed3e4) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9935786c9b862db82c3aebf047e9f6f88feae757b022c9b2ca102b64e38ed3e4') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jdk_x64_windows_openj9_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (5fcb54a8d0c618b87847a174b4903c49a1d2d8860ebac743f85674ac3facc7b5) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '5fcb54a8d0c618b87847a174b4903c49a1d2d8860ebac743f85674ac3facc7b5') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/alpine/Dockerfile.hotspot.nightly.full b/11/jre/alpine/Dockerfile.hotspot.nightly.full index 54c6f96ac..0138a7758 100644 --- a/11/jre/alpine/Dockerfile.hotspot.nightly.full +++ b/11/jre/alpine/Dockerfile.hotspot.nightly.full @@ -61,24 +61,24 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='a683e5e4ed3895467bfa4fb10f485cddc7ecfd5fb17d614c182f2ff1aea99f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jre_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='cc02f2868594a26e801b7ac50a7df757ec4f4969b5fcf57b6dd555fcebd6ee45'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='479355b6dbbebcdb82d0fd45208370cb53d8f64ca20320512a7e01801a893861'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='992f082a919e3db004c260ac4d59e170947c95f4f8794ca9c68de5119dc5b269'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5fc10da24c439adcc6bb9d36e4f856574ee70a9cc6b554fc2f01787e9ea712ec'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8b987fdba9f75cdf1419332c0f1078adfee89349acf1957a68e8f46637449155'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='42f90f3dc4e0ff00004f8bcf7c8e1cb255c380c83bb816da631ba3763b31b2ce'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='73d0ac0ed82e1c32fe3aa6fc6aebbf784c1119c9fd2b527875666d53be5abdae'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='6010104c0dbc428469dd748196648fde43629d55adf6500190f1a71133d105bd'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='c77c1654cc945fa06e593409286aee5384d765a4ff08e36e51faa67e26d4b9bc'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/alpine/Dockerfile.openj9.nightly.full b/11/jre/alpine/Dockerfile.openj9.nightly.full index b1aa6bde3..1dbcb5f2b 100644 --- a/11/jre/alpine/Dockerfile.openj9.nightly.full +++ b/11/jre/alpine/Dockerfile.openj9.nightly.full @@ -61,20 +61,20 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='3ebf68f17541ee7ff6f59661f2a8074360af8957ccbccbdb49915c89a9ea0271'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='2a4f6491eaf6a92a7c11c5b41dbaeb83958e6fd792cbfd2e40df40ea6927a940'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='034ea563f740da179c9b978e9c197ee10b32425a35ffdb62f2bb452ab75685b3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1b126521aca7899e58a4a1d6d28f4ccf70bf02377476c395f413f0fe0c459efd'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='bf9647fc4b1ea03b3b3ad4a011bf93e58ea0fad662befc227e14ff92c7c12c46'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='53f49cea4e3c7634c8f146567ba3f20911b65752cc9837c3634c9f202d276e49'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='229f7c121863cdfbe6156e385e09fd8421c03dadf112918603e3f0c771f92f9b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='50f8266d36ff0797b845ce00739616151c15f6e9b869c3b083a3c9ea8fba5b69'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/alpine/generate_openj9_scc.sh b/11/jre/alpine/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jre/alpine/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jre/centos/Dockerfile.hotspot.nightly.full b/11/jre/centos/Dockerfile.hotspot.nightly.full index 3bcf0a1d1..be6a91666 100644 --- a/11/jre/centos/Dockerfile.hotspot.nightly.full +++ b/11/jre/centos/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='a683e5e4ed3895467bfa4fb10f485cddc7ecfd5fb17d614c182f2ff1aea99f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jre_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='cc02f2868594a26e801b7ac50a7df757ec4f4969b5fcf57b6dd555fcebd6ee45'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='479355b6dbbebcdb82d0fd45208370cb53d8f64ca20320512a7e01801a893861'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='992f082a919e3db004c260ac4d59e170947c95f4f8794ca9c68de5119dc5b269'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5fc10da24c439adcc6bb9d36e4f856574ee70a9cc6b554fc2f01787e9ea712ec'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8b987fdba9f75cdf1419332c0f1078adfee89349acf1957a68e8f46637449155'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='42f90f3dc4e0ff00004f8bcf7c8e1cb255c380c83bb816da631ba3763b31b2ce'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='73d0ac0ed82e1c32fe3aa6fc6aebbf784c1119c9fd2b527875666d53be5abdae'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='6010104c0dbc428469dd748196648fde43629d55adf6500190f1a71133d105bd'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='c77c1654cc945fa06e593409286aee5384d765a4ff08e36e51faa67e26d4b9bc'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/centos/Dockerfile.openj9.nightly.full b/11/jre/centos/Dockerfile.openj9.nightly.full index c1d14eb17..e365c8fa5 100644 --- a/11/jre/centos/Dockerfile.openj9.nightly.full +++ b/11/jre/centos/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='3ebf68f17541ee7ff6f59661f2a8074360af8957ccbccbdb49915c89a9ea0271'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='2a4f6491eaf6a92a7c11c5b41dbaeb83958e6fd792cbfd2e40df40ea6927a940'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='034ea563f740da179c9b978e9c197ee10b32425a35ffdb62f2bb452ab75685b3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1b126521aca7899e58a4a1d6d28f4ccf70bf02377476c395f413f0fe0c459efd'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='bf9647fc4b1ea03b3b3ad4a011bf93e58ea0fad662befc227e14ff92c7c12c46'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='53f49cea4e3c7634c8f146567ba3f20911b65752cc9837c3634c9f202d276e49'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='229f7c121863cdfbe6156e385e09fd8421c03dadf112918603e3f0c771f92f9b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='50f8266d36ff0797b845ce00739616151c15f6e9b869c3b083a3c9ea8fba5b69'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/centos/generate_openj9_scc.sh b/11/jre/centos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jre/centos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jre/clefos/Dockerfile.hotspot.nightly.full b/11/jre/clefos/Dockerfile.hotspot.nightly.full index a79975108..cd882897a 100644 --- a/11/jre/clefos/Dockerfile.hotspot.nightly.full +++ b/11/jre/clefos/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='a683e5e4ed3895467bfa4fb10f485cddc7ecfd5fb17d614c182f2ff1aea99f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jre_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='cc02f2868594a26e801b7ac50a7df757ec4f4969b5fcf57b6dd555fcebd6ee45'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='479355b6dbbebcdb82d0fd45208370cb53d8f64ca20320512a7e01801a893861'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='992f082a919e3db004c260ac4d59e170947c95f4f8794ca9c68de5119dc5b269'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5fc10da24c439adcc6bb9d36e4f856574ee70a9cc6b554fc2f01787e9ea712ec'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8b987fdba9f75cdf1419332c0f1078adfee89349acf1957a68e8f46637449155'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='42f90f3dc4e0ff00004f8bcf7c8e1cb255c380c83bb816da631ba3763b31b2ce'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='73d0ac0ed82e1c32fe3aa6fc6aebbf784c1119c9fd2b527875666d53be5abdae'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='6010104c0dbc428469dd748196648fde43629d55adf6500190f1a71133d105bd'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='c77c1654cc945fa06e593409286aee5384d765a4ff08e36e51faa67e26d4b9bc'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/clefos/Dockerfile.openj9.nightly.full b/11/jre/clefos/Dockerfile.openj9.nightly.full index 9d9e4968b..960c34b71 100644 --- a/11/jre/clefos/Dockerfile.openj9.nightly.full +++ b/11/jre/clefos/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='3ebf68f17541ee7ff6f59661f2a8074360af8957ccbccbdb49915c89a9ea0271'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='2a4f6491eaf6a92a7c11c5b41dbaeb83958e6fd792cbfd2e40df40ea6927a940'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='034ea563f740da179c9b978e9c197ee10b32425a35ffdb62f2bb452ab75685b3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1b126521aca7899e58a4a1d6d28f4ccf70bf02377476c395f413f0fe0c459efd'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='bf9647fc4b1ea03b3b3ad4a011bf93e58ea0fad662befc227e14ff92c7c12c46'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='53f49cea4e3c7634c8f146567ba3f20911b65752cc9837c3634c9f202d276e49'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='229f7c121863cdfbe6156e385e09fd8421c03dadf112918603e3f0c771f92f9b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='50f8266d36ff0797b845ce00739616151c15f6e9b869c3b083a3c9ea8fba5b69'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/clefos/generate_openj9_scc.sh b/11/jre/clefos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jre/clefos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jre/debian/Dockerfile.hotspot.nightly.full b/11/jre/debian/Dockerfile.hotspot.nightly.full index 9143aacb0..3ae598f97 100644 --- a/11/jre/debian/Dockerfile.hotspot.nightly.full +++ b/11/jre/debian/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='a683e5e4ed3895467bfa4fb10f485cddc7ecfd5fb17d614c182f2ff1aea99f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jre_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='cc02f2868594a26e801b7ac50a7df757ec4f4969b5fcf57b6dd555fcebd6ee45'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='479355b6dbbebcdb82d0fd45208370cb53d8f64ca20320512a7e01801a893861'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='992f082a919e3db004c260ac4d59e170947c95f4f8794ca9c68de5119dc5b269'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5fc10da24c439adcc6bb9d36e4f856574ee70a9cc6b554fc2f01787e9ea712ec'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8b987fdba9f75cdf1419332c0f1078adfee89349acf1957a68e8f46637449155'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='42f90f3dc4e0ff00004f8bcf7c8e1cb255c380c83bb816da631ba3763b31b2ce'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='73d0ac0ed82e1c32fe3aa6fc6aebbf784c1119c9fd2b527875666d53be5abdae'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='6010104c0dbc428469dd748196648fde43629d55adf6500190f1a71133d105bd'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='c77c1654cc945fa06e593409286aee5384d765a4ff08e36e51faa67e26d4b9bc'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/debian/Dockerfile.openj9.nightly.full b/11/jre/debian/Dockerfile.openj9.nightly.full index d1ef137c8..a050cb409 100644 --- a/11/jre/debian/Dockerfile.openj9.nightly.full +++ b/11/jre/debian/Dockerfile.openj9.nightly.full @@ -33,20 +33,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='3ebf68f17541ee7ff6f59661f2a8074360af8957ccbccbdb49915c89a9ea0271'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='2a4f6491eaf6a92a7c11c5b41dbaeb83958e6fd792cbfd2e40df40ea6927a940'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='034ea563f740da179c9b978e9c197ee10b32425a35ffdb62f2bb452ab75685b3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1b126521aca7899e58a4a1d6d28f4ccf70bf02377476c395f413f0fe0c459efd'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='bf9647fc4b1ea03b3b3ad4a011bf93e58ea0fad662befc227e14ff92c7c12c46'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='53f49cea4e3c7634c8f146567ba3f20911b65752cc9837c3634c9f202d276e49'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='229f7c121863cdfbe6156e385e09fd8421c03dadf112918603e3f0c771f92f9b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='50f8266d36ff0797b845ce00739616151c15f6e9b869c3b083a3c9ea8fba5b69'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/debian/generate_openj9_scc.sh b/11/jre/debian/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jre/debian/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jre/debianslim/Dockerfile.hotspot.nightly.full b/11/jre/debianslim/Dockerfile.hotspot.nightly.full index ede7ded71..457115b0f 100644 --- a/11/jre/debianslim/Dockerfile.hotspot.nightly.full +++ b/11/jre/debianslim/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='a683e5e4ed3895467bfa4fb10f485cddc7ecfd5fb17d614c182f2ff1aea99f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jre_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='cc02f2868594a26e801b7ac50a7df757ec4f4969b5fcf57b6dd555fcebd6ee45'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='479355b6dbbebcdb82d0fd45208370cb53d8f64ca20320512a7e01801a893861'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='992f082a919e3db004c260ac4d59e170947c95f4f8794ca9c68de5119dc5b269'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5fc10da24c439adcc6bb9d36e4f856574ee70a9cc6b554fc2f01787e9ea712ec'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8b987fdba9f75cdf1419332c0f1078adfee89349acf1957a68e8f46637449155'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='42f90f3dc4e0ff00004f8bcf7c8e1cb255c380c83bb816da631ba3763b31b2ce'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='73d0ac0ed82e1c32fe3aa6fc6aebbf784c1119c9fd2b527875666d53be5abdae'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='6010104c0dbc428469dd748196648fde43629d55adf6500190f1a71133d105bd'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='c77c1654cc945fa06e593409286aee5384d765a4ff08e36e51faa67e26d4b9bc'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/debianslim/Dockerfile.openj9.nightly.full b/11/jre/debianslim/Dockerfile.openj9.nightly.full index 67ae6d4bc..26cec3fd2 100644 --- a/11/jre/debianslim/Dockerfile.openj9.nightly.full +++ b/11/jre/debianslim/Dockerfile.openj9.nightly.full @@ -33,20 +33,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='3ebf68f17541ee7ff6f59661f2a8074360af8957ccbccbdb49915c89a9ea0271'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='2a4f6491eaf6a92a7c11c5b41dbaeb83958e6fd792cbfd2e40df40ea6927a940'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='034ea563f740da179c9b978e9c197ee10b32425a35ffdb62f2bb452ab75685b3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1b126521aca7899e58a4a1d6d28f4ccf70bf02377476c395f413f0fe0c459efd'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='bf9647fc4b1ea03b3b3ad4a011bf93e58ea0fad662befc227e14ff92c7c12c46'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='53f49cea4e3c7634c8f146567ba3f20911b65752cc9837c3634c9f202d276e49'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='229f7c121863cdfbe6156e385e09fd8421c03dadf112918603e3f0c771f92f9b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='50f8266d36ff0797b845ce00739616151c15f6e9b869c3b083a3c9ea8fba5b69'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/debianslim/generate_openj9_scc.sh b/11/jre/debianslim/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jre/debianslim/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jre/leap/Dockerfile.hotspot.nightly.full b/11/jre/leap/Dockerfile.hotspot.nightly.full index e9ac6525b..9d70b2f11 100644 --- a/11/jre/leap/Dockerfile.hotspot.nightly.full +++ b/11/jre/leap/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='a683e5e4ed3895467bfa4fb10f485cddc7ecfd5fb17d614c182f2ff1aea99f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jre_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='cc02f2868594a26e801b7ac50a7df757ec4f4969b5fcf57b6dd555fcebd6ee45'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='479355b6dbbebcdb82d0fd45208370cb53d8f64ca20320512a7e01801a893861'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='992f082a919e3db004c260ac4d59e170947c95f4f8794ca9c68de5119dc5b269'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5fc10da24c439adcc6bb9d36e4f856574ee70a9cc6b554fc2f01787e9ea712ec'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8b987fdba9f75cdf1419332c0f1078adfee89349acf1957a68e8f46637449155'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='42f90f3dc4e0ff00004f8bcf7c8e1cb255c380c83bb816da631ba3763b31b2ce'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='73d0ac0ed82e1c32fe3aa6fc6aebbf784c1119c9fd2b527875666d53be5abdae'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='6010104c0dbc428469dd748196648fde43629d55adf6500190f1a71133d105bd'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='c77c1654cc945fa06e593409286aee5384d765a4ff08e36e51faa67e26d4b9bc'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/leap/Dockerfile.openj9.nightly.full b/11/jre/leap/Dockerfile.openj9.nightly.full index 47e55e551..b1a6f8247 100644 --- a/11/jre/leap/Dockerfile.openj9.nightly.full +++ b/11/jre/leap/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='3ebf68f17541ee7ff6f59661f2a8074360af8957ccbccbdb49915c89a9ea0271'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='2a4f6491eaf6a92a7c11c5b41dbaeb83958e6fd792cbfd2e40df40ea6927a940'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='034ea563f740da179c9b978e9c197ee10b32425a35ffdb62f2bb452ab75685b3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1b126521aca7899e58a4a1d6d28f4ccf70bf02377476c395f413f0fe0c459efd'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='bf9647fc4b1ea03b3b3ad4a011bf93e58ea0fad662befc227e14ff92c7c12c46'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='53f49cea4e3c7634c8f146567ba3f20911b65752cc9837c3634c9f202d276e49'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='229f7c121863cdfbe6156e385e09fd8421c03dadf112918603e3f0c771f92f9b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='50f8266d36ff0797b845ce00739616151c15f6e9b869c3b083a3c9ea8fba5b69'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/leap/generate_openj9_scc.sh b/11/jre/leap/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jre/leap/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jre/tumbleweed/Dockerfile.hotspot.nightly.full b/11/jre/tumbleweed/Dockerfile.hotspot.nightly.full index b48ee09d7..3f87a238c 100644 --- a/11/jre/tumbleweed/Dockerfile.hotspot.nightly.full +++ b/11/jre/tumbleweed/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='a683e5e4ed3895467bfa4fb10f485cddc7ecfd5fb17d614c182f2ff1aea99f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jre_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='cc02f2868594a26e801b7ac50a7df757ec4f4969b5fcf57b6dd555fcebd6ee45'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='479355b6dbbebcdb82d0fd45208370cb53d8f64ca20320512a7e01801a893861'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='992f082a919e3db004c260ac4d59e170947c95f4f8794ca9c68de5119dc5b269'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5fc10da24c439adcc6bb9d36e4f856574ee70a9cc6b554fc2f01787e9ea712ec'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8b987fdba9f75cdf1419332c0f1078adfee89349acf1957a68e8f46637449155'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='42f90f3dc4e0ff00004f8bcf7c8e1cb255c380c83bb816da631ba3763b31b2ce'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='73d0ac0ed82e1c32fe3aa6fc6aebbf784c1119c9fd2b527875666d53be5abdae'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='6010104c0dbc428469dd748196648fde43629d55adf6500190f1a71133d105bd'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='c77c1654cc945fa06e593409286aee5384d765a4ff08e36e51faa67e26d4b9bc'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/tumbleweed/Dockerfile.openj9.nightly.full b/11/jre/tumbleweed/Dockerfile.openj9.nightly.full index 88ae47ae6..c183f0b6e 100644 --- a/11/jre/tumbleweed/Dockerfile.openj9.nightly.full +++ b/11/jre/tumbleweed/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='3ebf68f17541ee7ff6f59661f2a8074360af8957ccbccbdb49915c89a9ea0271'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='2a4f6491eaf6a92a7c11c5b41dbaeb83958e6fd792cbfd2e40df40ea6927a940'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='034ea563f740da179c9b978e9c197ee10b32425a35ffdb62f2bb452ab75685b3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1b126521aca7899e58a4a1d6d28f4ccf70bf02377476c395f413f0fe0c459efd'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='bf9647fc4b1ea03b3b3ad4a011bf93e58ea0fad662befc227e14ff92c7c12c46'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='53f49cea4e3c7634c8f146567ba3f20911b65752cc9837c3634c9f202d276e49'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='229f7c121863cdfbe6156e385e09fd8421c03dadf112918603e3f0c771f92f9b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='50f8266d36ff0797b845ce00739616151c15f6e9b869c3b083a3c9ea8fba5b69'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/tumbleweed/generate_openj9_scc.sh b/11/jre/tumbleweed/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jre/tumbleweed/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jre/ubi-minimal/Dockerfile.hotspot.nightly.full b/11/jre/ubi-minimal/Dockerfile.hotspot.nightly.full index 32d7fef37..2a8cccdab 100644 --- a/11/jre/ubi-minimal/Dockerfile.hotspot.nightly.full +++ b/11/jre/ubi-minimal/Dockerfile.hotspot.nightly.full @@ -38,24 +38,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='a683e5e4ed3895467bfa4fb10f485cddc7ecfd5fb17d614c182f2ff1aea99f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jre_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='cc02f2868594a26e801b7ac50a7df757ec4f4969b5fcf57b6dd555fcebd6ee45'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='479355b6dbbebcdb82d0fd45208370cb53d8f64ca20320512a7e01801a893861'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='992f082a919e3db004c260ac4d59e170947c95f4f8794ca9c68de5119dc5b269'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5fc10da24c439adcc6bb9d36e4f856574ee70a9cc6b554fc2f01787e9ea712ec'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8b987fdba9f75cdf1419332c0f1078adfee89349acf1957a68e8f46637449155'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='42f90f3dc4e0ff00004f8bcf7c8e1cb255c380c83bb816da631ba3763b31b2ce'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='73d0ac0ed82e1c32fe3aa6fc6aebbf784c1119c9fd2b527875666d53be5abdae'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='6010104c0dbc428469dd748196648fde43629d55adf6500190f1a71133d105bd'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='c77c1654cc945fa06e593409286aee5384d765a4ff08e36e51faa67e26d4b9bc'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/ubi-minimal/Dockerfile.openj9.nightly.full b/11/jre/ubi-minimal/Dockerfile.openj9.nightly.full index 7d3d6df2a..05b2a42cf 100644 --- a/11/jre/ubi-minimal/Dockerfile.openj9.nightly.full +++ b/11/jre/ubi-minimal/Dockerfile.openj9.nightly.full @@ -38,20 +38,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='3ebf68f17541ee7ff6f59661f2a8074360af8957ccbccbdb49915c89a9ea0271'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='2a4f6491eaf6a92a7c11c5b41dbaeb83958e6fd792cbfd2e40df40ea6927a940'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='034ea563f740da179c9b978e9c197ee10b32425a35ffdb62f2bb452ab75685b3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1b126521aca7899e58a4a1d6d28f4ccf70bf02377476c395f413f0fe0c459efd'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='bf9647fc4b1ea03b3b3ad4a011bf93e58ea0fad662befc227e14ff92c7c12c46'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='53f49cea4e3c7634c8f146567ba3f20911b65752cc9837c3634c9f202d276e49'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='229f7c121863cdfbe6156e385e09fd8421c03dadf112918603e3f0c771f92f9b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='50f8266d36ff0797b845ce00739616151c15f6e9b869c3b083a3c9ea8fba5b69'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/ubi-minimal/generate_openj9_scc.sh b/11/jre/ubi-minimal/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jre/ubi-minimal/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jre/ubi/Dockerfile.hotspot.nightly.full b/11/jre/ubi/Dockerfile.hotspot.nightly.full index 7370d7204..66872ed9e 100644 --- a/11/jre/ubi/Dockerfile.hotspot.nightly.full +++ b/11/jre/ubi/Dockerfile.hotspot.nightly.full @@ -38,24 +38,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='a683e5e4ed3895467bfa4fb10f485cddc7ecfd5fb17d614c182f2ff1aea99f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jre_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='cc02f2868594a26e801b7ac50a7df757ec4f4969b5fcf57b6dd555fcebd6ee45'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='479355b6dbbebcdb82d0fd45208370cb53d8f64ca20320512a7e01801a893861'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='992f082a919e3db004c260ac4d59e170947c95f4f8794ca9c68de5119dc5b269'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5fc10da24c439adcc6bb9d36e4f856574ee70a9cc6b554fc2f01787e9ea712ec'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8b987fdba9f75cdf1419332c0f1078adfee89349acf1957a68e8f46637449155'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='42f90f3dc4e0ff00004f8bcf7c8e1cb255c380c83bb816da631ba3763b31b2ce'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='73d0ac0ed82e1c32fe3aa6fc6aebbf784c1119c9fd2b527875666d53be5abdae'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='6010104c0dbc428469dd748196648fde43629d55adf6500190f1a71133d105bd'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='c77c1654cc945fa06e593409286aee5384d765a4ff08e36e51faa67e26d4b9bc'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/ubi/Dockerfile.openj9.nightly.full b/11/jre/ubi/Dockerfile.openj9.nightly.full index 77b13cd41..1182c53e7 100644 --- a/11/jre/ubi/Dockerfile.openj9.nightly.full +++ b/11/jre/ubi/Dockerfile.openj9.nightly.full @@ -38,20 +38,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='3ebf68f17541ee7ff6f59661f2a8074360af8957ccbccbdb49915c89a9ea0271'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='2a4f6491eaf6a92a7c11c5b41dbaeb83958e6fd792cbfd2e40df40ea6927a940'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='034ea563f740da179c9b978e9c197ee10b32425a35ffdb62f2bb452ab75685b3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1b126521aca7899e58a4a1d6d28f4ccf70bf02377476c395f413f0fe0c459efd'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='bf9647fc4b1ea03b3b3ad4a011bf93e58ea0fad662befc227e14ff92c7c12c46'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='53f49cea4e3c7634c8f146567ba3f20911b65752cc9837c3634c9f202d276e49'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='229f7c121863cdfbe6156e385e09fd8421c03dadf112918603e3f0c771f92f9b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='50f8266d36ff0797b845ce00739616151c15f6e9b869c3b083a3c9ea8fba5b69'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/ubi/generate_openj9_scc.sh b/11/jre/ubi/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jre/ubi/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jre/ubuntu/Dockerfile.hotspot.nightly.full b/11/jre/ubuntu/Dockerfile.hotspot.nightly.full index 3a7c92097..51f0876cc 100644 --- a/11/jre/ubuntu/Dockerfile.hotspot.nightly.full +++ b/11/jre/ubuntu/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='a683e5e4ed3895467bfa4fb10f485cddc7ecfd5fb17d614c182f2ff1aea99f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-10-11-14/OpenJDK11U-jre_aarch64_linux_hotspot_2020-08-10-11-14.tar.gz'; \ + ESUM='cc02f2868594a26e801b7ac50a7df757ec4f4969b5fcf57b6dd555fcebd6ee45'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='479355b6dbbebcdb82d0fd45208370cb53d8f64ca20320512a7e01801a893861'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_arm_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='992f082a919e3db004c260ac4d59e170947c95f4f8794ca9c68de5119dc5b269'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_arm_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5fc10da24c439adcc6bb9d36e4f856574ee70a9cc6b554fc2f01787e9ea712ec'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='8b987fdba9f75cdf1419332c0f1078adfee89349acf1957a68e8f46637449155'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='42f90f3dc4e0ff00004f8bcf7c8e1cb255c380c83bb816da631ba3763b31b2ce'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_s390x_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='73d0ac0ed82e1c32fe3aa6fc6aebbf784c1119c9fd2b527875666d53be5abdae'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='6010104c0dbc428469dd748196648fde43629d55adf6500190f1a71133d105bd'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-08-12-08-12/OpenJDK11U-jre_x64_linux_hotspot_2020-08-12-08-12.tar.gz'; \ + ESUM='c77c1654cc945fa06e593409286aee5384d765a4ff08e36e51faa67e26d4b9bc'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_hotspot_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/ubuntu/Dockerfile.openj9.nightly.full b/11/jre/ubuntu/Dockerfile.openj9.nightly.full index cf34d54bb..87dff257f 100644 --- a/11/jre/ubuntu/Dockerfile.openj9.nightly.full +++ b/11/jre/ubuntu/Dockerfile.openj9.nightly.full @@ -33,20 +33,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='3ebf68f17541ee7ff6f59661f2a8074360af8957ccbccbdb49915c89a9ea0271'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='2a4f6491eaf6a92a7c11c5b41dbaeb83958e6fd792cbfd2e40df40ea6927a940'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_aarch64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='034ea563f740da179c9b978e9c197ee10b32425a35ffdb62f2bb452ab75685b3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='1b126521aca7899e58a4a1d6d28f4ccf70bf02377476c395f413f0fe0c459efd'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_ppc64le_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ s390x) \ - ESUM='bf9647fc4b1ea03b3b3ad4a011bf93e58ea0fad662befc227e14ff92c7c12c46'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_s390x_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='53f49cea4e3c7634c8f146567ba3f20911b65752cc9837c3634c9f202d276e49'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_s390x_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='229f7c121863cdfbe6156e385e09fd8421c03dadf112918603e3f0c771f92f9b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_linux_openj9_2020-09-17-11-38.tar.gz'; \ + ESUM='50f8266d36ff0797b845ce00739616151c15f6e9b869c3b083a3c9ea8fba5b69'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_linux_openj9_2020-09-24-11-57.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/11/jre/ubuntu/generate_openj9_scc.sh b/11/jre/ubuntu/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/11/jre/ubuntu/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/11/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full b/11/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full index 7cec8ae60..10dc48d66 100644 --- a/11/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full +++ b/11/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk11u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (88018e377667784acade56f13ffc65933a6ba87c44378ccbceb2e92b6812fc62) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '88018e377667784acade56f13ffc65933a6ba87c44378ccbceb2e92b6812fc62') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (95b07d8484b32f56bf5664e0e465f989765800e2b7f5e252e755ffe6a430818a) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '95b07d8484b32f56bf5664e0e465f989765800e2b7f5e252e755ffe6a430818a') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim b/11/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim index 7b7481c13..f52793d94 100644 --- a/11/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim +++ b/11/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk11u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (88018e377667784acade56f13ffc65933a6ba87c44378ccbceb2e92b6812fc62) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '88018e377667784acade56f13ffc65933a6ba87c44378ccbceb2e92b6812fc62') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (95b07d8484b32f56bf5664e0e465f989765800e2b7f5e252e755ffe6a430818a) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '95b07d8484b32f56bf5664e0e465f989765800e2b7f5e252e755ffe6a430818a') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full b/11/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full index ebfec0307..d482f4076 100644 --- a/11/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full +++ b/11/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] diff --git a/11/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.full b/11/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.full index c53719436..deeb2f9ab 100644 --- a/11/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.full +++ b/11/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk11u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (73a5e40f312550a3d1b706b2414960d4e5bd8a0f1eb9320aba8617b9648f4156) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '73a5e40f312550a3d1b706b2414960d4e5bd8a0f1eb9320aba8617b9648f4156') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (bf5c8c4218be342c7becb9bfe9f3356d4a16ac2648a47d7ab82664150d7c5ea8) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'bf5c8c4218be342c7becb9bfe9f3356d4a16ac2648a47d7ab82664150d7c5ea8') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim b/11/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim index 65cf5bfa1..5001b6a2e 100644 --- a/11/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim +++ b/11/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk11u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (73a5e40f312550a3d1b706b2414960d4e5bd8a0f1eb9320aba8617b9648f4156) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '73a5e40f312550a3d1b706b2414960d4e5bd8a0f1eb9320aba8617b9648f4156') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (bf5c8c4218be342c7becb9bfe9f3356d4a16ac2648a47d7ab82664150d7c5ea8) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'bf5c8c4218be342c7becb9bfe9f3356d4a16ac2648a47d7ab82664150d7c5ea8') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full b/11/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full index ec6d8d577..eba065444 100644 --- a/11/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full +++ b/11/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk11u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (88018e377667784acade56f13ffc65933a6ba87c44378ccbceb2e92b6812fc62) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '88018e377667784acade56f13ffc65933a6ba87c44378ccbceb2e92b6812fc62') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (95b07d8484b32f56bf5664e0e465f989765800e2b7f5e252e755ffe6a430818a) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '95b07d8484b32f56bf5664e0e465f989765800e2b7f5e252e755ffe6a430818a') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim b/11/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim index 9a0291a00..4dec37d69 100644 --- a/11/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim +++ b/11/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk11u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (88018e377667784acade56f13ffc65933a6ba87c44378ccbceb2e92b6812fc62) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '88018e377667784acade56f13ffc65933a6ba87c44378ccbceb2e92b6812fc62') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (95b07d8484b32f56bf5664e0e465f989765800e2b7f5e252e755ffe6a430818a) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '95b07d8484b32f56bf5664e0e465f989765800e2b7f5e252e755ffe6a430818a') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.full b/11/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.full index 5e942f6dc..aabb71d6b 100644 --- a/11/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.full +++ b/11/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk11u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (73a5e40f312550a3d1b706b2414960d4e5bd8a0f1eb9320aba8617b9648f4156) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '73a5e40f312550a3d1b706b2414960d4e5bd8a0f1eb9320aba8617b9648f4156') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (bf5c8c4218be342c7becb9bfe9f3356d4a16ac2648a47d7ab82664150d7c5ea8) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'bf5c8c4218be342c7becb9bfe9f3356d4a16ac2648a47d7ab82664150d7c5ea8') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim b/11/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim index c2e6d196c..ed4f79c13 100644 --- a/11/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim +++ b/11/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk11u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (73a5e40f312550a3d1b706b2414960d4e5bd8a0f1eb9320aba8617b9648f4156) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '73a5e40f312550a3d1b706b2414960d4e5bd8a0f1eb9320aba8617b9648f4156') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (bf5c8c4218be342c7becb9bfe9f3356d4a16ac2648a47d7ab82664150d7c5ea8) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'bf5c8c4218be342c7becb9bfe9f3356d4a16ac2648a47d7ab82664150d7c5ea8') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full b/11/jre/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full index 97291df09..432c27320 100644 --- a/11/jre/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full +++ b/11/jre/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (fd62be66cb1bfdadb6eb3c82e1bb6a4d69d1ca0d1336d9a7c01c54badf4091af) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'fd62be66cb1bfdadb6eb3c82e1bb6a4d69d1ca0d1336d9a7c01c54badf4091af') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (9de5b0dbcd5311d21e7d96c687b5a09d5cc8f9a583f622a23c2275c88f391e6b) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9de5b0dbcd5311d21e7d96c687b5a09d5cc8f9a583f622a23c2275c88f391e6b') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full b/11/jre/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full index ef740196c..58a4be06f 100644 --- a/11/jre/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full +++ b/11/jre/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (9b18ac2957a3f85ce7eacb3a560e48b2b0bab0bbe64f14629f038997303bf9f9) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9b18ac2957a3f85ce7eacb3a560e48b2b0bab0bbe64f14629f038997303bf9f9') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (2786dbd9336b4bbedb9e1451c666dce84ea707eb51e464c03a19cd4ad148604a) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '2786dbd9336b4bbedb9e1451c666dce84ea707eb51e464c03a19cd4ad148604a') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full b/11/jre/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full index f1e5818e1..022ea80bb 100644 --- a/11/jre/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full +++ b/11/jre/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (fd62be66cb1bfdadb6eb3c82e1bb6a4d69d1ca0d1336d9a7c01c54badf4091af) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'fd62be66cb1bfdadb6eb3c82e1bb6a4d69d1ca0d1336d9a7c01c54badf4091af') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (9de5b0dbcd5311d21e7d96c687b5a09d5cc8f9a583f622a23c2275c88f391e6b) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9de5b0dbcd5311d21e7d96c687b5a09d5cc8f9a583f622a23c2275c88f391e6b') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full b/11/jre/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full index bf242af62..b52c86a8a 100644 --- a/11/jre/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full +++ b/11/jre/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (9b18ac2957a3f85ce7eacb3a560e48b2b0bab0bbe64f14629f038997303bf9f9) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9b18ac2957a3f85ce7eacb3a560e48b2b0bab0bbe64f14629f038997303bf9f9') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (2786dbd9336b4bbedb9e1451c666dce84ea707eb51e464c03a19cd4ad148604a) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '2786dbd9336b4bbedb9e1451c666dce84ea707eb51e464c03a19cd4ad148604a') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full b/11/jre/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full index 241e5beea..1f5334a1d 100644 --- a/11/jre/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full +++ b/11/jre/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (fd62be66cb1bfdadb6eb3c82e1bb6a4d69d1ca0d1336d9a7c01c54badf4091af) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'fd62be66cb1bfdadb6eb3c82e1bb6a4d69d1ca0d1336d9a7c01c54badf4091af') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (9de5b0dbcd5311d21e7d96c687b5a09d5cc8f9a583f622a23c2275c88f391e6b) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9de5b0dbcd5311d21e7d96c687b5a09d5cc8f9a583f622a23c2275c88f391e6b') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full b/11/jre/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full index 84ef726a8..7424a3821 100644 --- a/11/jre/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full +++ b/11/jre/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (9b18ac2957a3f85ce7eacb3a560e48b2b0bab0bbe64f14629f038997303bf9f9) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9b18ac2957a3f85ce7eacb3a560e48b2b0bab0bbe64f14629f038997303bf9f9') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (2786dbd9336b4bbedb9e1451c666dce84ea707eb51e464c03a19cd4ad148604a) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '2786dbd9336b4bbedb9e1451c666dce84ea707eb51e464c03a19cd4ad148604a') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full b/11/jre/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full index 0df4a0132..661e253df 100644 --- a/11/jre/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full +++ b/11/jre/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_hotspot_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (fd62be66cb1bfdadb6eb3c82e1bb6a4d69d1ca0d1336d9a7c01c54badf4091af) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'fd62be66cb1bfdadb6eb3c82e1bb6a4d69d1ca0d1336d9a7c01c54badf4091af') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_hotspot_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (9de5b0dbcd5311d21e7d96c687b5a09d5cc8f9a583f622a23c2275c88f391e6b) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9de5b0dbcd5311d21e7d96c687b5a09d5cc8f9a583f622a23c2275c88f391e6b') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/11/jre/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full b/11/jre/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full index 77eb18e4b..aa2012a99 100644 --- a/11/jre/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full +++ b/11/jre/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk11u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-17-11-38/OpenJDK11U-jre_x64_windows_openj9_2020-09-17-11-38.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (9b18ac2957a3f85ce7eacb3a560e48b2b0bab0bbe64f14629f038997303bf9f9) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9b18ac2957a3f85ce7eacb3a560e48b2b0bab0bbe64f14629f038997303bf9f9') { \ + wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk11u-2020-09-24-11-57/OpenJDK11U-jre_x64_windows_openj9_2020-09-24-11-57.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (2786dbd9336b4bbedb9e1451c666dce84ea707eb51e464c03a19cd4ad148604a) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '2786dbd9336b4bbedb9e1451c666dce84ea707eb51e464c03a19cd4ad148604a') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/14/jdk/alpine/generate_openj9_scc.sh b/14/jdk/alpine/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jdk/alpine/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jdk/centos/generate_openj9_scc.sh b/14/jdk/centos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jdk/centos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jdk/clefos/generate_openj9_scc.sh b/14/jdk/clefos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jdk/clefos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jdk/debian/generate_openj9_scc.sh b/14/jdk/debian/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jdk/debian/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jdk/debianslim/generate_openj9_scc.sh b/14/jdk/debianslim/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jdk/debianslim/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jdk/leap/generate_openj9_scc.sh b/14/jdk/leap/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jdk/leap/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jdk/tumbleweed/generate_openj9_scc.sh b/14/jdk/tumbleweed/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jdk/tumbleweed/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jdk/ubi-minimal/generate_openj9_scc.sh b/14/jdk/ubi-minimal/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jdk/ubi-minimal/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jdk/ubi/generate_openj9_scc.sh b/14/jdk/ubi/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jdk/ubi/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jdk/ubuntu/generate_openj9_scc.sh b/14/jdk/ubuntu/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jdk/ubuntu/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full b/14/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full index d72d86271..0b79e2d42 100644 --- a/14/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full +++ b/14/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] diff --git a/14/jre/alpine/generate_openj9_scc.sh b/14/jre/alpine/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jre/alpine/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jre/centos/generate_openj9_scc.sh b/14/jre/centos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jre/centos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jre/clefos/generate_openj9_scc.sh b/14/jre/clefos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jre/clefos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jre/debian/generate_openj9_scc.sh b/14/jre/debian/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jre/debian/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jre/debianslim/generate_openj9_scc.sh b/14/jre/debianslim/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jre/debianslim/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jre/leap/generate_openj9_scc.sh b/14/jre/leap/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jre/leap/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jre/tumbleweed/generate_openj9_scc.sh b/14/jre/tumbleweed/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jre/tumbleweed/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jre/ubi-minimal/generate_openj9_scc.sh b/14/jre/ubi-minimal/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jre/ubi-minimal/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jre/ubi/generate_openj9_scc.sh b/14/jre/ubi/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jre/ubi/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jre/ubuntu/generate_openj9_scc.sh b/14/jre/ubuntu/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/14/jre/ubuntu/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/14/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full b/14/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full index 9156acd64..45f3606d8 100644 --- a/14/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full +++ b/14/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] diff --git a/15/jdk/alpine/Dockerfile.hotspot.nightly.full b/15/jdk/alpine/Dockerfile.hotspot.nightly.full index 73638d58c..043040ad8 100644 --- a/15/jdk/alpine/Dockerfile.hotspot.nightly.full +++ b/15/jdk/alpine/Dockerfile.hotspot.nightly.full @@ -61,24 +61,24 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/alpine/Dockerfile.hotspot.nightly.slim b/15/jdk/alpine/Dockerfile.hotspot.nightly.slim index 5893df0de..87e958cef 100644 --- a/15/jdk/alpine/Dockerfile.hotspot.nightly.slim +++ b/15/jdk/alpine/Dockerfile.hotspot.nightly.slim @@ -63,24 +63,24 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/alpine/Dockerfile.openj9.nightly.full b/15/jdk/alpine/Dockerfile.openj9.nightly.full index 9e0a79337..830043e2b 100644 --- a/15/jdk/alpine/Dockerfile.openj9.nightly.full +++ b/15/jdk/alpine/Dockerfile.openj9.nightly.full @@ -54,27 +54,27 @@ RUN apk add --no-cache tzdata --virtual .build-deps curl binutils zstd \ && apk del --purge .build-deps glibc-i18n \ && rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/* -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ apk add --no-cache --virtual .fetch-deps curl; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/alpine/Dockerfile.openj9.nightly.slim b/15/jdk/alpine/Dockerfile.openj9.nightly.slim index ef46ad219..75b274bfd 100644 --- a/15/jdk/alpine/Dockerfile.openj9.nightly.slim +++ b/15/jdk/alpine/Dockerfile.openj9.nightly.slim @@ -54,7 +54,7 @@ RUN apk add --no-cache tzdata --virtual .build-deps curl binutils zstd \ && apk del --purge .build-deps glibc-i18n \ && rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/* -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u COPY slim-java* /usr/local/bin/ @@ -63,20 +63,20 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/alpine/generate_openj9_scc.sh b/15/jdk/alpine/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jdk/alpine/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jdk/centos/Dockerfile.hotspot.nightly.full b/15/jdk/centos/Dockerfile.hotspot.nightly.full index c5cb8e26c..5a3bc14bd 100644 --- a/15/jdk/centos/Dockerfile.hotspot.nightly.full +++ b/15/jdk/centos/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/centos/Dockerfile.hotspot.nightly.slim b/15/jdk/centos/Dockerfile.hotspot.nightly.slim index c1f4df8ea..f230645d5 100644 --- a/15/jdk/centos/Dockerfile.hotspot.nightly.slim +++ b/15/jdk/centos/Dockerfile.hotspot.nightly.slim @@ -32,24 +32,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/centos/Dockerfile.openj9.nightly.full b/15/jdk/centos/Dockerfile.openj9.nightly.full index 38a41de50..5d439bdf6 100644 --- a/15/jdk/centos/Dockerfile.openj9.nightly.full +++ b/15/jdk/centos/Dockerfile.openj9.nightly.full @@ -24,26 +24,26 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN yum install -y tzdata openssl curl ca-certificates fontconfig gzip tar \ && yum update -y; yum clean all -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/centos/Dockerfile.openj9.nightly.slim b/15/jdk/centos/Dockerfile.openj9.nightly.slim index 6a79308ed..fc1fcd66c 100644 --- a/15/jdk/centos/Dockerfile.openj9.nightly.slim +++ b/15/jdk/centos/Dockerfile.openj9.nightly.slim @@ -24,7 +24,7 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN yum install -y tzdata openssl curl ca-certificates fontconfig gzip tar \ && yum update -y; yum clean all -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u COPY slim-java* /usr/local/bin/ @@ -32,20 +32,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/centos/generate_openj9_scc.sh b/15/jdk/centos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jdk/centos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jdk/clefos/Dockerfile.hotspot.nightly.full b/15/jdk/clefos/Dockerfile.hotspot.nightly.full index b69a727ee..f152c906e 100644 --- a/15/jdk/clefos/Dockerfile.hotspot.nightly.full +++ b/15/jdk/clefos/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/clefos/Dockerfile.hotspot.nightly.slim b/15/jdk/clefos/Dockerfile.hotspot.nightly.slim index 43b30bae2..4d93db274 100644 --- a/15/jdk/clefos/Dockerfile.hotspot.nightly.slim +++ b/15/jdk/clefos/Dockerfile.hotspot.nightly.slim @@ -32,24 +32,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/clefos/Dockerfile.openj9.nightly.full b/15/jdk/clefos/Dockerfile.openj9.nightly.full index 15a4d7112..16203816e 100644 --- a/15/jdk/clefos/Dockerfile.openj9.nightly.full +++ b/15/jdk/clefos/Dockerfile.openj9.nightly.full @@ -24,26 +24,26 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN yum install -y tzdata openssl curl ca-certificates fontconfig gzip tar \ && yum update -y; yum clean all -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/clefos/Dockerfile.openj9.nightly.slim b/15/jdk/clefos/Dockerfile.openj9.nightly.slim index 4b690aef3..1655cef37 100644 --- a/15/jdk/clefos/Dockerfile.openj9.nightly.slim +++ b/15/jdk/clefos/Dockerfile.openj9.nightly.slim @@ -24,7 +24,7 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN yum install -y tzdata openssl curl ca-certificates fontconfig gzip tar \ && yum update -y; yum clean all -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u COPY slim-java* /usr/local/bin/ @@ -32,20 +32,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/clefos/generate_openj9_scc.sh b/15/jdk/clefos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jdk/clefos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jdk/debian/Dockerfile.hotspot.nightly.full b/15/jdk/debian/Dockerfile.hotspot.nightly.full index e957f69a1..54af4696b 100644 --- a/15/jdk/debian/Dockerfile.hotspot.nightly.full +++ b/15/jdk/debian/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/debian/Dockerfile.hotspot.nightly.slim b/15/jdk/debian/Dockerfile.hotspot.nightly.slim index cc2805af2..80260b724 100644 --- a/15/jdk/debian/Dockerfile.hotspot.nightly.slim +++ b/15/jdk/debian/Dockerfile.hotspot.nightly.slim @@ -35,24 +35,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/debian/Dockerfile.openj9.nightly.full b/15/jdk/debian/Dockerfile.openj9.nightly.full index d992d8d42..a8b72976d 100644 --- a/15/jdk/debian/Dockerfile.openj9.nightly.full +++ b/15/jdk/debian/Dockerfile.openj9.nightly.full @@ -27,26 +27,26 @@ RUN apt-get update \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/debian/Dockerfile.openj9.nightly.slim b/15/jdk/debian/Dockerfile.openj9.nightly.slim index 0c6e38481..60005ea4e 100644 --- a/15/jdk/debian/Dockerfile.openj9.nightly.slim +++ b/15/jdk/debian/Dockerfile.openj9.nightly.slim @@ -27,7 +27,7 @@ RUN apt-get update \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u COPY slim-java* /usr/local/bin/ @@ -35,20 +35,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/debian/generate_openj9_scc.sh b/15/jdk/debian/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jdk/debian/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jdk/debianslim/Dockerfile.hotspot.nightly.full b/15/jdk/debianslim/Dockerfile.hotspot.nightly.full index 764ca6987..24765e819 100644 --- a/15/jdk/debianslim/Dockerfile.hotspot.nightly.full +++ b/15/jdk/debianslim/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/debianslim/Dockerfile.hotspot.nightly.slim b/15/jdk/debianslim/Dockerfile.hotspot.nightly.slim index 510f1bd0a..98ac64426 100644 --- a/15/jdk/debianslim/Dockerfile.hotspot.nightly.slim +++ b/15/jdk/debianslim/Dockerfile.hotspot.nightly.slim @@ -35,24 +35,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/debianslim/Dockerfile.openj9.nightly.full b/15/jdk/debianslim/Dockerfile.openj9.nightly.full index 7e88ce1e0..0b9fcc8ef 100644 --- a/15/jdk/debianslim/Dockerfile.openj9.nightly.full +++ b/15/jdk/debianslim/Dockerfile.openj9.nightly.full @@ -27,26 +27,26 @@ RUN apt-get update \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/debianslim/Dockerfile.openj9.nightly.slim b/15/jdk/debianslim/Dockerfile.openj9.nightly.slim index 60d4042b8..5c53b48b9 100644 --- a/15/jdk/debianslim/Dockerfile.openj9.nightly.slim +++ b/15/jdk/debianslim/Dockerfile.openj9.nightly.slim @@ -27,7 +27,7 @@ RUN apt-get update \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u COPY slim-java* /usr/local/bin/ @@ -35,20 +35,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/debianslim/generate_openj9_scc.sh b/15/jdk/debianslim/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jdk/debianslim/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jdk/leap/Dockerfile.hotspot.nightly.full b/15/jdk/leap/Dockerfile.hotspot.nightly.full index ec156d855..aa29e14b9 100644 --- a/15/jdk/leap/Dockerfile.hotspot.nightly.full +++ b/15/jdk/leap/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/leap/Dockerfile.openj9.nightly.full b/15/jdk/leap/Dockerfile.openj9.nightly.full index 60d60af39..307f682ba 100644 --- a/15/jdk/leap/Dockerfile.openj9.nightly.full +++ b/15/jdk/leap/Dockerfile.openj9.nightly.full @@ -24,26 +24,26 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN zypper install --no-recommends -y timezone openssl curl ca-certificates fontconfig gzip tar \ && zypper update -y; zypper clean --all -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/leap/generate_openj9_scc.sh b/15/jdk/leap/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jdk/leap/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jdk/tumbleweed/Dockerfile.hotspot.nightly.full b/15/jdk/tumbleweed/Dockerfile.hotspot.nightly.full index 4038d657b..01b1c7a28 100644 --- a/15/jdk/tumbleweed/Dockerfile.hotspot.nightly.full +++ b/15/jdk/tumbleweed/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/tumbleweed/Dockerfile.openj9.nightly.full b/15/jdk/tumbleweed/Dockerfile.openj9.nightly.full index e827e3ba7..0900b1f0e 100644 --- a/15/jdk/tumbleweed/Dockerfile.openj9.nightly.full +++ b/15/jdk/tumbleweed/Dockerfile.openj9.nightly.full @@ -24,26 +24,26 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN zypper install --no-recommends -y timezone openssl curl ca-certificates fontconfig gzip tar \ && zypper update -y; zypper clean --all -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/tumbleweed/generate_openj9_scc.sh b/15/jdk/tumbleweed/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jdk/tumbleweed/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jdk/ubi-minimal/Dockerfile.hotspot.nightly.full b/15/jdk/ubi-minimal/Dockerfile.hotspot.nightly.full index ea60c0d49..9c4649e07 100644 --- a/15/jdk/ubi-minimal/Dockerfile.hotspot.nightly.full +++ b/15/jdk/ubi-minimal/Dockerfile.hotspot.nightly.full @@ -38,24 +38,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/ubi-minimal/Dockerfile.openj9.nightly.full b/15/jdk/ubi-minimal/Dockerfile.openj9.nightly.full index 019194b49..c750db239 100644 --- a/15/jdk/ubi-minimal/Dockerfile.openj9.nightly.full +++ b/15/jdk/ubi-minimal/Dockerfile.openj9.nightly.full @@ -26,32 +26,32 @@ RUN microdnf install -y tzdata openssl curl ca-certificates fontconfig glibc-lan LABEL name="AdoptOpenJDK Java" \ vendor="AdoptOpenJDK" \ - version="jdk-15+36_openj9-0.23.0-m1" \ + version="jdk15u" \ release="15" \ run="docker run --rm -ti /bin/bash" \ summary="AdoptOpenJDK Docker Image for OpenJDK with openj9 and ubi-minimal" \ description="For more information on this image please see https://github.com/AdoptOpenJDK/openjdk-docker/blob/master/README.md" -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/ubi-minimal/generate_openj9_scc.sh b/15/jdk/ubi-minimal/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jdk/ubi-minimal/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jdk/ubi/Dockerfile.hotspot.nightly.full b/15/jdk/ubi/Dockerfile.hotspot.nightly.full index 8b260768e..5416896da 100644 --- a/15/jdk/ubi/Dockerfile.hotspot.nightly.full +++ b/15/jdk/ubi/Dockerfile.hotspot.nightly.full @@ -38,24 +38,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/ubi/Dockerfile.hotspot.nightly.slim b/15/jdk/ubi/Dockerfile.hotspot.nightly.slim index d616c29e1..f3b56d20a 100644 --- a/15/jdk/ubi/Dockerfile.hotspot.nightly.slim +++ b/15/jdk/ubi/Dockerfile.hotspot.nightly.slim @@ -40,24 +40,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/ubi/Dockerfile.openj9.nightly.full b/15/jdk/ubi/Dockerfile.openj9.nightly.full index 3e3353e87..6be42fde4 100644 --- a/15/jdk/ubi/Dockerfile.openj9.nightly.full +++ b/15/jdk/ubi/Dockerfile.openj9.nightly.full @@ -26,32 +26,32 @@ RUN dnf install -y tzdata openssl curl ca-certificates fontconfig glibc-langpack LABEL name="AdoptOpenJDK Java" \ vendor="AdoptOpenJDK" \ - version="jdk-15+36_openj9-0.23.0-m1" \ + version="jdk15u" \ release="15" \ run="docker run --rm -ti /bin/bash" \ summary="AdoptOpenJDK Docker Image for OpenJDK with openj9 and ubi" \ description="For more information on this image please see https://github.com/AdoptOpenJDK/openjdk-docker/blob/master/README.md" -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/ubi/Dockerfile.openj9.nightly.slim b/15/jdk/ubi/Dockerfile.openj9.nightly.slim index fb7baa24c..e981044dc 100644 --- a/15/jdk/ubi/Dockerfile.openj9.nightly.slim +++ b/15/jdk/ubi/Dockerfile.openj9.nightly.slim @@ -26,13 +26,13 @@ RUN dnf install -y tzdata openssl curl ca-certificates fontconfig glibc-langpack LABEL name="AdoptOpenJDK Java" \ vendor="AdoptOpenJDK" \ - version="jdk-15+36_openj9-0.23.0-m1" \ + version="jdk15u" \ release="15" \ run="docker run --rm -ti /bin/bash" \ summary="AdoptOpenJDK Docker Image for OpenJDK with openj9 and ubi" \ description="For more information on this image please see https://github.com/AdoptOpenJDK/openjdk-docker/blob/master/README.md" -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u COPY slim-java* /usr/local/bin/ @@ -40,20 +40,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/ubi/generate_openj9_scc.sh b/15/jdk/ubi/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jdk/ubi/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jdk/ubuntu/Dockerfile.hotspot.nightly.full b/15/jdk/ubuntu/Dockerfile.hotspot.nightly.full index 86bd82ae5..dafc250da 100644 --- a/15/jdk/ubuntu/Dockerfile.hotspot.nightly.full +++ b/15/jdk/ubuntu/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/ubuntu/Dockerfile.hotspot.nightly.slim b/15/jdk/ubuntu/Dockerfile.hotspot.nightly.slim index a6baa9a09..0d34d47ed 100644 --- a/15/jdk/ubuntu/Dockerfile.hotspot.nightly.slim +++ b/15/jdk/ubuntu/Dockerfile.hotspot.nightly.slim @@ -35,24 +35,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='23189c167cf8e88a0ac9b2c8d3565cb28aa4ee80948398021fe5fdc6fa5352a5'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='f32634c887dc7d19bbeb5b946bf6545b727d36acb6790061dfda378c055cf0cb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='d2b763c0d72313bc7ba80efedcc909ab7788958ae835101f13567486483ebe36'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='0d00b3172933e2b4f0f8feab70e4bd72f0227b8d76335d6fdd611867d45fdaa9'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='a5731a03d4f94232c44273ec9b63827e4cf72d86adb01a6e8e54619f4ac69054'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8257bf660582298f108de9656b9e10b7e113814be5a7d80eb8e16cd7941adf3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='27d02bb03e7ce78fc4ab725565c2e8648898a289e0c4bf8311a9342e393d513a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='98ccb2cabaf092a105a1110fa6dc6d02055ab24206a5f07e7ba24b4d3e9eef94'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='8da896866520929a8e0e1f2a137b26a0b33f69cda0b100d0200e0158ee9075a2'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='3aa4138fac53b07a22048737700f2aded963d91aa41b0f7d7780eb6fdf2b0ba6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/ubuntu/Dockerfile.openj9.nightly.full b/15/jdk/ubuntu/Dockerfile.openj9.nightly.full index 3340b9940..b5b919bf1 100644 --- a/15/jdk/ubuntu/Dockerfile.openj9.nightly.full +++ b/15/jdk/ubuntu/Dockerfile.openj9.nightly.full @@ -27,26 +27,26 @@ RUN apt-get update \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/ubuntu/Dockerfile.openj9.nightly.slim b/15/jdk/ubuntu/Dockerfile.openj9.nightly.slim index 38c4965b1..792cfdbcd 100644 --- a/15/jdk/ubuntu/Dockerfile.openj9.nightly.slim +++ b/15/jdk/ubuntu/Dockerfile.openj9.nightly.slim @@ -27,7 +27,7 @@ RUN apt-get update \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u COPY slim-java* /usr/local/bin/ @@ -35,20 +35,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ff0ee2ebc1ced5809acad873b592c0ff4e326a017f04bcd6371e7dd41c602f70'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='32b09a497575a3bfa40b7e88a79a8083dbf28aaf2992b2cebdd4b3e1a59c5091'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='b5b731e21f52c2e791a7ab7bcdc57b46be7964942f47eca746fd6167b0f0e1f3'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='5d52c533661c0a12014a3d4daa1cbef3cf0bc9537bdbd7bdb366de06246a1870'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='923c79f425d8836149cd628504d82c793027555db14f44a2bd8e5c69aeacbbd8'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3aaa10a74440b6382b4b3ab6235882b91ff096b286add377bb841e89e1b49e0a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='57b867aaff318267e152819db149b4d5b00e1879bff579b1c75fa59f77b3bcbe'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='705bfb4201be7941e6b83a028c0a2b0e58314863a42b8dbb59e104d9d4243136'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jdk/ubuntu/generate_openj9_scc.sh b/15/jdk/ubuntu/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jdk/ubuntu/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full b/15/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full index 154bf56df..bf07e3a1b 100644 --- a/15/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full +++ b/15/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk15u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (268e9d6d00fbb3f1783d466e2480d2b0802c7a9e63fcd9538cb7e1c04a6f6c89) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '268e9d6d00fbb3f1783d466e2480d2b0802c7a9e63fcd9538cb7e1c04a6f6c89') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (79e4e9a61f223cf4322380ae2e13dcdee3c31bf24912829a4f711b33b0b2889f) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '79e4e9a61f223cf4322380ae2e13dcdee3c31bf24912829a4f711b33b0b2889f') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim b/15/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim index cf0ce0350..519d21e1b 100644 --- a/15/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim +++ b/15/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk15u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (268e9d6d00fbb3f1783d466e2480d2b0802c7a9e63fcd9538cb7e1c04a6f6c89) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '268e9d6d00fbb3f1783d466e2480d2b0802c7a9e63fcd9538cb7e1c04a6f6c89') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (79e4e9a61f223cf4322380ae2e13dcdee3c31bf24912829a4f711b33b0b2889f) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '79e4e9a61f223cf4322380ae2e13dcdee3c31bf24912829a4f711b33b0b2889f') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full b/15/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full index c7dd1be8b..1c13cfa29 100644 --- a/15/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full +++ b/15/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] diff --git a/15/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.full b/15/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.full index 94635dbd1..dda38b067 100644 --- a/15/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.full +++ b/15/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.full @@ -17,19 +17,20 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (262b65e5d402518ca4114d4f125d92d9415753a6b56b420f808ea822237b709a) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '262b65e5d402518ca4114d4f125d92d9415753a6b56b420f808ea822237b709a') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (2260cc0a0d5366c4fdd64f5b73fc54926f02a07154bbf95b591378a2a00921f3) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '2260cc0a0d5366c4fdd64f5b73fc54926f02a07154bbf95b591378a2a00921f3') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim b/15/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim index 4ad995fbc..273cdd999 100644 --- a/15/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim +++ b/15/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim @@ -17,21 +17,22 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (262b65e5d402518ca4114d4f125d92d9415753a6b56b420f808ea822237b709a) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '262b65e5d402518ca4114d4f125d92d9415753a6b56b420f808ea822237b709a') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (2260cc0a0d5366c4fdd64f5b73fc54926f02a07154bbf95b591378a2a00921f3) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '2260cc0a0d5366c4fdd64f5b73fc54926f02a07154bbf95b591378a2a00921f3') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full b/15/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full index 43f65ce47..d5d21f488 100644 --- a/15/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full +++ b/15/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk15u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (268e9d6d00fbb3f1783d466e2480d2b0802c7a9e63fcd9538cb7e1c04a6f6c89) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '268e9d6d00fbb3f1783d466e2480d2b0802c7a9e63fcd9538cb7e1c04a6f6c89') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (79e4e9a61f223cf4322380ae2e13dcdee3c31bf24912829a4f711b33b0b2889f) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '79e4e9a61f223cf4322380ae2e13dcdee3c31bf24912829a4f711b33b0b2889f') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim b/15/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim index dc97d0d9b..0613a3e4f 100644 --- a/15/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim +++ b/15/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk15u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (268e9d6d00fbb3f1783d466e2480d2b0802c7a9e63fcd9538cb7e1c04a6f6c89) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '268e9d6d00fbb3f1783d466e2480d2b0802c7a9e63fcd9538cb7e1c04a6f6c89') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (79e4e9a61f223cf4322380ae2e13dcdee3c31bf24912829a4f711b33b0b2889f) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '79e4e9a61f223cf4322380ae2e13dcdee3c31bf24912829a4f711b33b0b2889f') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.full b/15/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.full index c93a301ce..b98553a63 100644 --- a/15/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.full +++ b/15/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.full @@ -17,19 +17,20 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (262b65e5d402518ca4114d4f125d92d9415753a6b56b420f808ea822237b709a) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '262b65e5d402518ca4114d4f125d92d9415753a6b56b420f808ea822237b709a') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (2260cc0a0d5366c4fdd64f5b73fc54926f02a07154bbf95b591378a2a00921f3) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '2260cc0a0d5366c4fdd64f5b73fc54926f02a07154bbf95b591378a2a00921f3') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim b/15/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim index 33c3e9f70..eb17701c2 100644 --- a/15/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim +++ b/15/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim @@ -17,21 +17,22 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (262b65e5d402518ca4114d4f125d92d9415753a6b56b420f808ea822237b709a) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '262b65e5d402518ca4114d4f125d92d9415753a6b56b420f808ea822237b709a') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (2260cc0a0d5366c4fdd64f5b73fc54926f02a07154bbf95b591378a2a00921f3) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '2260cc0a0d5366c4fdd64f5b73fc54926f02a07154bbf95b591378a2a00921f3') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full b/15/jdk/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full index 1bbe513dd..4307f17b6 100644 --- a/15/jdk/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full +++ b/15/jdk/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (6a0d2dbc67bd939cdcfe55912efdbc598e3d9dad93a449287c25150d7838b86c) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '6a0d2dbc67bd939cdcfe55912efdbc598e3d9dad93a449287c25150d7838b86c') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (fcf8bc971e125019c70c187e7f4c9611c41744dc5edb021cc1164f0e1cec4e8b) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'fcf8bc971e125019c70c187e7f4c9611c41744dc5edb021cc1164f0e1cec4e8b') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full b/15/jdk/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full index cb06ebf93..9632ad761 100644 --- a/15/jdk/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full +++ b/15/jdk/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full @@ -22,13 +22,13 @@ FROM mcr.microsoft.com/windows/servercore:1809 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (75c52e2ffe6e0fc7c2ec30779b5caff58ca34c71c95509d9ef46e86377dfae90) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '75c52e2ffe6e0fc7c2ec30779b5caff58ca34c71c95509d9ef46e86377dfae90') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (8ef696913292b301d3c6a0b2b3388ad59cfbf13e1e7150ae7ed54824715112e9) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '8ef696913292b301d3c6a0b2b3388ad59cfbf13e1e7150ae7ed54824715112e9') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full b/15/jdk/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full index 4c4c4896c..1f4351d5f 100644 --- a/15/jdk/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full +++ b/15/jdk/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (6a0d2dbc67bd939cdcfe55912efdbc598e3d9dad93a449287c25150d7838b86c) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '6a0d2dbc67bd939cdcfe55912efdbc598e3d9dad93a449287c25150d7838b86c') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (fcf8bc971e125019c70c187e7f4c9611c41744dc5edb021cc1164f0e1cec4e8b) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'fcf8bc971e125019c70c187e7f4c9611c41744dc5edb021cc1164f0e1cec4e8b') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full b/15/jdk/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full index f60786e26..2b775b4cb 100644 --- a/15/jdk/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full +++ b/15/jdk/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full @@ -22,13 +22,13 @@ FROM mcr.microsoft.com/windows/servercore:1909 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (75c52e2ffe6e0fc7c2ec30779b5caff58ca34c71c95509d9ef46e86377dfae90) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '75c52e2ffe6e0fc7c2ec30779b5caff58ca34c71c95509d9ef46e86377dfae90') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (8ef696913292b301d3c6a0b2b3388ad59cfbf13e1e7150ae7ed54824715112e9) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '8ef696913292b301d3c6a0b2b3388ad59cfbf13e1e7150ae7ed54824715112e9') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full b/15/jdk/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full index 3cff476a8..ad4d2dbde 100644 --- a/15/jdk/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full +++ b/15/jdk/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (6a0d2dbc67bd939cdcfe55912efdbc598e3d9dad93a449287c25150d7838b86c) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '6a0d2dbc67bd939cdcfe55912efdbc598e3d9dad93a449287c25150d7838b86c') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (fcf8bc971e125019c70c187e7f4c9611c41744dc5edb021cc1164f0e1cec4e8b) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'fcf8bc971e125019c70c187e7f4c9611c41744dc5edb021cc1164f0e1cec4e8b') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full b/15/jdk/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full index f4f5e55dd..8b6a55d7c 100644 --- a/15/jdk/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full +++ b/15/jdk/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full @@ -22,13 +22,13 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2016 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (75c52e2ffe6e0fc7c2ec30779b5caff58ca34c71c95509d9ef46e86377dfae90) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '75c52e2ffe6e0fc7c2ec30779b5caff58ca34c71c95509d9ef46e86377dfae90') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (8ef696913292b301d3c6a0b2b3388ad59cfbf13e1e7150ae7ed54824715112e9) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '8ef696913292b301d3c6a0b2b3388ad59cfbf13e1e7150ae7ed54824715112e9') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full b/15/jdk/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full index 31164f7f0..9c7d15d9c 100644 --- a/15/jdk/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full +++ b/15/jdk/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-23-15-14.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (6a0d2dbc67bd939cdcfe55912efdbc598e3d9dad93a449287c25150d7838b86c) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '6a0d2dbc67bd939cdcfe55912efdbc598e3d9dad93a449287c25150d7838b86c') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_hotspot_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (fcf8bc971e125019c70c187e7f4c9611c41744dc5edb021cc1164f0e1cec4e8b) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'fcf8bc971e125019c70c187e7f4c9611c41744dc5edb021cc1164f0e1cec4e8b') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jdk/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full b/15/jdk/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full index 9b34e4300..8e974d804 100644 --- a/15/jdk/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full +++ b/15/jdk/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full @@ -22,13 +22,13 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2019 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jdk_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (75c52e2ffe6e0fc7c2ec30779b5caff58ca34c71c95509d9ef46e86377dfae90) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '75c52e2ffe6e0fc7c2ec30779b5caff58ca34c71c95509d9ef46e86377dfae90') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jdk_x64_windows_openj9_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (8ef696913292b301d3c6a0b2b3388ad59cfbf13e1e7150ae7ed54824715112e9) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '8ef696913292b301d3c6a0b2b3388ad59cfbf13e1e7150ae7ed54824715112e9') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/alpine/Dockerfile.hotspot.nightly.full b/15/jre/alpine/Dockerfile.hotspot.nightly.full index 2d4af7e5d..4950ecab1 100644 --- a/15/jre/alpine/Dockerfile.hotspot.nightly.full +++ b/15/jre/alpine/Dockerfile.hotspot.nightly.full @@ -61,24 +61,24 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='49bdb646fb0354667c47e835e3306df62114acfad65be79884af85c65d0caa6c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8420a8350427cccceb1837b4163b9597bc98ec51618d87a4de93a210dac13ef6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='2de640876302c95b4935acfd6ffa4d7957b2e9ce15be02b8e3ad4aea666f868c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='4576893164abca38e8fa2f8fc8561528e439b46e52e6fd91aa52e50abcb10598'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='92362c65b54ba89ffd5c36beb53febfc8053126d853680a93ee3b1d6d1635e2d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='b43e4c06ff11906a2cf9bbe544870c0d433acd0268129f4da8bfdd3a6ada0eed'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='d0dfc4b577d1ed6583f175db4a1080ab031210236941e40f6aaa7574f76abf12'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='c2d781ad433b07c2207080997bae589d1a2fb42a57e90b0d303ee79566ab94c5'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='ef297d0078ae0a042906db124bec3c68c256892c66b092fcfddaa34bff3fb028'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='51088abffa16ae700cc86af5221706373da93e3124d87e73684ccb6c5d9daa46'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/alpine/Dockerfile.openj9.nightly.full b/15/jre/alpine/Dockerfile.openj9.nightly.full index 791a16e59..242be2a6d 100644 --- a/15/jre/alpine/Dockerfile.openj9.nightly.full +++ b/15/jre/alpine/Dockerfile.openj9.nightly.full @@ -54,27 +54,27 @@ RUN apk add --no-cache tzdata --virtual .build-deps curl binutils zstd \ && apk del --purge .build-deps glibc-i18n \ && rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/* -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ apk add --no-cache --virtual .fetch-deps curl; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='d47f4f13b92cc76f2f4b7fe57a7f319519169e19d6fa7d9ba1cc8cc7cde04f27'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='45f54d71ebb7cb3664bb118b8722d65ea80e070526281794dad33f221e209bb7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66198c95064d5d9d6e0dbb633e8c1cf22987895255d0388a1e763991c3770ed0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='1e9e7f3805bf657d1625360292b35b9367093f58d3b397f4623fba3714ee0cbe'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='2f06c15108bbae44e07dccb0a3408435b5474d404254d695284529fb80ddfecc'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3b738d238e168f5b528dcdfa0b1f51d77726fa2a7f8297e9f20c7d1dfe91f019'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='5c2a0d43ac48887055af90a4bb1d6e9ebdf852e56b9e92c2b445f507c0d5dfca'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='f5df205eb6b3e070b2140fc39b61c90b8b4a818a9a1f272f5943c7a210901163'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/alpine/generate_openj9_scc.sh b/15/jre/alpine/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jre/alpine/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jre/centos/Dockerfile.hotspot.nightly.full b/15/jre/centos/Dockerfile.hotspot.nightly.full index db034eac1..8c87288c3 100644 --- a/15/jre/centos/Dockerfile.hotspot.nightly.full +++ b/15/jre/centos/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='49bdb646fb0354667c47e835e3306df62114acfad65be79884af85c65d0caa6c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8420a8350427cccceb1837b4163b9597bc98ec51618d87a4de93a210dac13ef6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='2de640876302c95b4935acfd6ffa4d7957b2e9ce15be02b8e3ad4aea666f868c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='4576893164abca38e8fa2f8fc8561528e439b46e52e6fd91aa52e50abcb10598'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='92362c65b54ba89ffd5c36beb53febfc8053126d853680a93ee3b1d6d1635e2d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='b43e4c06ff11906a2cf9bbe544870c0d433acd0268129f4da8bfdd3a6ada0eed'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='d0dfc4b577d1ed6583f175db4a1080ab031210236941e40f6aaa7574f76abf12'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='c2d781ad433b07c2207080997bae589d1a2fb42a57e90b0d303ee79566ab94c5'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='ef297d0078ae0a042906db124bec3c68c256892c66b092fcfddaa34bff3fb028'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='51088abffa16ae700cc86af5221706373da93e3124d87e73684ccb6c5d9daa46'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/centos/Dockerfile.openj9.nightly.full b/15/jre/centos/Dockerfile.openj9.nightly.full index f490927cb..a0cedb256 100644 --- a/15/jre/centos/Dockerfile.openj9.nightly.full +++ b/15/jre/centos/Dockerfile.openj9.nightly.full @@ -24,26 +24,26 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN yum install -y tzdata openssl curl ca-certificates fontconfig gzip tar \ && yum update -y; yum clean all -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='d47f4f13b92cc76f2f4b7fe57a7f319519169e19d6fa7d9ba1cc8cc7cde04f27'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='45f54d71ebb7cb3664bb118b8722d65ea80e070526281794dad33f221e209bb7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66198c95064d5d9d6e0dbb633e8c1cf22987895255d0388a1e763991c3770ed0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='1e9e7f3805bf657d1625360292b35b9367093f58d3b397f4623fba3714ee0cbe'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='2f06c15108bbae44e07dccb0a3408435b5474d404254d695284529fb80ddfecc'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3b738d238e168f5b528dcdfa0b1f51d77726fa2a7f8297e9f20c7d1dfe91f019'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='5c2a0d43ac48887055af90a4bb1d6e9ebdf852e56b9e92c2b445f507c0d5dfca'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='f5df205eb6b3e070b2140fc39b61c90b8b4a818a9a1f272f5943c7a210901163'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/centos/generate_openj9_scc.sh b/15/jre/centos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jre/centos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jre/clefos/Dockerfile.hotspot.nightly.full b/15/jre/clefos/Dockerfile.hotspot.nightly.full index acf3cb780..d6a1a422e 100644 --- a/15/jre/clefos/Dockerfile.hotspot.nightly.full +++ b/15/jre/clefos/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='49bdb646fb0354667c47e835e3306df62114acfad65be79884af85c65d0caa6c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8420a8350427cccceb1837b4163b9597bc98ec51618d87a4de93a210dac13ef6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='2de640876302c95b4935acfd6ffa4d7957b2e9ce15be02b8e3ad4aea666f868c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='4576893164abca38e8fa2f8fc8561528e439b46e52e6fd91aa52e50abcb10598'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='92362c65b54ba89ffd5c36beb53febfc8053126d853680a93ee3b1d6d1635e2d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='b43e4c06ff11906a2cf9bbe544870c0d433acd0268129f4da8bfdd3a6ada0eed'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='d0dfc4b577d1ed6583f175db4a1080ab031210236941e40f6aaa7574f76abf12'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='c2d781ad433b07c2207080997bae589d1a2fb42a57e90b0d303ee79566ab94c5'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='ef297d0078ae0a042906db124bec3c68c256892c66b092fcfddaa34bff3fb028'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='51088abffa16ae700cc86af5221706373da93e3124d87e73684ccb6c5d9daa46'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/clefos/Dockerfile.openj9.nightly.full b/15/jre/clefos/Dockerfile.openj9.nightly.full index 5611832b3..0b759d40e 100644 --- a/15/jre/clefos/Dockerfile.openj9.nightly.full +++ b/15/jre/clefos/Dockerfile.openj9.nightly.full @@ -24,26 +24,26 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN yum install -y tzdata openssl curl ca-certificates fontconfig gzip tar \ && yum update -y; yum clean all -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='d47f4f13b92cc76f2f4b7fe57a7f319519169e19d6fa7d9ba1cc8cc7cde04f27'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='45f54d71ebb7cb3664bb118b8722d65ea80e070526281794dad33f221e209bb7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66198c95064d5d9d6e0dbb633e8c1cf22987895255d0388a1e763991c3770ed0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='1e9e7f3805bf657d1625360292b35b9367093f58d3b397f4623fba3714ee0cbe'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='2f06c15108bbae44e07dccb0a3408435b5474d404254d695284529fb80ddfecc'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3b738d238e168f5b528dcdfa0b1f51d77726fa2a7f8297e9f20c7d1dfe91f019'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='5c2a0d43ac48887055af90a4bb1d6e9ebdf852e56b9e92c2b445f507c0d5dfca'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='f5df205eb6b3e070b2140fc39b61c90b8b4a818a9a1f272f5943c7a210901163'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/clefos/generate_openj9_scc.sh b/15/jre/clefos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jre/clefos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jre/debian/Dockerfile.hotspot.nightly.full b/15/jre/debian/Dockerfile.hotspot.nightly.full index 17d868d7f..187737729 100644 --- a/15/jre/debian/Dockerfile.hotspot.nightly.full +++ b/15/jre/debian/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='49bdb646fb0354667c47e835e3306df62114acfad65be79884af85c65d0caa6c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8420a8350427cccceb1837b4163b9597bc98ec51618d87a4de93a210dac13ef6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='2de640876302c95b4935acfd6ffa4d7957b2e9ce15be02b8e3ad4aea666f868c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='4576893164abca38e8fa2f8fc8561528e439b46e52e6fd91aa52e50abcb10598'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='92362c65b54ba89ffd5c36beb53febfc8053126d853680a93ee3b1d6d1635e2d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='b43e4c06ff11906a2cf9bbe544870c0d433acd0268129f4da8bfdd3a6ada0eed'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='d0dfc4b577d1ed6583f175db4a1080ab031210236941e40f6aaa7574f76abf12'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='c2d781ad433b07c2207080997bae589d1a2fb42a57e90b0d303ee79566ab94c5'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='ef297d0078ae0a042906db124bec3c68c256892c66b092fcfddaa34bff3fb028'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='51088abffa16ae700cc86af5221706373da93e3124d87e73684ccb6c5d9daa46'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/debian/Dockerfile.openj9.nightly.full b/15/jre/debian/Dockerfile.openj9.nightly.full index 9780b5dcd..470571412 100644 --- a/15/jre/debian/Dockerfile.openj9.nightly.full +++ b/15/jre/debian/Dockerfile.openj9.nightly.full @@ -27,26 +27,26 @@ RUN apt-get update \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='d47f4f13b92cc76f2f4b7fe57a7f319519169e19d6fa7d9ba1cc8cc7cde04f27'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='45f54d71ebb7cb3664bb118b8722d65ea80e070526281794dad33f221e209bb7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66198c95064d5d9d6e0dbb633e8c1cf22987895255d0388a1e763991c3770ed0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='1e9e7f3805bf657d1625360292b35b9367093f58d3b397f4623fba3714ee0cbe'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='2f06c15108bbae44e07dccb0a3408435b5474d404254d695284529fb80ddfecc'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3b738d238e168f5b528dcdfa0b1f51d77726fa2a7f8297e9f20c7d1dfe91f019'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='5c2a0d43ac48887055af90a4bb1d6e9ebdf852e56b9e92c2b445f507c0d5dfca'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='f5df205eb6b3e070b2140fc39b61c90b8b4a818a9a1f272f5943c7a210901163'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/debian/generate_openj9_scc.sh b/15/jre/debian/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jre/debian/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jre/debianslim/Dockerfile.hotspot.nightly.full b/15/jre/debianslim/Dockerfile.hotspot.nightly.full index c82429b4f..767fe0df3 100644 --- a/15/jre/debianslim/Dockerfile.hotspot.nightly.full +++ b/15/jre/debianslim/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='49bdb646fb0354667c47e835e3306df62114acfad65be79884af85c65d0caa6c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8420a8350427cccceb1837b4163b9597bc98ec51618d87a4de93a210dac13ef6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='2de640876302c95b4935acfd6ffa4d7957b2e9ce15be02b8e3ad4aea666f868c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='4576893164abca38e8fa2f8fc8561528e439b46e52e6fd91aa52e50abcb10598'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='92362c65b54ba89ffd5c36beb53febfc8053126d853680a93ee3b1d6d1635e2d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='b43e4c06ff11906a2cf9bbe544870c0d433acd0268129f4da8bfdd3a6ada0eed'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='d0dfc4b577d1ed6583f175db4a1080ab031210236941e40f6aaa7574f76abf12'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='c2d781ad433b07c2207080997bae589d1a2fb42a57e90b0d303ee79566ab94c5'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='ef297d0078ae0a042906db124bec3c68c256892c66b092fcfddaa34bff3fb028'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='51088abffa16ae700cc86af5221706373da93e3124d87e73684ccb6c5d9daa46'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/debianslim/Dockerfile.openj9.nightly.full b/15/jre/debianslim/Dockerfile.openj9.nightly.full index f80982bcf..77c73dee4 100644 --- a/15/jre/debianslim/Dockerfile.openj9.nightly.full +++ b/15/jre/debianslim/Dockerfile.openj9.nightly.full @@ -27,26 +27,26 @@ RUN apt-get update \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='d47f4f13b92cc76f2f4b7fe57a7f319519169e19d6fa7d9ba1cc8cc7cde04f27'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='45f54d71ebb7cb3664bb118b8722d65ea80e070526281794dad33f221e209bb7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66198c95064d5d9d6e0dbb633e8c1cf22987895255d0388a1e763991c3770ed0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='1e9e7f3805bf657d1625360292b35b9367093f58d3b397f4623fba3714ee0cbe'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='2f06c15108bbae44e07dccb0a3408435b5474d404254d695284529fb80ddfecc'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3b738d238e168f5b528dcdfa0b1f51d77726fa2a7f8297e9f20c7d1dfe91f019'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='5c2a0d43ac48887055af90a4bb1d6e9ebdf852e56b9e92c2b445f507c0d5dfca'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='f5df205eb6b3e070b2140fc39b61c90b8b4a818a9a1f272f5943c7a210901163'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/debianslim/generate_openj9_scc.sh b/15/jre/debianslim/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jre/debianslim/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jre/leap/Dockerfile.hotspot.nightly.full b/15/jre/leap/Dockerfile.hotspot.nightly.full index 609b01f72..4f800c603 100644 --- a/15/jre/leap/Dockerfile.hotspot.nightly.full +++ b/15/jre/leap/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='49bdb646fb0354667c47e835e3306df62114acfad65be79884af85c65d0caa6c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8420a8350427cccceb1837b4163b9597bc98ec51618d87a4de93a210dac13ef6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='2de640876302c95b4935acfd6ffa4d7957b2e9ce15be02b8e3ad4aea666f868c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='4576893164abca38e8fa2f8fc8561528e439b46e52e6fd91aa52e50abcb10598'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='92362c65b54ba89ffd5c36beb53febfc8053126d853680a93ee3b1d6d1635e2d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='b43e4c06ff11906a2cf9bbe544870c0d433acd0268129f4da8bfdd3a6ada0eed'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='d0dfc4b577d1ed6583f175db4a1080ab031210236941e40f6aaa7574f76abf12'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='c2d781ad433b07c2207080997bae589d1a2fb42a57e90b0d303ee79566ab94c5'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='ef297d0078ae0a042906db124bec3c68c256892c66b092fcfddaa34bff3fb028'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='51088abffa16ae700cc86af5221706373da93e3124d87e73684ccb6c5d9daa46'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/leap/Dockerfile.openj9.nightly.full b/15/jre/leap/Dockerfile.openj9.nightly.full index 0c5e5cb49..0a39c3041 100644 --- a/15/jre/leap/Dockerfile.openj9.nightly.full +++ b/15/jre/leap/Dockerfile.openj9.nightly.full @@ -24,26 +24,26 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN zypper install --no-recommends -y timezone openssl curl ca-certificates fontconfig gzip tar \ && zypper update -y; zypper clean --all -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='d47f4f13b92cc76f2f4b7fe57a7f319519169e19d6fa7d9ba1cc8cc7cde04f27'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='45f54d71ebb7cb3664bb118b8722d65ea80e070526281794dad33f221e209bb7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66198c95064d5d9d6e0dbb633e8c1cf22987895255d0388a1e763991c3770ed0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='1e9e7f3805bf657d1625360292b35b9367093f58d3b397f4623fba3714ee0cbe'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='2f06c15108bbae44e07dccb0a3408435b5474d404254d695284529fb80ddfecc'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3b738d238e168f5b528dcdfa0b1f51d77726fa2a7f8297e9f20c7d1dfe91f019'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='5c2a0d43ac48887055af90a4bb1d6e9ebdf852e56b9e92c2b445f507c0d5dfca'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='f5df205eb6b3e070b2140fc39b61c90b8b4a818a9a1f272f5943c7a210901163'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/leap/generate_openj9_scc.sh b/15/jre/leap/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jre/leap/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jre/tumbleweed/Dockerfile.hotspot.nightly.full b/15/jre/tumbleweed/Dockerfile.hotspot.nightly.full index 395b061e3..ee271f3f5 100644 --- a/15/jre/tumbleweed/Dockerfile.hotspot.nightly.full +++ b/15/jre/tumbleweed/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='49bdb646fb0354667c47e835e3306df62114acfad65be79884af85c65d0caa6c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8420a8350427cccceb1837b4163b9597bc98ec51618d87a4de93a210dac13ef6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='2de640876302c95b4935acfd6ffa4d7957b2e9ce15be02b8e3ad4aea666f868c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='4576893164abca38e8fa2f8fc8561528e439b46e52e6fd91aa52e50abcb10598'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='92362c65b54ba89ffd5c36beb53febfc8053126d853680a93ee3b1d6d1635e2d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='b43e4c06ff11906a2cf9bbe544870c0d433acd0268129f4da8bfdd3a6ada0eed'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='d0dfc4b577d1ed6583f175db4a1080ab031210236941e40f6aaa7574f76abf12'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='c2d781ad433b07c2207080997bae589d1a2fb42a57e90b0d303ee79566ab94c5'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='ef297d0078ae0a042906db124bec3c68c256892c66b092fcfddaa34bff3fb028'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='51088abffa16ae700cc86af5221706373da93e3124d87e73684ccb6c5d9daa46'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/tumbleweed/Dockerfile.openj9.nightly.full b/15/jre/tumbleweed/Dockerfile.openj9.nightly.full index 7efda6a56..504b16775 100644 --- a/15/jre/tumbleweed/Dockerfile.openj9.nightly.full +++ b/15/jre/tumbleweed/Dockerfile.openj9.nightly.full @@ -24,26 +24,26 @@ ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' RUN zypper install --no-recommends -y timezone openssl curl ca-certificates fontconfig gzip tar \ && zypper update -y; zypper clean --all -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='d47f4f13b92cc76f2f4b7fe57a7f319519169e19d6fa7d9ba1cc8cc7cde04f27'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='45f54d71ebb7cb3664bb118b8722d65ea80e070526281794dad33f221e209bb7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66198c95064d5d9d6e0dbb633e8c1cf22987895255d0388a1e763991c3770ed0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='1e9e7f3805bf657d1625360292b35b9367093f58d3b397f4623fba3714ee0cbe'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='2f06c15108bbae44e07dccb0a3408435b5474d404254d695284529fb80ddfecc'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3b738d238e168f5b528dcdfa0b1f51d77726fa2a7f8297e9f20c7d1dfe91f019'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='5c2a0d43ac48887055af90a4bb1d6e9ebdf852e56b9e92c2b445f507c0d5dfca'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='f5df205eb6b3e070b2140fc39b61c90b8b4a818a9a1f272f5943c7a210901163'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/tumbleweed/generate_openj9_scc.sh b/15/jre/tumbleweed/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jre/tumbleweed/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jre/ubi-minimal/Dockerfile.hotspot.nightly.full b/15/jre/ubi-minimal/Dockerfile.hotspot.nightly.full index b45ef84aa..b8c685972 100644 --- a/15/jre/ubi-minimal/Dockerfile.hotspot.nightly.full +++ b/15/jre/ubi-minimal/Dockerfile.hotspot.nightly.full @@ -38,24 +38,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='49bdb646fb0354667c47e835e3306df62114acfad65be79884af85c65d0caa6c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8420a8350427cccceb1837b4163b9597bc98ec51618d87a4de93a210dac13ef6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='2de640876302c95b4935acfd6ffa4d7957b2e9ce15be02b8e3ad4aea666f868c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='4576893164abca38e8fa2f8fc8561528e439b46e52e6fd91aa52e50abcb10598'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='92362c65b54ba89ffd5c36beb53febfc8053126d853680a93ee3b1d6d1635e2d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='b43e4c06ff11906a2cf9bbe544870c0d433acd0268129f4da8bfdd3a6ada0eed'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='d0dfc4b577d1ed6583f175db4a1080ab031210236941e40f6aaa7574f76abf12'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='c2d781ad433b07c2207080997bae589d1a2fb42a57e90b0d303ee79566ab94c5'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='ef297d0078ae0a042906db124bec3c68c256892c66b092fcfddaa34bff3fb028'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='51088abffa16ae700cc86af5221706373da93e3124d87e73684ccb6c5d9daa46'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/ubi-minimal/Dockerfile.openj9.nightly.full b/15/jre/ubi-minimal/Dockerfile.openj9.nightly.full index dfbdee725..491cf31a9 100644 --- a/15/jre/ubi-minimal/Dockerfile.openj9.nightly.full +++ b/15/jre/ubi-minimal/Dockerfile.openj9.nightly.full @@ -26,32 +26,32 @@ RUN microdnf install -y tzdata openssl curl ca-certificates fontconfig glibc-lan LABEL name="AdoptOpenJDK Java" \ vendor="AdoptOpenJDK" \ - version="jdk-15+36_openj9-0.23.0-m1" \ + version="jdk15u" \ release="15" \ run="docker run --rm -ti /bin/bash" \ summary="AdoptOpenJDK Docker Image for OpenJDK with openj9 and ubi-minimal" \ description="For more information on this image please see https://github.com/AdoptOpenJDK/openjdk-docker/blob/master/README.md" -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='d47f4f13b92cc76f2f4b7fe57a7f319519169e19d6fa7d9ba1cc8cc7cde04f27'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='45f54d71ebb7cb3664bb118b8722d65ea80e070526281794dad33f221e209bb7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66198c95064d5d9d6e0dbb633e8c1cf22987895255d0388a1e763991c3770ed0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='1e9e7f3805bf657d1625360292b35b9367093f58d3b397f4623fba3714ee0cbe'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='2f06c15108bbae44e07dccb0a3408435b5474d404254d695284529fb80ddfecc'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3b738d238e168f5b528dcdfa0b1f51d77726fa2a7f8297e9f20c7d1dfe91f019'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='5c2a0d43ac48887055af90a4bb1d6e9ebdf852e56b9e92c2b445f507c0d5dfca'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='f5df205eb6b3e070b2140fc39b61c90b8b4a818a9a1f272f5943c7a210901163'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/ubi-minimal/generate_openj9_scc.sh b/15/jre/ubi-minimal/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jre/ubi-minimal/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jre/ubi/Dockerfile.hotspot.nightly.full b/15/jre/ubi/Dockerfile.hotspot.nightly.full index 6f89898ba..cf53cf989 100644 --- a/15/jre/ubi/Dockerfile.hotspot.nightly.full +++ b/15/jre/ubi/Dockerfile.hotspot.nightly.full @@ -38,24 +38,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='49bdb646fb0354667c47e835e3306df62114acfad65be79884af85c65d0caa6c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8420a8350427cccceb1837b4163b9597bc98ec51618d87a4de93a210dac13ef6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='2de640876302c95b4935acfd6ffa4d7957b2e9ce15be02b8e3ad4aea666f868c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='4576893164abca38e8fa2f8fc8561528e439b46e52e6fd91aa52e50abcb10598'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='92362c65b54ba89ffd5c36beb53febfc8053126d853680a93ee3b1d6d1635e2d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='b43e4c06ff11906a2cf9bbe544870c0d433acd0268129f4da8bfdd3a6ada0eed'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='d0dfc4b577d1ed6583f175db4a1080ab031210236941e40f6aaa7574f76abf12'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='c2d781ad433b07c2207080997bae589d1a2fb42a57e90b0d303ee79566ab94c5'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='ef297d0078ae0a042906db124bec3c68c256892c66b092fcfddaa34bff3fb028'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='51088abffa16ae700cc86af5221706373da93e3124d87e73684ccb6c5d9daa46'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/ubi/Dockerfile.openj9.nightly.full b/15/jre/ubi/Dockerfile.openj9.nightly.full index 34b548759..759e1ad8b 100644 --- a/15/jre/ubi/Dockerfile.openj9.nightly.full +++ b/15/jre/ubi/Dockerfile.openj9.nightly.full @@ -26,32 +26,32 @@ RUN dnf install -y tzdata openssl curl ca-certificates fontconfig glibc-langpack LABEL name="AdoptOpenJDK Java" \ vendor="AdoptOpenJDK" \ - version="jdk-15+36_openj9-0.23.0-m1" \ + version="jdk15u" \ release="15" \ run="docker run --rm -ti /bin/bash" \ summary="AdoptOpenJDK Docker Image for OpenJDK with openj9 and ubi" \ description="For more information on this image please see https://github.com/AdoptOpenJDK/openjdk-docker/blob/master/README.md" -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='d47f4f13b92cc76f2f4b7fe57a7f319519169e19d6fa7d9ba1cc8cc7cde04f27'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='45f54d71ebb7cb3664bb118b8722d65ea80e070526281794dad33f221e209bb7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66198c95064d5d9d6e0dbb633e8c1cf22987895255d0388a1e763991c3770ed0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='1e9e7f3805bf657d1625360292b35b9367093f58d3b397f4623fba3714ee0cbe'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='2f06c15108bbae44e07dccb0a3408435b5474d404254d695284529fb80ddfecc'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3b738d238e168f5b528dcdfa0b1f51d77726fa2a7f8297e9f20c7d1dfe91f019'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='5c2a0d43ac48887055af90a4bb1d6e9ebdf852e56b9e92c2b445f507c0d5dfca'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='f5df205eb6b3e070b2140fc39b61c90b8b4a818a9a1f272f5943c7a210901163'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/ubi/generate_openj9_scc.sh b/15/jre/ubi/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jre/ubi/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jre/ubuntu/Dockerfile.hotspot.nightly.full b/15/jre/ubuntu/Dockerfile.hotspot.nightly.full index fdc35c28e..c960c8cb2 100644 --- a/15/jre/ubuntu/Dockerfile.hotspot.nightly.full +++ b/15/jre/ubuntu/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='49bdb646fb0354667c47e835e3306df62114acfad65be79884af85c65d0caa6c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='8420a8350427cccceb1837b4163b9597bc98ec51618d87a4de93a210dac13ef6'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='2de640876302c95b4935acfd6ffa4d7957b2e9ce15be02b8e3ad4aea666f868c'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_arm_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='4576893164abca38e8fa2f8fc8561528e439b46e52e6fd91aa52e50abcb10598'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_arm_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='92362c65b54ba89ffd5c36beb53febfc8053126d853680a93ee3b1d6d1635e2d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='b43e4c06ff11906a2cf9bbe544870c0d433acd0268129f4da8bfdd3a6ada0eed'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='d0dfc4b577d1ed6583f175db4a1080ab031210236941e40f6aaa7574f76abf12'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='c2d781ad433b07c2207080997bae589d1a2fb42a57e90b0d303ee79566ab94c5'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='ef297d0078ae0a042906db124bec3c68c256892c66b092fcfddaa34bff3fb028'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_linux_hotspot_2020-09-23-15-14.tar.gz'; \ + ESUM='51088abffa16ae700cc86af5221706373da93e3124d87e73684ccb6c5d9daa46'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_hotspot_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/ubuntu/Dockerfile.openj9.nightly.full b/15/jre/ubuntu/Dockerfile.openj9.nightly.full index 49278ec8c..dbb15387b 100644 --- a/15/jre/ubuntu/Dockerfile.openj9.nightly.full +++ b/15/jre/ubuntu/Dockerfile.openj9.nightly.full @@ -27,26 +27,26 @@ RUN apt-get update \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='d47f4f13b92cc76f2f4b7fe57a7f319519169e19d6fa7d9ba1cc8cc7cde04f27'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_aarch64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='45f54d71ebb7cb3664bb118b8722d65ea80e070526281794dad33f221e209bb7'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_aarch64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66198c95064d5d9d6e0dbb633e8c1cf22987895255d0388a1e763991c3770ed0'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_ppc64le_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='1e9e7f3805bf657d1625360292b35b9367093f58d3b397f4623fba3714ee0cbe'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_ppc64le_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ s390x) \ - ESUM='2f06c15108bbae44e07dccb0a3408435b5474d404254d695284529fb80ddfecc'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_s390x_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='3b738d238e168f5b528dcdfa0b1f51d77726fa2a7f8297e9f20c7d1dfe91f019'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_s390x_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='5c2a0d43ac48887055af90a4bb1d6e9ebdf852e56b9e92c2b445f507c0d5dfca'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_linux_openj9_15_36_openj9-0.23.0-m1.tar.gz'; \ + ESUM='f5df205eb6b3e070b2140fc39b61c90b8b4a818a9a1f272f5943c7a210901163'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_linux_openj9_2020-09-25-11-08.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/15/jre/ubuntu/generate_openj9_scc.sh b/15/jre/ubuntu/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/15/jre/ubuntu/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/15/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full b/15/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full index c0a4cabbe..c241b3886 100644 --- a/15/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full +++ b/15/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk15u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (6d7e87410346b5380bebb5e97a02b1fe4d2df91201aaba82c7f8357aacb97122) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '6d7e87410346b5380bebb5e97a02b1fe4d2df91201aaba82c7f8357aacb97122') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (5076f880f5ec201787fa5a786a19d0a5e30d8327c21ac3d86cf7871876e7e563) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '5076f880f5ec201787fa5a786a19d0a5e30d8327c21ac3d86cf7871876e7e563') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim b/15/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim index c79a373c4..44196697b 100644 --- a/15/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim +++ b/15/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk15u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (6d7e87410346b5380bebb5e97a02b1fe4d2df91201aaba82c7f8357aacb97122) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '6d7e87410346b5380bebb5e97a02b1fe4d2df91201aaba82c7f8357aacb97122') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (5076f880f5ec201787fa5a786a19d0a5e30d8327c21ac3d86cf7871876e7e563) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '5076f880f5ec201787fa5a786a19d0a5e30d8327c21ac3d86cf7871876e7e563') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full b/15/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full index 1da05dc12..fcbcf633c 100644 --- a/15/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full +++ b/15/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] diff --git a/15/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.full b/15/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.full index 0c06f2001..1b32e83bc 100644 --- a/15/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.full +++ b/15/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.full @@ -17,19 +17,20 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (a0d89d2df6e14a1e8b4f7250e4b6ff5ffb78054b960190f836722595d3d39ab9) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'a0d89d2df6e14a1e8b4f7250e4b6ff5ffb78054b960190f836722595d3d39ab9') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (c3d995ccec239f8f0293d3b25c6b707713732237decd6238b94f1c8e29bb427c) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'c3d995ccec239f8f0293d3b25c6b707713732237decd6238b94f1c8e29bb427c') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim b/15/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim index 1a56509ce..98c25b63b 100644 --- a/15/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim +++ b/15/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim @@ -17,21 +17,22 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (a0d89d2df6e14a1e8b4f7250e4b6ff5ffb78054b960190f836722595d3d39ab9) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'a0d89d2df6e14a1e8b4f7250e4b6ff5ffb78054b960190f836722595d3d39ab9') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (c3d995ccec239f8f0293d3b25c6b707713732237decd6238b94f1c8e29bb427c) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'c3d995ccec239f8f0293d3b25c6b707713732237decd6238b94f1c8e29bb427c') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full b/15/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full index 79f873d77..436fd8240 100644 --- a/15/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full +++ b/15/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk15u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (6d7e87410346b5380bebb5e97a02b1fe4d2df91201aaba82c7f8357aacb97122) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '6d7e87410346b5380bebb5e97a02b1fe4d2df91201aaba82c7f8357aacb97122') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (5076f880f5ec201787fa5a786a19d0a5e30d8327c21ac3d86cf7871876e7e563) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '5076f880f5ec201787fa5a786a19d0a5e30d8327c21ac3d86cf7871876e7e563') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim b/15/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim index b1a8a4b78..f330d9a4f 100644 --- a/15/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim +++ b/15/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk15u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (6d7e87410346b5380bebb5e97a02b1fe4d2df91201aaba82c7f8357aacb97122) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '6d7e87410346b5380bebb5e97a02b1fe4d2df91201aaba82c7f8357aacb97122') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (5076f880f5ec201787fa5a786a19d0a5e30d8327c21ac3d86cf7871876e7e563) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '5076f880f5ec201787fa5a786a19d0a5e30d8327c21ac3d86cf7871876e7e563') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.full b/15/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.full index 15f4d668b..c6d1df853 100644 --- a/15/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.full +++ b/15/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.full @@ -17,19 +17,20 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (a0d89d2df6e14a1e8b4f7250e4b6ff5ffb78054b960190f836722595d3d39ab9) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'a0d89d2df6e14a1e8b4f7250e4b6ff5ffb78054b960190f836722595d3d39ab9') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (c3d995ccec239f8f0293d3b25c6b707713732237decd6238b94f1c8e29bb427c) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'c3d995ccec239f8f0293d3b25c6b707713732237decd6238b94f1c8e29bb427c') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim b/15/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim index d6f30d124..33bf5e69e 100644 --- a/15/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim +++ b/15/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim @@ -17,21 +17,22 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (a0d89d2df6e14a1e8b4f7250e4b6ff5ffb78054b960190f836722595d3d39ab9) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'a0d89d2df6e14a1e8b4f7250e4b6ff5ffb78054b960190f836722595d3d39ab9') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (c3d995ccec239f8f0293d3b25c6b707713732237decd6238b94f1c8e29bb427c) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'c3d995ccec239f8f0293d3b25c6b707713732237decd6238b94f1c8e29bb427c') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full b/15/jre/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full index 0df7d780b..94e723370 100644 --- a/15/jre/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full +++ b/15/jre/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (9ffae2b4efb0aa4acee44dcf21e7613118984ada96baa5e8645a66379c887bba) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9ffae2b4efb0aa4acee44dcf21e7613118984ada96baa5e8645a66379c887bba') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (78c33edc21397f3c1936c70b466c8c483c162bebedf907a962f631d5de389577) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '78c33edc21397f3c1936c70b466c8c483c162bebedf907a962f631d5de389577') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full b/15/jre/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full index 363bd85de..4bbe300ad 100644 --- a/15/jre/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full +++ b/15/jre/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full @@ -22,13 +22,13 @@ FROM mcr.microsoft.com/windows/servercore:1809 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (7a30dd0bb557386139418daf0a20b0117df48a5f6c5db1e84bdfcf6c6dc1cd03) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '7a30dd0bb557386139418daf0a20b0117df48a5f6c5db1e84bdfcf6c6dc1cd03') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (d42eea87b24f7b1a0704a4492f02af157c0d6d4f4a955dd97b4099c56ffe52e2) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'd42eea87b24f7b1a0704a4492f02af157c0d6d4f4a955dd97b4099c56ffe52e2') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full b/15/jre/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full index 7052de70f..82f26a86f 100644 --- a/15/jre/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full +++ b/15/jre/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (9ffae2b4efb0aa4acee44dcf21e7613118984ada96baa5e8645a66379c887bba) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9ffae2b4efb0aa4acee44dcf21e7613118984ada96baa5e8645a66379c887bba') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (78c33edc21397f3c1936c70b466c8c483c162bebedf907a962f631d5de389577) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '78c33edc21397f3c1936c70b466c8c483c162bebedf907a962f631d5de389577') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full b/15/jre/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full index a9bca74bd..6700cc549 100644 --- a/15/jre/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full +++ b/15/jre/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full @@ -22,13 +22,13 @@ FROM mcr.microsoft.com/windows/servercore:1909 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (7a30dd0bb557386139418daf0a20b0117df48a5f6c5db1e84bdfcf6c6dc1cd03) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '7a30dd0bb557386139418daf0a20b0117df48a5f6c5db1e84bdfcf6c6dc1cd03') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (d42eea87b24f7b1a0704a4492f02af157c0d6d4f4a955dd97b4099c56ffe52e2) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'd42eea87b24f7b1a0704a4492f02af157c0d6d4f4a955dd97b4099c56ffe52e2') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full b/15/jre/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full index cf4de8fcb..55b53afe4 100644 --- a/15/jre/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full +++ b/15/jre/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (9ffae2b4efb0aa4acee44dcf21e7613118984ada96baa5e8645a66379c887bba) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9ffae2b4efb0aa4acee44dcf21e7613118984ada96baa5e8645a66379c887bba') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (78c33edc21397f3c1936c70b466c8c483c162bebedf907a962f631d5de389577) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '78c33edc21397f3c1936c70b466c8c483c162bebedf907a962f631d5de389577') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full b/15/jre/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full index 54947f836..dc430973a 100644 --- a/15/jre/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full +++ b/15/jre/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full @@ -22,13 +22,13 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2016 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (7a30dd0bb557386139418daf0a20b0117df48a5f6c5db1e84bdfcf6c6dc1cd03) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '7a30dd0bb557386139418daf0a20b0117df48a5f6c5db1e84bdfcf6c6dc1cd03') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (d42eea87b24f7b1a0704a4492f02af157c0d6d4f4a955dd97b4099c56ffe52e2) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'd42eea87b24f7b1a0704a4492f02af157c0d6d4f4a955dd97b4099c56ffe52e2') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full b/15/jre/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full index 00ab9990d..45eab45de 100644 --- a/15/jre/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full +++ b/15/jre/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-23-15-14/OpenJDK15U-jre_x64_windows_hotspot_2020-09-23-15-14.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (9ffae2b4efb0aa4acee44dcf21e7613118984ada96baa5e8645a66379c887bba) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9ffae2b4efb0aa4acee44dcf21e7613118984ada96baa5e8645a66379c887bba') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_hotspot_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (78c33edc21397f3c1936c70b466c8c483c162bebedf907a962f631d5de389577) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '78c33edc21397f3c1936c70b466c8c483c162bebedf907a962f631d5de389577') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/15/jre/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full b/15/jre/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full index 5020ae93c..fc21587a4 100644 --- a/15/jre/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full +++ b/15/jre/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full @@ -22,13 +22,13 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2019 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -ENV JAVA_VERSION jdk-15+36_openj9-0.23.0-m1 +ENV JAVA_VERSION jdk15u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36_openj9-0.23.0-m1/OpenJDK15U-jre_x64_windows_openj9_15_36_openj9-0.23.0-m1.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (7a30dd0bb557386139418daf0a20b0117df48a5f6c5db1e84bdfcf6c6dc1cd03) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '7a30dd0bb557386139418daf0a20b0117df48a5f6c5db1e84bdfcf6c6dc1cd03') { \ + wget https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk15u-2020-09-25-11-08/OpenJDK15U-jre_x64_windows_openj9_2020-09-25-11-08.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (d42eea87b24f7b1a0704a4492f02af157c0d6d4f4a955dd97b4099c56ffe52e2) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'd42eea87b24f7b1a0704a4492f02af157c0d6d4f4a955dd97b4099c56ffe52e2') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/alpine/Dockerfile.hotspot.nightly.full b/8/jdk/alpine/Dockerfile.hotspot.nightly.full index f1bbf9cd2..65719410c 100644 --- a/8/jdk/alpine/Dockerfile.hotspot.nightly.full +++ b/8/jdk/alpine/Dockerfile.hotspot.nightly.full @@ -61,24 +61,24 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/alpine/Dockerfile.hotspot.nightly.slim b/8/jdk/alpine/Dockerfile.hotspot.nightly.slim index 63f5f1b00..3a2ad89bc 100644 --- a/8/jdk/alpine/Dockerfile.hotspot.nightly.slim +++ b/8/jdk/alpine/Dockerfile.hotspot.nightly.slim @@ -63,24 +63,24 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/alpine/Dockerfile.openj9.nightly.full b/8/jdk/alpine/Dockerfile.openj9.nightly.full index ce219af5b..c25931c8a 100644 --- a/8/jdk/alpine/Dockerfile.openj9.nightly.full +++ b/8/jdk/alpine/Dockerfile.openj9.nightly.full @@ -61,20 +61,20 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/alpine/Dockerfile.openj9.nightly.slim b/8/jdk/alpine/Dockerfile.openj9.nightly.slim index cd3955ef6..706da4c97 100644 --- a/8/jdk/alpine/Dockerfile.openj9.nightly.slim +++ b/8/jdk/alpine/Dockerfile.openj9.nightly.slim @@ -63,20 +63,20 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/alpine/generate_openj9_scc.sh b/8/jdk/alpine/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jdk/alpine/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jdk/centos/Dockerfile.hotspot.nightly.full b/8/jdk/centos/Dockerfile.hotspot.nightly.full index 9e4c709f7..761f75f4a 100644 --- a/8/jdk/centos/Dockerfile.hotspot.nightly.full +++ b/8/jdk/centos/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/centos/Dockerfile.hotspot.nightly.slim b/8/jdk/centos/Dockerfile.hotspot.nightly.slim index 9c1d3b5d0..c48f52026 100644 --- a/8/jdk/centos/Dockerfile.hotspot.nightly.slim +++ b/8/jdk/centos/Dockerfile.hotspot.nightly.slim @@ -32,24 +32,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/centos/Dockerfile.openj9.nightly.full b/8/jdk/centos/Dockerfile.openj9.nightly.full index 80142c92f..40295dbde 100644 --- a/8/jdk/centos/Dockerfile.openj9.nightly.full +++ b/8/jdk/centos/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/centos/Dockerfile.openj9.nightly.slim b/8/jdk/centos/Dockerfile.openj9.nightly.slim index 5e1dc000a..c1c521887 100644 --- a/8/jdk/centos/Dockerfile.openj9.nightly.slim +++ b/8/jdk/centos/Dockerfile.openj9.nightly.slim @@ -32,20 +32,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/centos/generate_openj9_scc.sh b/8/jdk/centos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jdk/centos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jdk/clefos/Dockerfile.hotspot.nightly.full b/8/jdk/clefos/Dockerfile.hotspot.nightly.full index 853c4696a..03a389797 100644 --- a/8/jdk/clefos/Dockerfile.hotspot.nightly.full +++ b/8/jdk/clefos/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/clefos/Dockerfile.hotspot.nightly.slim b/8/jdk/clefos/Dockerfile.hotspot.nightly.slim index 2e6ac460e..208b992e9 100644 --- a/8/jdk/clefos/Dockerfile.hotspot.nightly.slim +++ b/8/jdk/clefos/Dockerfile.hotspot.nightly.slim @@ -32,24 +32,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/clefos/Dockerfile.openj9.nightly.full b/8/jdk/clefos/Dockerfile.openj9.nightly.full index 3ef33fe23..4eee6e364 100644 --- a/8/jdk/clefos/Dockerfile.openj9.nightly.full +++ b/8/jdk/clefos/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/clefos/Dockerfile.openj9.nightly.slim b/8/jdk/clefos/Dockerfile.openj9.nightly.slim index 51e806de6..71ea683a5 100644 --- a/8/jdk/clefos/Dockerfile.openj9.nightly.slim +++ b/8/jdk/clefos/Dockerfile.openj9.nightly.slim @@ -32,20 +32,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/clefos/generate_openj9_scc.sh b/8/jdk/clefos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jdk/clefos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jdk/debian/Dockerfile.hotspot.nightly.full b/8/jdk/debian/Dockerfile.hotspot.nightly.full index 8d0ca7d4f..aa12cc05c 100644 --- a/8/jdk/debian/Dockerfile.hotspot.nightly.full +++ b/8/jdk/debian/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/debian/Dockerfile.hotspot.nightly.slim b/8/jdk/debian/Dockerfile.hotspot.nightly.slim index 0b27ee357..0787afc37 100644 --- a/8/jdk/debian/Dockerfile.hotspot.nightly.slim +++ b/8/jdk/debian/Dockerfile.hotspot.nightly.slim @@ -35,24 +35,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/debian/Dockerfile.openj9.nightly.full b/8/jdk/debian/Dockerfile.openj9.nightly.full index 24d57c7a6..5332262af 100644 --- a/8/jdk/debian/Dockerfile.openj9.nightly.full +++ b/8/jdk/debian/Dockerfile.openj9.nightly.full @@ -33,20 +33,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/debian/Dockerfile.openj9.nightly.slim b/8/jdk/debian/Dockerfile.openj9.nightly.slim index dd9862e02..dc6b6a509 100644 --- a/8/jdk/debian/Dockerfile.openj9.nightly.slim +++ b/8/jdk/debian/Dockerfile.openj9.nightly.slim @@ -35,20 +35,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/debian/generate_openj9_scc.sh b/8/jdk/debian/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jdk/debian/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jdk/debianslim/Dockerfile.hotspot.nightly.full b/8/jdk/debianslim/Dockerfile.hotspot.nightly.full index b3be57e49..30b4fe757 100644 --- a/8/jdk/debianslim/Dockerfile.hotspot.nightly.full +++ b/8/jdk/debianslim/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/debianslim/Dockerfile.hotspot.nightly.slim b/8/jdk/debianslim/Dockerfile.hotspot.nightly.slim index 66b09ff42..4701ceeab 100644 --- a/8/jdk/debianslim/Dockerfile.hotspot.nightly.slim +++ b/8/jdk/debianslim/Dockerfile.hotspot.nightly.slim @@ -35,24 +35,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/debianslim/Dockerfile.openj9.nightly.full b/8/jdk/debianslim/Dockerfile.openj9.nightly.full index c5a5bb117..e46da8048 100644 --- a/8/jdk/debianslim/Dockerfile.openj9.nightly.full +++ b/8/jdk/debianslim/Dockerfile.openj9.nightly.full @@ -33,20 +33,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/debianslim/Dockerfile.openj9.nightly.slim b/8/jdk/debianslim/Dockerfile.openj9.nightly.slim index 14b3f4246..eae9a9e4a 100644 --- a/8/jdk/debianslim/Dockerfile.openj9.nightly.slim +++ b/8/jdk/debianslim/Dockerfile.openj9.nightly.slim @@ -35,20 +35,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/debianslim/generate_openj9_scc.sh b/8/jdk/debianslim/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jdk/debianslim/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jdk/leap/Dockerfile.hotspot.nightly.full b/8/jdk/leap/Dockerfile.hotspot.nightly.full index d388f6518..ee27c671d 100644 --- a/8/jdk/leap/Dockerfile.hotspot.nightly.full +++ b/8/jdk/leap/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/leap/Dockerfile.openj9.nightly.full b/8/jdk/leap/Dockerfile.openj9.nightly.full index a8c977290..b6958044b 100644 --- a/8/jdk/leap/Dockerfile.openj9.nightly.full +++ b/8/jdk/leap/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/leap/generate_openj9_scc.sh b/8/jdk/leap/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jdk/leap/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jdk/tumbleweed/Dockerfile.hotspot.nightly.full b/8/jdk/tumbleweed/Dockerfile.hotspot.nightly.full index 57ff797aa..c35d2c737 100644 --- a/8/jdk/tumbleweed/Dockerfile.hotspot.nightly.full +++ b/8/jdk/tumbleweed/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/tumbleweed/Dockerfile.openj9.nightly.full b/8/jdk/tumbleweed/Dockerfile.openj9.nightly.full index 5c0a71832..932da4f52 100644 --- a/8/jdk/tumbleweed/Dockerfile.openj9.nightly.full +++ b/8/jdk/tumbleweed/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/tumbleweed/generate_openj9_scc.sh b/8/jdk/tumbleweed/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jdk/tumbleweed/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jdk/ubi-minimal/Dockerfile.hotspot.nightly.full b/8/jdk/ubi-minimal/Dockerfile.hotspot.nightly.full index ef3dd7a50..4f4815036 100644 --- a/8/jdk/ubi-minimal/Dockerfile.hotspot.nightly.full +++ b/8/jdk/ubi-minimal/Dockerfile.hotspot.nightly.full @@ -38,24 +38,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/ubi-minimal/Dockerfile.openj9.nightly.full b/8/jdk/ubi-minimal/Dockerfile.openj9.nightly.full index dd58c2945..2b6e6bed5 100644 --- a/8/jdk/ubi-minimal/Dockerfile.openj9.nightly.full +++ b/8/jdk/ubi-minimal/Dockerfile.openj9.nightly.full @@ -38,20 +38,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/ubi-minimal/generate_openj9_scc.sh b/8/jdk/ubi-minimal/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jdk/ubi-minimal/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jdk/ubi/Dockerfile.hotspot.nightly.full b/8/jdk/ubi/Dockerfile.hotspot.nightly.full index 389cab906..49f267b89 100644 --- a/8/jdk/ubi/Dockerfile.hotspot.nightly.full +++ b/8/jdk/ubi/Dockerfile.hotspot.nightly.full @@ -38,24 +38,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/ubi/Dockerfile.hotspot.nightly.slim b/8/jdk/ubi/Dockerfile.hotspot.nightly.slim index b5ddeed2c..56fa168e1 100644 --- a/8/jdk/ubi/Dockerfile.hotspot.nightly.slim +++ b/8/jdk/ubi/Dockerfile.hotspot.nightly.slim @@ -40,24 +40,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/ubi/Dockerfile.openj9.nightly.full b/8/jdk/ubi/Dockerfile.openj9.nightly.full index d8849b481..bcb31b839 100644 --- a/8/jdk/ubi/Dockerfile.openj9.nightly.full +++ b/8/jdk/ubi/Dockerfile.openj9.nightly.full @@ -38,20 +38,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/ubi/Dockerfile.openj9.nightly.slim b/8/jdk/ubi/Dockerfile.openj9.nightly.slim index 02032a03e..283cf732e 100644 --- a/8/jdk/ubi/Dockerfile.openj9.nightly.slim +++ b/8/jdk/ubi/Dockerfile.openj9.nightly.slim @@ -40,20 +40,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/ubi/generate_openj9_scc.sh b/8/jdk/ubi/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jdk/ubi/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jdk/ubuntu/Dockerfile.hotspot.nightly.full b/8/jdk/ubuntu/Dockerfile.hotspot.nightly.full index e0807429a..ca94667a4 100644 --- a/8/jdk/ubuntu/Dockerfile.hotspot.nightly.full +++ b/8/jdk/ubuntu/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/ubuntu/Dockerfile.hotspot.nightly.slim b/8/jdk/ubuntu/Dockerfile.hotspot.nightly.slim index 3f24965b9..bf045db40 100644 --- a/8/jdk/ubuntu/Dockerfile.hotspot.nightly.slim +++ b/8/jdk/ubuntu/Dockerfile.hotspot.nightly.slim @@ -35,24 +35,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='5bced920d7483aa8e3aa296d9a779d169e2b46cc81f67168de0d2ef9d0554a6d'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='639d32c464b0945c2ef3448dc577fc613f741cf0846acb1cc9b266c40f73a4a4'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='eb06ece615ebb295d87d937a9511320262e40263ed52ba6d577cead238ac0a3b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='570a948f8faaa2bff305e2e36339b1af9b93c9ff6a36931a508bbd29de497f3a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='2e7e4317d480f15d89a76be1a4e08a3bf9e614031663b03fbca21d9a157a5f86'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='52c442cd5a545e3b45373618272f9e213539dd400c9708874aa2477774df6acb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='14c64e268fbe11d3ade735f5be3006a54f677462b1941a7957e08bf61841f708'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='7b41e9925f1e869c68a727b32f133f4a41d7538589d42e0a224561c4e391c635'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='b2ff1725d7e7272f78d2c94db3221840891494393c2e58661ac750068360f9c1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='bec71526409d9ad97b4da46bc7074f69d31d19a0d265de395a9e5313fc900633'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/ubuntu/Dockerfile.openj9.nightly.full b/8/jdk/ubuntu/Dockerfile.openj9.nightly.full index 26e8d0598..d1d585d84 100644 --- a/8/jdk/ubuntu/Dockerfile.openj9.nightly.full +++ b/8/jdk/ubuntu/Dockerfile.openj9.nightly.full @@ -33,20 +33,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/ubuntu/Dockerfile.openj9.nightly.slim b/8/jdk/ubuntu/Dockerfile.openj9.nightly.slim index c4ec6eab0..2da7e0c04 100644 --- a/8/jdk/ubuntu/Dockerfile.openj9.nightly.slim +++ b/8/jdk/ubuntu/Dockerfile.openj9.nightly.slim @@ -35,20 +35,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='4b4d442cfdb52f6d0b7d5ec8a39338ce642cf3fd554520712be22c82bf48d54a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbaa646ab8bec997383184762c605615eebcf6cbe64742866939d787ac1f019c'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='66b9761518716d5fea27119aa6aea4974ca367cb2131bf1338ce8781afc26ec7'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='fbbaa815602254ee6357a40796183d47e5b0c333b5bfe430dd3445088ed7d956'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='81e440b07e0e62c11d0fdf46cbed4f48ae5dbd27b3ac9027c8678a561ea69863'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='a43e965cc9cb2c7c99f3d9e08d7f8d246bf2d868fb3491cc3598db444d1c425f'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='10722cbc9dc400aaedcc0e4dc01b1f03cbaefd6bd1e937da0532a9cfd3e9a9eb'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='ce05a80bf7615c27112a60997ad4acc92772440b06eba7128421ae967782ee75'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jdk/ubuntu/generate_openj9_scc.sh b/8/jdk/ubuntu/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jdk/ubuntu/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full b/8/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full index e67beeba1..65cbb9598 100644 --- a/8/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full +++ b/8/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk8u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (c1cf15c3cda882b91b9abbf1d38455f02f6954d21e33d066cba6b7bd6bcaec2e) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'c1cf15c3cda882b91b9abbf1d38455f02f6954d21e33d066cba6b7bd6bcaec2e') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (04742baa30116a6c2fc1204ded7c00cf1092e29ba957f8cc9c8dceaa5e7abc38) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '04742baa30116a6c2fc1204ded7c00cf1092e29ba957f8cc9c8dceaa5e7abc38') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim b/8/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim index eb0b19297..7893217a2 100644 --- a/8/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim +++ b/8/jdk/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk8u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (c1cf15c3cda882b91b9abbf1d38455f02f6954d21e33d066cba6b7bd6bcaec2e) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'c1cf15c3cda882b91b9abbf1d38455f02f6954d21e33d066cba6b7bd6bcaec2e') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (04742baa30116a6c2fc1204ded7c00cf1092e29ba957f8cc9c8dceaa5e7abc38) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '04742baa30116a6c2fc1204ded7c00cf1092e29ba957f8cc9c8dceaa5e7abc38') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full b/8/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full index feb61d2ae..4c2ce50d6 100644 --- a/8/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full +++ b/8/jdk/windows/nanoserver-1809/Dockerfile.hotspot.releases.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] diff --git a/8/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.full b/8/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.full index 84d5347dc..dcc517c33 100644 --- a/8/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.full +++ b/8/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk8u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (c74c9148cc20050d710850b5a944f51e63ef7882b3a474a626ffa23c9a3b9a5a) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'c74c9148cc20050d710850b5a944f51e63ef7882b3a474a626ffa23c9a3b9a5a') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (53b7822937b18dc6af440dbd34e926acfef4141ded4db8655262457b5873e8a8) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '53b7822937b18dc6af440dbd34e926acfef4141ded4db8655262457b5873e8a8') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim b/8/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim index fc4a85628..fbd1afcbe 100644 --- a/8/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim +++ b/8/jdk/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk8u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (c74c9148cc20050d710850b5a944f51e63ef7882b3a474a626ffa23c9a3b9a5a) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'c74c9148cc20050d710850b5a944f51e63ef7882b3a474a626ffa23c9a3b9a5a') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (53b7822937b18dc6af440dbd34e926acfef4141ded4db8655262457b5873e8a8) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '53b7822937b18dc6af440dbd34e926acfef4141ded4db8655262457b5873e8a8') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full b/8/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full index a5605633d..a554a4389 100644 --- a/8/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full +++ b/8/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk8u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (c1cf15c3cda882b91b9abbf1d38455f02f6954d21e33d066cba6b7bd6bcaec2e) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'c1cf15c3cda882b91b9abbf1d38455f02f6954d21e33d066cba6b7bd6bcaec2e') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (04742baa30116a6c2fc1204ded7c00cf1092e29ba957f8cc9c8dceaa5e7abc38) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '04742baa30116a6c2fc1204ded7c00cf1092e29ba957f8cc9c8dceaa5e7abc38') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim b/8/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim index c71ac7d87..4b4f19bcb 100644 --- a/8/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim +++ b/8/jdk/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk8u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (c1cf15c3cda882b91b9abbf1d38455f02f6954d21e33d066cba6b7bd6bcaec2e) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'c1cf15c3cda882b91b9abbf1d38455f02f6954d21e33d066cba6b7bd6bcaec2e') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (04742baa30116a6c2fc1204ded7c00cf1092e29ba957f8cc9c8dceaa5e7abc38) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '04742baa30116a6c2fc1204ded7c00cf1092e29ba957f8cc9c8dceaa5e7abc38') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.full b/8/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.full index 66bf62fbb..1a0bdbc68 100644 --- a/8/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.full +++ b/8/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk8u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (c74c9148cc20050d710850b5a944f51e63ef7882b3a474a626ffa23c9a3b9a5a) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'c74c9148cc20050d710850b5a944f51e63ef7882b3a474a626ffa23c9a3b9a5a') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (53b7822937b18dc6af440dbd34e926acfef4141ded4db8655262457b5873e8a8) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '53b7822937b18dc6af440dbd34e926acfef4141ded4db8655262457b5873e8a8') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim b/8/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim index c69822404..520b2eb21 100644 --- a/8/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim +++ b/8/jdk/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk8u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (c74c9148cc20050d710850b5a944f51e63ef7882b3a474a626ffa23c9a3b9a5a) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'c74c9148cc20050d710850b5a944f51e63ef7882b3a474a626ffa23c9a3b9a5a') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (53b7822937b18dc6af440dbd34e926acfef4141ded4db8655262457b5873e8a8) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '53b7822937b18dc6af440dbd34e926acfef4141ded4db8655262457b5873e8a8') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full b/8/jdk/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full index 78080127f..3188b51d6 100644 --- a/8/jdk/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full +++ b/8/jdk/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (a5cd3635933925c7604abdcf22433d8fc408f094e5bef8196e1267e63233c51e) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'a5cd3635933925c7604abdcf22433d8fc408f094e5bef8196e1267e63233c51e') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (9c2e6482a7b0132adcd16984aceec1a8d5998612b5935ee4d66974a4b98abd69) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9c2e6482a7b0132adcd16984aceec1a8d5998612b5935ee4d66974a4b98abd69') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full b/8/jdk/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full index a4686339b..16e1d762a 100644 --- a/8/jdk/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full +++ b/8/jdk/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (966b1065685249a9258abc4be5121e3c0289976dd66efe21552ba86bcbf28aa7) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '966b1065685249a9258abc4be5121e3c0289976dd66efe21552ba86bcbf28aa7') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (03ab4fd97a3645eefad836edccb2267a311ddd1240734f5e8102727ba04ad747) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '03ab4fd97a3645eefad836edccb2267a311ddd1240734f5e8102727ba04ad747') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full b/8/jdk/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full index 0a31eef26..09a8083ed 100644 --- a/8/jdk/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full +++ b/8/jdk/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (a5cd3635933925c7604abdcf22433d8fc408f094e5bef8196e1267e63233c51e) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'a5cd3635933925c7604abdcf22433d8fc408f094e5bef8196e1267e63233c51e') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (9c2e6482a7b0132adcd16984aceec1a8d5998612b5935ee4d66974a4b98abd69) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9c2e6482a7b0132adcd16984aceec1a8d5998612b5935ee4d66974a4b98abd69') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full b/8/jdk/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full index e63250aaa..0602aecb4 100644 --- a/8/jdk/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full +++ b/8/jdk/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (966b1065685249a9258abc4be5121e3c0289976dd66efe21552ba86bcbf28aa7) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '966b1065685249a9258abc4be5121e3c0289976dd66efe21552ba86bcbf28aa7') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (03ab4fd97a3645eefad836edccb2267a311ddd1240734f5e8102727ba04ad747) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '03ab4fd97a3645eefad836edccb2267a311ddd1240734f5e8102727ba04ad747') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full b/8/jdk/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full index 9290629c3..0fbd4f47b 100644 --- a/8/jdk/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full +++ b/8/jdk/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (a5cd3635933925c7604abdcf22433d8fc408f094e5bef8196e1267e63233c51e) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'a5cd3635933925c7604abdcf22433d8fc408f094e5bef8196e1267e63233c51e') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (9c2e6482a7b0132adcd16984aceec1a8d5998612b5935ee4d66974a4b98abd69) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9c2e6482a7b0132adcd16984aceec1a8d5998612b5935ee4d66974a4b98abd69') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full b/8/jdk/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full index b182e4835..fd1afb55c 100644 --- a/8/jdk/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full +++ b/8/jdk/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (966b1065685249a9258abc4be5121e3c0289976dd66efe21552ba86bcbf28aa7) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '966b1065685249a9258abc4be5121e3c0289976dd66efe21552ba86bcbf28aa7') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (03ab4fd97a3645eefad836edccb2267a311ddd1240734f5e8102727ba04ad747) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '03ab4fd97a3645eefad836edccb2267a311ddd1240734f5e8102727ba04ad747') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full b/8/jdk/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full index 8016fab1c..ea3d45720 100644 --- a/8/jdk/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full +++ b/8/jdk/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (a5cd3635933925c7604abdcf22433d8fc408f094e5bef8196e1267e63233c51e) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'a5cd3635933925c7604abdcf22433d8fc408f094e5bef8196e1267e63233c51e') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_hotspot_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (9c2e6482a7b0132adcd16984aceec1a8d5998612b5935ee4d66974a4b98abd69) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '9c2e6482a7b0132adcd16984aceec1a8d5998612b5935ee4d66974a4b98abd69') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jdk/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full b/8/jdk/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full index 73db7a9b8..b4fbb681e 100644 --- a/8/jdk/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full +++ b/8/jdk/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jdk_x64_windows_openj9_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (966b1065685249a9258abc4be5121e3c0289976dd66efe21552ba86bcbf28aa7) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '966b1065685249a9258abc4be5121e3c0289976dd66efe21552ba86bcbf28aa7') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jdk_x64_windows_openj9_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (03ab4fd97a3645eefad836edccb2267a311ddd1240734f5e8102727ba04ad747) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '03ab4fd97a3645eefad836edccb2267a311ddd1240734f5e8102727ba04ad747') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/alpine/Dockerfile.hotspot.nightly.full b/8/jre/alpine/Dockerfile.hotspot.nightly.full index cc02427be..8fc2d7570 100644 --- a/8/jre/alpine/Dockerfile.hotspot.nightly.full +++ b/8/jre/alpine/Dockerfile.hotspot.nightly.full @@ -61,24 +61,24 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='cff58fa716ed9906dc637b1c5b73e5b6dbb3cbf4852cb493d3a7fc006b635df1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='3be157b52846fbb9715a553559e2015991a011689f0827615988c5e3c65539bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='cd6ad218b9e441a9b52e33b230e01e2a22719479de2b04f6e6b8d71e9041387b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='804382633f9c00736ea94960f66ba876a07985f8f9973cfc422d57d982d037bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5c8cdbc8acd7db44a84a027e6709ae63d07854c3715a775cc4c4b82f0fae166e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='6a52a1a6c828655c9c6162fe82c48264863489ff1c7c227ef0e72c59872a8b17'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='7066faca08c8a524758708e2ceda06fed7ac1f24482e168e86bafb986152a90f'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='d3ac503500f57b35f3174d4395797cd79dadeb6728e111960e199e9702ae57b3'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='117fbc4793c614d15245183cef5515fdae0ff2eed0135873531daa6051baa96e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='49daadad4bbdfda1b25349dbc2cf04ef69e1701ca3f45813c0c22b18620fe791'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/alpine/Dockerfile.openj9.nightly.full b/8/jre/alpine/Dockerfile.openj9.nightly.full index 5721d97a8..b559e254a 100644 --- a/8/jre/alpine/Dockerfile.openj9.nightly.full +++ b/8/jre/alpine/Dockerfile.openj9.nightly.full @@ -61,20 +61,20 @@ RUN set -eux; \ ARCH="$(apk --print-arch)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ed581c453c8fce65ad21c441aa3bd96b428b33ba6dae060d53d6bb35cd25a161'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='613645323808126e002d006f566103e311eb2e66fc4e1023ec6e0d1936df5edb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='ca0e48651b47d2fd8c52150bbc67a67fdb685b5ff91f28496aeded6d3bf6e32a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='2702892c44eace8fa75fded3285f376692469e1bb925b4233cdc0a1c3d34eb4b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='5920f72d4103133e686020c2d9199eb74e7eb2568f3392b4803f21b408448b33'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='08022e17bcd1ce6605ca5560f7f2a29662881a5c0d3a5f4e9ae8a08bd1a8650a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='c59aed8ef1b440d55578d9f0417bb18669cdde5148d631b4ee3286545126a2db'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='6ff86a79c06380fc1d491b72a8bfdac556c0bccaabdc263fea227fe84927b56a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/alpine/generate_openj9_scc.sh b/8/jre/alpine/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jre/alpine/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jre/centos/Dockerfile.hotspot.nightly.full b/8/jre/centos/Dockerfile.hotspot.nightly.full index 03c115b22..53d78065e 100644 --- a/8/jre/centos/Dockerfile.hotspot.nightly.full +++ b/8/jre/centos/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='cff58fa716ed9906dc637b1c5b73e5b6dbb3cbf4852cb493d3a7fc006b635df1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='3be157b52846fbb9715a553559e2015991a011689f0827615988c5e3c65539bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='cd6ad218b9e441a9b52e33b230e01e2a22719479de2b04f6e6b8d71e9041387b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='804382633f9c00736ea94960f66ba876a07985f8f9973cfc422d57d982d037bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5c8cdbc8acd7db44a84a027e6709ae63d07854c3715a775cc4c4b82f0fae166e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='6a52a1a6c828655c9c6162fe82c48264863489ff1c7c227ef0e72c59872a8b17'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='7066faca08c8a524758708e2ceda06fed7ac1f24482e168e86bafb986152a90f'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='d3ac503500f57b35f3174d4395797cd79dadeb6728e111960e199e9702ae57b3'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='117fbc4793c614d15245183cef5515fdae0ff2eed0135873531daa6051baa96e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='49daadad4bbdfda1b25349dbc2cf04ef69e1701ca3f45813c0c22b18620fe791'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/centos/Dockerfile.openj9.nightly.full b/8/jre/centos/Dockerfile.openj9.nightly.full index 9be209e15..16429a4a4 100644 --- a/8/jre/centos/Dockerfile.openj9.nightly.full +++ b/8/jre/centos/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ed581c453c8fce65ad21c441aa3bd96b428b33ba6dae060d53d6bb35cd25a161'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='613645323808126e002d006f566103e311eb2e66fc4e1023ec6e0d1936df5edb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='ca0e48651b47d2fd8c52150bbc67a67fdb685b5ff91f28496aeded6d3bf6e32a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='2702892c44eace8fa75fded3285f376692469e1bb925b4233cdc0a1c3d34eb4b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='5920f72d4103133e686020c2d9199eb74e7eb2568f3392b4803f21b408448b33'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='08022e17bcd1ce6605ca5560f7f2a29662881a5c0d3a5f4e9ae8a08bd1a8650a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='c59aed8ef1b440d55578d9f0417bb18669cdde5148d631b4ee3286545126a2db'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='6ff86a79c06380fc1d491b72a8bfdac556c0bccaabdc263fea227fe84927b56a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/centos/generate_openj9_scc.sh b/8/jre/centos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jre/centos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jre/clefos/Dockerfile.hotspot.nightly.full b/8/jre/clefos/Dockerfile.hotspot.nightly.full index 76ee8879b..912305fb8 100644 --- a/8/jre/clefos/Dockerfile.hotspot.nightly.full +++ b/8/jre/clefos/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='cff58fa716ed9906dc637b1c5b73e5b6dbb3cbf4852cb493d3a7fc006b635df1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='3be157b52846fbb9715a553559e2015991a011689f0827615988c5e3c65539bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='cd6ad218b9e441a9b52e33b230e01e2a22719479de2b04f6e6b8d71e9041387b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='804382633f9c00736ea94960f66ba876a07985f8f9973cfc422d57d982d037bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5c8cdbc8acd7db44a84a027e6709ae63d07854c3715a775cc4c4b82f0fae166e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='6a52a1a6c828655c9c6162fe82c48264863489ff1c7c227ef0e72c59872a8b17'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='7066faca08c8a524758708e2ceda06fed7ac1f24482e168e86bafb986152a90f'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='d3ac503500f57b35f3174d4395797cd79dadeb6728e111960e199e9702ae57b3'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='117fbc4793c614d15245183cef5515fdae0ff2eed0135873531daa6051baa96e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='49daadad4bbdfda1b25349dbc2cf04ef69e1701ca3f45813c0c22b18620fe791'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/clefos/Dockerfile.openj9.nightly.full b/8/jre/clefos/Dockerfile.openj9.nightly.full index 8032cd0e4..2bd28b70b 100644 --- a/8/jre/clefos/Dockerfile.openj9.nightly.full +++ b/8/jre/clefos/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ed581c453c8fce65ad21c441aa3bd96b428b33ba6dae060d53d6bb35cd25a161'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='613645323808126e002d006f566103e311eb2e66fc4e1023ec6e0d1936df5edb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='ca0e48651b47d2fd8c52150bbc67a67fdb685b5ff91f28496aeded6d3bf6e32a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='2702892c44eace8fa75fded3285f376692469e1bb925b4233cdc0a1c3d34eb4b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='5920f72d4103133e686020c2d9199eb74e7eb2568f3392b4803f21b408448b33'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='08022e17bcd1ce6605ca5560f7f2a29662881a5c0d3a5f4e9ae8a08bd1a8650a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='c59aed8ef1b440d55578d9f0417bb18669cdde5148d631b4ee3286545126a2db'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='6ff86a79c06380fc1d491b72a8bfdac556c0bccaabdc263fea227fe84927b56a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/clefos/generate_openj9_scc.sh b/8/jre/clefos/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jre/clefos/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jre/debian/Dockerfile.hotspot.nightly.full b/8/jre/debian/Dockerfile.hotspot.nightly.full index 1e706f549..7c6321d4e 100644 --- a/8/jre/debian/Dockerfile.hotspot.nightly.full +++ b/8/jre/debian/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='cff58fa716ed9906dc637b1c5b73e5b6dbb3cbf4852cb493d3a7fc006b635df1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='3be157b52846fbb9715a553559e2015991a011689f0827615988c5e3c65539bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='cd6ad218b9e441a9b52e33b230e01e2a22719479de2b04f6e6b8d71e9041387b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='804382633f9c00736ea94960f66ba876a07985f8f9973cfc422d57d982d037bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5c8cdbc8acd7db44a84a027e6709ae63d07854c3715a775cc4c4b82f0fae166e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='6a52a1a6c828655c9c6162fe82c48264863489ff1c7c227ef0e72c59872a8b17'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='7066faca08c8a524758708e2ceda06fed7ac1f24482e168e86bafb986152a90f'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='d3ac503500f57b35f3174d4395797cd79dadeb6728e111960e199e9702ae57b3'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='117fbc4793c614d15245183cef5515fdae0ff2eed0135873531daa6051baa96e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='49daadad4bbdfda1b25349dbc2cf04ef69e1701ca3f45813c0c22b18620fe791'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/debian/Dockerfile.openj9.nightly.full b/8/jre/debian/Dockerfile.openj9.nightly.full index cb6c157be..3a739a86a 100644 --- a/8/jre/debian/Dockerfile.openj9.nightly.full +++ b/8/jre/debian/Dockerfile.openj9.nightly.full @@ -33,20 +33,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ed581c453c8fce65ad21c441aa3bd96b428b33ba6dae060d53d6bb35cd25a161'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='613645323808126e002d006f566103e311eb2e66fc4e1023ec6e0d1936df5edb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='ca0e48651b47d2fd8c52150bbc67a67fdb685b5ff91f28496aeded6d3bf6e32a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='2702892c44eace8fa75fded3285f376692469e1bb925b4233cdc0a1c3d34eb4b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='5920f72d4103133e686020c2d9199eb74e7eb2568f3392b4803f21b408448b33'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='08022e17bcd1ce6605ca5560f7f2a29662881a5c0d3a5f4e9ae8a08bd1a8650a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='c59aed8ef1b440d55578d9f0417bb18669cdde5148d631b4ee3286545126a2db'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='6ff86a79c06380fc1d491b72a8bfdac556c0bccaabdc263fea227fe84927b56a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/debian/generate_openj9_scc.sh b/8/jre/debian/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jre/debian/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jre/debianslim/Dockerfile.hotspot.nightly.full b/8/jre/debianslim/Dockerfile.hotspot.nightly.full index 3fb6889fd..f70c6d296 100644 --- a/8/jre/debianslim/Dockerfile.hotspot.nightly.full +++ b/8/jre/debianslim/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='cff58fa716ed9906dc637b1c5b73e5b6dbb3cbf4852cb493d3a7fc006b635df1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='3be157b52846fbb9715a553559e2015991a011689f0827615988c5e3c65539bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='cd6ad218b9e441a9b52e33b230e01e2a22719479de2b04f6e6b8d71e9041387b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='804382633f9c00736ea94960f66ba876a07985f8f9973cfc422d57d982d037bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5c8cdbc8acd7db44a84a027e6709ae63d07854c3715a775cc4c4b82f0fae166e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='6a52a1a6c828655c9c6162fe82c48264863489ff1c7c227ef0e72c59872a8b17'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='7066faca08c8a524758708e2ceda06fed7ac1f24482e168e86bafb986152a90f'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='d3ac503500f57b35f3174d4395797cd79dadeb6728e111960e199e9702ae57b3'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='117fbc4793c614d15245183cef5515fdae0ff2eed0135873531daa6051baa96e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='49daadad4bbdfda1b25349dbc2cf04ef69e1701ca3f45813c0c22b18620fe791'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/debianslim/Dockerfile.openj9.nightly.full b/8/jre/debianslim/Dockerfile.openj9.nightly.full index 7f6a1fafc..7fd09bfa2 100644 --- a/8/jre/debianslim/Dockerfile.openj9.nightly.full +++ b/8/jre/debianslim/Dockerfile.openj9.nightly.full @@ -33,20 +33,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ed581c453c8fce65ad21c441aa3bd96b428b33ba6dae060d53d6bb35cd25a161'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='613645323808126e002d006f566103e311eb2e66fc4e1023ec6e0d1936df5edb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='ca0e48651b47d2fd8c52150bbc67a67fdb685b5ff91f28496aeded6d3bf6e32a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='2702892c44eace8fa75fded3285f376692469e1bb925b4233cdc0a1c3d34eb4b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='5920f72d4103133e686020c2d9199eb74e7eb2568f3392b4803f21b408448b33'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='08022e17bcd1ce6605ca5560f7f2a29662881a5c0d3a5f4e9ae8a08bd1a8650a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='c59aed8ef1b440d55578d9f0417bb18669cdde5148d631b4ee3286545126a2db'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='6ff86a79c06380fc1d491b72a8bfdac556c0bccaabdc263fea227fe84927b56a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/debianslim/generate_openj9_scc.sh b/8/jre/debianslim/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jre/debianslim/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jre/leap/Dockerfile.hotspot.nightly.full b/8/jre/leap/Dockerfile.hotspot.nightly.full index bad103a5b..2ec8eae64 100644 --- a/8/jre/leap/Dockerfile.hotspot.nightly.full +++ b/8/jre/leap/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='cff58fa716ed9906dc637b1c5b73e5b6dbb3cbf4852cb493d3a7fc006b635df1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='3be157b52846fbb9715a553559e2015991a011689f0827615988c5e3c65539bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='cd6ad218b9e441a9b52e33b230e01e2a22719479de2b04f6e6b8d71e9041387b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='804382633f9c00736ea94960f66ba876a07985f8f9973cfc422d57d982d037bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5c8cdbc8acd7db44a84a027e6709ae63d07854c3715a775cc4c4b82f0fae166e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='6a52a1a6c828655c9c6162fe82c48264863489ff1c7c227ef0e72c59872a8b17'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='7066faca08c8a524758708e2ceda06fed7ac1f24482e168e86bafb986152a90f'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='d3ac503500f57b35f3174d4395797cd79dadeb6728e111960e199e9702ae57b3'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='117fbc4793c614d15245183cef5515fdae0ff2eed0135873531daa6051baa96e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='49daadad4bbdfda1b25349dbc2cf04ef69e1701ca3f45813c0c22b18620fe791'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/leap/Dockerfile.openj9.nightly.full b/8/jre/leap/Dockerfile.openj9.nightly.full index c2ea801f0..1530d8450 100644 --- a/8/jre/leap/Dockerfile.openj9.nightly.full +++ b/8/jre/leap/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ed581c453c8fce65ad21c441aa3bd96b428b33ba6dae060d53d6bb35cd25a161'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='613645323808126e002d006f566103e311eb2e66fc4e1023ec6e0d1936df5edb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='ca0e48651b47d2fd8c52150bbc67a67fdb685b5ff91f28496aeded6d3bf6e32a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='2702892c44eace8fa75fded3285f376692469e1bb925b4233cdc0a1c3d34eb4b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='5920f72d4103133e686020c2d9199eb74e7eb2568f3392b4803f21b408448b33'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='08022e17bcd1ce6605ca5560f7f2a29662881a5c0d3a5f4e9ae8a08bd1a8650a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='c59aed8ef1b440d55578d9f0417bb18669cdde5148d631b4ee3286545126a2db'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='6ff86a79c06380fc1d491b72a8bfdac556c0bccaabdc263fea227fe84927b56a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/leap/generate_openj9_scc.sh b/8/jre/leap/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jre/leap/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jre/tumbleweed/Dockerfile.hotspot.nightly.full b/8/jre/tumbleweed/Dockerfile.hotspot.nightly.full index de1bc3ef7..6e4b535f6 100644 --- a/8/jre/tumbleweed/Dockerfile.hotspot.nightly.full +++ b/8/jre/tumbleweed/Dockerfile.hotspot.nightly.full @@ -30,24 +30,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='cff58fa716ed9906dc637b1c5b73e5b6dbb3cbf4852cb493d3a7fc006b635df1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='3be157b52846fbb9715a553559e2015991a011689f0827615988c5e3c65539bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='cd6ad218b9e441a9b52e33b230e01e2a22719479de2b04f6e6b8d71e9041387b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='804382633f9c00736ea94960f66ba876a07985f8f9973cfc422d57d982d037bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5c8cdbc8acd7db44a84a027e6709ae63d07854c3715a775cc4c4b82f0fae166e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='6a52a1a6c828655c9c6162fe82c48264863489ff1c7c227ef0e72c59872a8b17'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='7066faca08c8a524758708e2ceda06fed7ac1f24482e168e86bafb986152a90f'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='d3ac503500f57b35f3174d4395797cd79dadeb6728e111960e199e9702ae57b3'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='117fbc4793c614d15245183cef5515fdae0ff2eed0135873531daa6051baa96e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='49daadad4bbdfda1b25349dbc2cf04ef69e1701ca3f45813c0c22b18620fe791'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/tumbleweed/Dockerfile.openj9.nightly.full b/8/jre/tumbleweed/Dockerfile.openj9.nightly.full index ec086bae7..11cfe429e 100644 --- a/8/jre/tumbleweed/Dockerfile.openj9.nightly.full +++ b/8/jre/tumbleweed/Dockerfile.openj9.nightly.full @@ -30,20 +30,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ed581c453c8fce65ad21c441aa3bd96b428b33ba6dae060d53d6bb35cd25a161'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='613645323808126e002d006f566103e311eb2e66fc4e1023ec6e0d1936df5edb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='ca0e48651b47d2fd8c52150bbc67a67fdb685b5ff91f28496aeded6d3bf6e32a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='2702892c44eace8fa75fded3285f376692469e1bb925b4233cdc0a1c3d34eb4b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='5920f72d4103133e686020c2d9199eb74e7eb2568f3392b4803f21b408448b33'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='08022e17bcd1ce6605ca5560f7f2a29662881a5c0d3a5f4e9ae8a08bd1a8650a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='c59aed8ef1b440d55578d9f0417bb18669cdde5148d631b4ee3286545126a2db'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='6ff86a79c06380fc1d491b72a8bfdac556c0bccaabdc263fea227fe84927b56a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/tumbleweed/generate_openj9_scc.sh b/8/jre/tumbleweed/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jre/tumbleweed/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jre/ubi-minimal/Dockerfile.hotspot.nightly.full b/8/jre/ubi-minimal/Dockerfile.hotspot.nightly.full index 44afaace1..47b77f3c2 100644 --- a/8/jre/ubi-minimal/Dockerfile.hotspot.nightly.full +++ b/8/jre/ubi-minimal/Dockerfile.hotspot.nightly.full @@ -38,24 +38,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='cff58fa716ed9906dc637b1c5b73e5b6dbb3cbf4852cb493d3a7fc006b635df1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='3be157b52846fbb9715a553559e2015991a011689f0827615988c5e3c65539bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='cd6ad218b9e441a9b52e33b230e01e2a22719479de2b04f6e6b8d71e9041387b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='804382633f9c00736ea94960f66ba876a07985f8f9973cfc422d57d982d037bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5c8cdbc8acd7db44a84a027e6709ae63d07854c3715a775cc4c4b82f0fae166e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='6a52a1a6c828655c9c6162fe82c48264863489ff1c7c227ef0e72c59872a8b17'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='7066faca08c8a524758708e2ceda06fed7ac1f24482e168e86bafb986152a90f'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='d3ac503500f57b35f3174d4395797cd79dadeb6728e111960e199e9702ae57b3'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='117fbc4793c614d15245183cef5515fdae0ff2eed0135873531daa6051baa96e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='49daadad4bbdfda1b25349dbc2cf04ef69e1701ca3f45813c0c22b18620fe791'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/ubi-minimal/Dockerfile.openj9.nightly.full b/8/jre/ubi-minimal/Dockerfile.openj9.nightly.full index 7f3490418..b20d40f88 100644 --- a/8/jre/ubi-minimal/Dockerfile.openj9.nightly.full +++ b/8/jre/ubi-minimal/Dockerfile.openj9.nightly.full @@ -38,20 +38,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ed581c453c8fce65ad21c441aa3bd96b428b33ba6dae060d53d6bb35cd25a161'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='613645323808126e002d006f566103e311eb2e66fc4e1023ec6e0d1936df5edb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='ca0e48651b47d2fd8c52150bbc67a67fdb685b5ff91f28496aeded6d3bf6e32a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='2702892c44eace8fa75fded3285f376692469e1bb925b4233cdc0a1c3d34eb4b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='5920f72d4103133e686020c2d9199eb74e7eb2568f3392b4803f21b408448b33'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='08022e17bcd1ce6605ca5560f7f2a29662881a5c0d3a5f4e9ae8a08bd1a8650a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='c59aed8ef1b440d55578d9f0417bb18669cdde5148d631b4ee3286545126a2db'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='6ff86a79c06380fc1d491b72a8bfdac556c0bccaabdc263fea227fe84927b56a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/ubi-minimal/generate_openj9_scc.sh b/8/jre/ubi-minimal/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jre/ubi-minimal/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jre/ubi/Dockerfile.hotspot.nightly.full b/8/jre/ubi/Dockerfile.hotspot.nightly.full index 74814c5e2..7f46324cf 100644 --- a/8/jre/ubi/Dockerfile.hotspot.nightly.full +++ b/8/jre/ubi/Dockerfile.hotspot.nightly.full @@ -38,24 +38,24 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='cff58fa716ed9906dc637b1c5b73e5b6dbb3cbf4852cb493d3a7fc006b635df1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='3be157b52846fbb9715a553559e2015991a011689f0827615988c5e3c65539bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='cd6ad218b9e441a9b52e33b230e01e2a22719479de2b04f6e6b8d71e9041387b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='804382633f9c00736ea94960f66ba876a07985f8f9973cfc422d57d982d037bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5c8cdbc8acd7db44a84a027e6709ae63d07854c3715a775cc4c4b82f0fae166e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='6a52a1a6c828655c9c6162fe82c48264863489ff1c7c227ef0e72c59872a8b17'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='7066faca08c8a524758708e2ceda06fed7ac1f24482e168e86bafb986152a90f'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='d3ac503500f57b35f3174d4395797cd79dadeb6728e111960e199e9702ae57b3'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='117fbc4793c614d15245183cef5515fdae0ff2eed0135873531daa6051baa96e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='49daadad4bbdfda1b25349dbc2cf04ef69e1701ca3f45813c0c22b18620fe791'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/ubi/Dockerfile.openj9.nightly.full b/8/jre/ubi/Dockerfile.openj9.nightly.full index a9df72fa0..710d1c448 100644 --- a/8/jre/ubi/Dockerfile.openj9.nightly.full +++ b/8/jre/ubi/Dockerfile.openj9.nightly.full @@ -38,20 +38,20 @@ RUN set -eux; \ ARCH="$(uname -m)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ed581c453c8fce65ad21c441aa3bd96b428b33ba6dae060d53d6bb35cd25a161'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='613645323808126e002d006f566103e311eb2e66fc4e1023ec6e0d1936df5edb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='ca0e48651b47d2fd8c52150bbc67a67fdb685b5ff91f28496aeded6d3bf6e32a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='2702892c44eace8fa75fded3285f376692469e1bb925b4233cdc0a1c3d34eb4b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='5920f72d4103133e686020c2d9199eb74e7eb2568f3392b4803f21b408448b33'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='08022e17bcd1ce6605ca5560f7f2a29662881a5c0d3a5f4e9ae8a08bd1a8650a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='c59aed8ef1b440d55578d9f0417bb18669cdde5148d631b4ee3286545126a2db'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='6ff86a79c06380fc1d491b72a8bfdac556c0bccaabdc263fea227fe84927b56a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/ubi/generate_openj9_scc.sh b/8/jre/ubi/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jre/ubi/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jre/ubuntu/Dockerfile.hotspot.nightly.full b/8/jre/ubuntu/Dockerfile.hotspot.nightly.full index bf8251fe5..9411e20c2 100644 --- a/8/jre/ubuntu/Dockerfile.hotspot.nightly.full +++ b/8/jre/ubuntu/Dockerfile.hotspot.nightly.full @@ -33,24 +33,24 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='cff58fa716ed9906dc637b1c5b73e5b6dbb3cbf4852cb493d3a7fc006b635df1'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='3be157b52846fbb9715a553559e2015991a011689f0827615988c5e3c65539bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ armhf|armv7l) \ - ESUM='cd6ad218b9e441a9b52e33b230e01e2a22719479de2b04f6e6b8d71e9041387b'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_arm_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='804382633f9c00736ea94960f66ba876a07985f8f9973cfc422d57d982d037bf'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_arm_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='5c8cdbc8acd7db44a84a027e6709ae63d07854c3715a775cc4c4b82f0fae166e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='6a52a1a6c828655c9c6162fe82c48264863489ff1c7c227ef0e72c59872a8b17'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='7066faca08c8a524758708e2ceda06fed7ac1f24482e168e86bafb986152a90f'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='d3ac503500f57b35f3174d4395797cd79dadeb6728e111960e199e9702ae57b3'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='117fbc4793c614d15245183cef5515fdae0ff2eed0135873531daa6051baa96e'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_hotspot_2020-09-18-03-55.tar.gz'; \ + ESUM='49daadad4bbdfda1b25349dbc2cf04ef69e1701ca3f45813c0c22b18620fe791'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_hotspot_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/ubuntu/Dockerfile.openj9.nightly.full b/8/jre/ubuntu/Dockerfile.openj9.nightly.full index badba4289..2073e9bc3 100644 --- a/8/jre/ubuntu/Dockerfile.openj9.nightly.full +++ b/8/jre/ubuntu/Dockerfile.openj9.nightly.full @@ -33,20 +33,20 @@ RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ aarch64|arm64) \ - ESUM='ed581c453c8fce65ad21c441aa3bd96b428b33ba6dae060d53d6bb35cd25a161'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='613645323808126e002d006f566103e311eb2e66fc4e1023ec6e0d1936df5edb'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_aarch64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ ppc64el|ppc64le) \ - ESUM='ca0e48651b47d2fd8c52150bbc67a67fdb685b5ff91f28496aeded6d3bf6e32a'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='2702892c44eace8fa75fded3285f376692469e1bb925b4233cdc0a1c3d34eb4b'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_ppc64le_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ s390x) \ - ESUM='5920f72d4103133e686020c2d9199eb74e7eb2568f3392b4803f21b408448b33'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_s390x_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='08022e17bcd1ce6605ca5560f7f2a29662881a5c0d3a5f4e9ae8a08bd1a8650a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_s390x_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ amd64|x86_64) \ - ESUM='c59aed8ef1b440d55578d9f0417bb18669cdde5148d631b4ee3286545126a2db'; \ - BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_linux_openj9_2020-09-18-03-55.tar.gz'; \ + ESUM='6ff86a79c06380fc1d491b72a8bfdac556c0bccaabdc263fea227fe84927b56a'; \ + BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_linux_openj9_2020-09-25-06-22.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/8/jre/ubuntu/generate_openj9_scc.sh b/8/jre/ubuntu/generate_openj9_scc.sh new file mode 100755 index 000000000..a5113ba1e --- /dev/null +++ b/8/jre/ubuntu/generate_openj9_scc.sh @@ -0,0 +1,318 @@ +#!/bin/bash +# +# 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. +# + +unset OPENJ9_JAVA_OPTIONS + +# Default size for SCC +SCC_SIZE="50m" + +# Runs for generating SCC +SCC_GEN_RUNS_COUNT=3 + +# is running on ubuntu or debian - package manager apt +IS_APT_ENV=false +# Intitialise default / allowed sample app status +RUN_ECLIPSE=false +RUN_TOMCAT=true + +# Intitialise default / required packages status +INSTALL_GTK=false +INSTALL_XVFB=false + +# App download locations +DOWNLOAD_PATH_ECLIPSE=/tmp/eclipse +DOWNLOAD_PATH_TOMCAT=/tmp/tomcat + +# App installation locations +INSTALL_PATH_ECLIPSE="${HOME}"/eclipse-home +INSTALL_PATH_TOMCAT="${HOME}"/tomcat-home + +# URL's for the artifacts +ECLIPSE_DWNLD_URL="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/2020-06/M3/eclipse-java-2020-06-M3-linux-gtk-x86_64.tar.gz" +TOMCAT_DWNLD_URL="https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.35/bin/apache-tomcat-9.0.35.tar.gz" + +# Check and downlaod eclipse +function check_to_download_eclipse() { + if [ "${RUN_ECLIPSE}" == true ]; then + # Creating a temporary directory for eclipse download + mkdir -p "${DOWNLOAD_PATH_ECLIPSE}" "${INSTALL_PATH_ECLIPSE}" + + # Downloading eclipse + if curl --fail -o "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz "${ECLIPSE_DWNLD_URL}"; then + # Extracting eclipse + tar -xvzf "${DOWNLOAD_PATH_ECLIPSE}"/eclipse.tar.gz -C "$INSTALL_PATH_ECLIPSE" --strip-components=1 + else + RUN_ECLIPSE=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_ECLIPSE}" + fi +} + +# Check and download tomcat +function check_to_download_tomcat() { + if [ "${RUN_TOMCAT}" == true ]; then + # Creating a temporary directory for tomcat download + mkdir -p "${DOWNLOAD_PATH_TOMCAT}" "${INSTALL_PATH_TOMCAT}" + + # Downloading tomcat + if curl --fail -o "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz "${TOMCAT_DWNLD_URL}"; then + # Extracting tomcat + tar -xvzf "${DOWNLOAD_PATH_TOMCAT}"/tomcat.tar.gz -C "${INSTALL_PATH_TOMCAT}" --strip-components=1 + else + RUN_TOMCAT=false + fi + + # Removing the tar file + rm -rf "${DOWNLOAD_PATH_TOMCAT}" + fi +} + +# ubuntu/debian install packages required for eclipse +function apt_install_packages() { + # update the repositories + apt update + + # Set non-interactive frontend (to avoid `tzdata` config options selection) + APT_INSTALL_CMD="DEBIAN_FRONTEND=noninteractive" + APT_INSTALL_CMD="${APT_INSTALL_CMD} apt install -y" + + if [ "${INSTALL_GTK}" == true ]; then + # install gtk+3.0 + APT_INSTALL_CMD="${APT_INSTALL_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # install xvfb + APT_INSTALL_CMD="${APT_INSTALL_CMD} xvfb" + fi + + eval "${APT_INSTALL_CMD}" +} + +# Check if any application needs virtual screen and launch it +function check_and_start_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Spawning a virtual screen for GUI apps + Xvfb :1 -ac -screen 0 1024x768x8 & + # Saving the PID + XVFB_PID=$! + # Saving older display value + OLD_DISPLAY=$DISPLAY + # Setting DISPLAY to created screen + export DISPLAY=:1 + fi +} + +# Kill the created virtual screen +function check_and_stop_xvfb() { + # check if `xvfb` installed + if [ "${INSTALL_XVFB}" == true ]; then + # Killing `xvfb` process to remove screen + kill -9 $XVFB_PID + # Setting back the DISPLAY to older value + export DISPLAY=$OLD_DISPLAY + fi +} + +# Run the applications for specified iterations +function run_apps() { + for ((i=0; i&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + java -Xshareclasses:name=dry_run_scc,cacheDir=/opt/java/.scc,destroy || true + + SCC_SIZE="${SCC_SIZE:0:-1}" + + SCC_SIZE=$(awk "BEGIN {print int($SCC_SIZE * $FULL / 100.0)}") + + [ "${SCC_SIZE}" -eq 0 ] && SCC_SIZE=1 + + SCC_SIZE="${SCC_SIZE}m" + + # Re-generating cache with new size + java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal,createLayer -Xscmx$SCC_SIZE -version + + unset OPENJ9_JAVA_OPTIONS +} + +# Generate SCC by running apps +function generate_scc() { + # Pointing cache for sample app runs + export OPENJ9_JAVA_OPTIONS="-Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,bootClassesOnly,nonFatal" + + # check if we need xvfb for running application and start a virtual screen if required + check_and_start_xvfb + + # Run the applications to generate SCC + run_apps + + # check if started a virtual screen and kill the process + check_and_stop_xvfb + + # Checking the cache level + FULL=$( (java -Xshareclasses:name=openj9_system_scc,cacheDir=/opt/java/.scc,printallStats || true) 2>&1 | awk '/^Cache is [0-9.]*% .*full/ {print substr($3, 1, length($3)-1)}') + + echo "SCC layer is $FULL% full." +} + +# Remove the downloaded sample apps +function remove_artifacts() { + # Command to remove apps + REMOVE_APPS="rm -rf" + + # check for eclipse + if [ "${RUN_ECLIPSE}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_ECLIPSE}" + fi + + # check for tomcat + if [ "${RUN_TOMCAT}" == true ]; then + REMOVE_APPS="${REMOVE_APPS} ${INSTALL_PATH_TOMCAT}" + fi + + eval "$REMOVE_APPS" +} + +# Run eclipse and stop it after the startup +function run_eclipse_and_stop() { + # Starting eclipse in background + "${INSTALL_PATH_ECLIPSE}"/eclipse/eclipse & + # Saving eclipse PID + ECLIPSE_PID=$! + # Waiting for eclipse to start - Sleeping for 1 minute + sleep 1m + # Killing eclipse process + kill -9 $ECLIPSE_PID + # Waiting for process to be killed - Sleeping for 10 seconds + sleep 10s +} + +# Run tomcat and stop it after the startup +function run_tomcat_and_stop() { + # Start tomcat wait till it comes up shut it down + "${INSTALL_PATH_TOMCAT}"/bin/startup.sh + # wait till tomcat starts - wait for 5 seconds + sleep 5 + # Stop tomcat + "${INSTALL_PATH_TOMCAT}"/bin/shutdown.sh + # wait till tomcat stops - wait for 5 seconds + sleep 5 +} + +# Remove the installed packages +function remove_packages() { + if [ "${IS_APT_ENV}" == true ]; then + APT_REMOVE_CMD="apt --purge -y autoremove" + + if [ "${INSTALL_GTK}" == true ]; then + # remove gtk+3.0 + APT_REMOVE_CMD="${APT_REMOVE_CMD} gtk+3.0" + fi + + if [ "${INSTALL_XVFB}" == true ]; then + # remove xvfb + APT_REMOVE_CMD="${APT_REMOVE_CMD} xvfb" + fi + + eval "${APT_REMOVE_CMD}" + fi +} + +# check for OS release file +if [ -f /etc/os-release ]; then + # load file to get the ID (OS name) + # shellcheck disable=SC1091 + source /etc/os-release + OS=$ID +fi + +# Check if OS is ubuntu/debian (we can run eclipse as packages required for it are available) +if [ "${OS}" == "ubuntu" ] || [ "${OS}" = "debian" ]; then + # set IS_APT_ENV true + IS_APT_ENV=true + + # Set eclipse run to `true` + RUN_ECLIPSE=true + + # Set the required packages for eclipse to `true` + INSTALL_GTK=true + INSTALL_XVFB=true + + # Call function `install_pkgs_via_apt` to install packages + install_packages +fi + +# Download the sample apps and install +download_and_install_artifacts + +# Dry run for SCC generation (To get exact size) +dry_run + +# Generate SCC +generate_scc + +# Remove installed artifacts +remove_artifacts + +# Remove packages +remove_packages diff --git a/8/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full b/8/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full index ce5e013e3..37c82475a 100644 --- a/8/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full +++ b/8/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk8u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (31a3dd147caf0eefff89f25cb496d0fe4c3f8d554905a5ca45486f79ccc9ad39) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '31a3dd147caf0eefff89f25cb496d0fe4c3f8d554905a5ca45486f79ccc9ad39') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (1db9939a6f42753c3252af1c2970c52c6398ef144d60108057dde1ac0ab84295) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '1db9939a6f42753c3252af1c2970c52c6398ef144d60108057dde1ac0ab84295') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim b/8/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim index 8a321019b..1c681855a 100644 --- a/8/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim +++ b/8/jre/windows/nanoserver-1809/Dockerfile.hotspot.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk8u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (31a3dd147caf0eefff89f25cb496d0fe4c3f8d554905a5ca45486f79ccc9ad39) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '31a3dd147caf0eefff89f25cb496d0fe4c3f8d554905a5ca45486f79ccc9ad39') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (1db9939a6f42753c3252af1c2970c52c6398ef144d60108057dde1ac0ab84295) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '1db9939a6f42753c3252af1c2970c52c6398ef144d60108057dde1ac0ab84295') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full b/8/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full index 6df375fdd..7074d1de5 100644 --- a/8/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full +++ b/8/jre/windows/nanoserver-1809/Dockerfile.hotspot.releases.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] diff --git a/8/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.full b/8/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.full index acf4be6c8..c49a6171f 100644 --- a/8/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.full +++ b/8/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk8u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (1900d3873a4b92257b954a2bd3686c0105c503c7e6d6d7a49cb5bd6e273b6ae9) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '1900d3873a4b92257b954a2bd3686c0105c503c7e6d6d7a49cb5bd6e273b6ae9') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (a6af92c3200cff42bee659274db847ba96711387e599a594c672cad3e3132a8c) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'a6af92c3200cff42bee659274db847ba96711387e599a594c672cad3e3132a8c') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim b/8/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim index b846ece26..4276da78a 100644 --- a/8/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim +++ b/8/jre/windows/nanoserver-1809/Dockerfile.openj9.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1809 +FROM mcr.microsoft.com/windows/nanoserver:1809 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk8u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (1900d3873a4b92257b954a2bd3686c0105c503c7e6d6d7a49cb5bd6e273b6ae9) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '1900d3873a4b92257b954a2bd3686c0105c503c7e6d6d7a49cb5bd6e273b6ae9') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (a6af92c3200cff42bee659274db847ba96711387e599a594c672cad3e3132a8c) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'a6af92c3200cff42bee659274db847ba96711387e599a594c672cad3e3132a8c') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full b/8/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full index 623689d39..3205bcaa8 100644 --- a/8/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full +++ b/8/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk8u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (31a3dd147caf0eefff89f25cb496d0fe4c3f8d554905a5ca45486f79ccc9ad39) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '31a3dd147caf0eefff89f25cb496d0fe4c3f8d554905a5ca45486f79ccc9ad39') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (1db9939a6f42753c3252af1c2970c52c6398ef144d60108057dde1ac0ab84295) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '1db9939a6f42753c3252af1c2970c52c6398ef144d60108057dde1ac0ab84295') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim b/8/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim index 998281514..7cb50e5b5 100644 --- a/8/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim +++ b/8/jre/windows/nanoserver-1909/Dockerfile.hotspot.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk8u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (31a3dd147caf0eefff89f25cb496d0fe4c3f8d554905a5ca45486f79ccc9ad39) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '31a3dd147caf0eefff89f25cb496d0fe4c3f8d554905a5ca45486f79ccc9ad39') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (1db9939a6f42753c3252af1c2970c52c6398ef144d60108057dde1ac0ab84295) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '1db9939a6f42753c3252af1c2970c52c6398ef144d60108057dde1ac0ab84295') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.full b/8/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.full index 52080b6ad..a6e75fae8 100644 --- a/8/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.full +++ b/8/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.full @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -25,11 +26,11 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference ENV JAVA_VERSION jdk8u USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (1900d3873a4b92257b954a2bd3686c0105c503c7e6d6d7a49cb5bd6e273b6ae9) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '1900d3873a4b92257b954a2bd3686c0105c503c7e6d6d7a49cb5bd6e273b6ae9') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (a6af92c3200cff42bee659274db847ba96711387e599a594c672cad3e3132a8c) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'a6af92c3200cff42bee659274db847ba96711387e599a594c672cad3e3132a8c') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim b/8/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim index b32a43d22..5d6d94616 100644 --- a/8/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim +++ b/8/jre/windows/nanoserver-1909/Dockerfile.openj9.nightly.slim @@ -17,7 +17,8 @@ # limitations under the License. # -FROM mcr.microsoft.com/powershell:nanoserver-1909 +FROM mcr.microsoft.com/windows/nanoserver:1909 + # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -27,11 +28,11 @@ ENV JAVA_VERSION jdk8u COPY slim-java* C:/ProgramData/Java/ USER ContainerAdministrator -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.zip ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.zip ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.zip -O 'openjdk.zip'; \ - Write-Host ('Verifying sha256 (1900d3873a4b92257b954a2bd3686c0105c503c7e6d6d7a49cb5bd6e273b6ae9) ...'); \ - if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne '1900d3873a4b92257b954a2bd3686c0105c503c7e6d6d7a49cb5bd6e273b6ae9') { \ + Invoke-WebRequest -Uri https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.zip -O 'openjdk.zip'; \ + Write-Host ('Verifying sha256 (a6af92c3200cff42bee659274db847ba96711387e599a594c672cad3e3132a8c) ...'); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne 'a6af92c3200cff42bee659274db847ba96711387e599a594c672cad3e3132a8c') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full b/8/jre/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full index 1c626d061..6aec72bec 100644 --- a/8/jre/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full +++ b/8/jre/windows/windowsservercore-1809/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (798d6c8ac0aa5a7a1940ca5345405ee0cec1891e7b4cad2ccd525af70e427da9) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '798d6c8ac0aa5a7a1940ca5345405ee0cec1891e7b4cad2ccd525af70e427da9') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (a1c85ec5a47beae1ec462dc83ccb3475715c6abbb74a2437f7d5021de27f17a1) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'a1c85ec5a47beae1ec462dc83ccb3475715c6abbb74a2437f7d5021de27f17a1') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full b/8/jre/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full index 619d5de22..a6ceee6bf 100644 --- a/8/jre/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full +++ b/8/jre/windows/windowsservercore-1809/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (19f1d51e57d23f6d1e7c43ce949a0fbba11917dcc721bea4605f28b7108ce691) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '19f1d51e57d23f6d1e7c43ce949a0fbba11917dcc721bea4605f28b7108ce691') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (42e952a7e05c9c0d0a54ae1fad1a43a758b6c103166c17335d6fb65604688ae7) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '42e952a7e05c9c0d0a54ae1fad1a43a758b6c103166c17335d6fb65604688ae7') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full b/8/jre/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full index 38e991181..b53e84b31 100644 --- a/8/jre/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full +++ b/8/jre/windows/windowsservercore-1909/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (798d6c8ac0aa5a7a1940ca5345405ee0cec1891e7b4cad2ccd525af70e427da9) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '798d6c8ac0aa5a7a1940ca5345405ee0cec1891e7b4cad2ccd525af70e427da9') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (a1c85ec5a47beae1ec462dc83ccb3475715c6abbb74a2437f7d5021de27f17a1) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'a1c85ec5a47beae1ec462dc83ccb3475715c6abbb74a2437f7d5021de27f17a1') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full b/8/jre/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full index 16f511c6d..7c2b8f837 100644 --- a/8/jre/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full +++ b/8/jre/windows/windowsservercore-1909/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (19f1d51e57d23f6d1e7c43ce949a0fbba11917dcc721bea4605f28b7108ce691) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '19f1d51e57d23f6d1e7c43ce949a0fbba11917dcc721bea4605f28b7108ce691') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (42e952a7e05c9c0d0a54ae1fad1a43a758b6c103166c17335d6fb65604688ae7) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '42e952a7e05c9c0d0a54ae1fad1a43a758b6c103166c17335d6fb65604688ae7') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full b/8/jre/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full index 1b74e95d4..946cc6580 100644 --- a/8/jre/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full +++ b/8/jre/windows/windowsservercore-ltsc2016/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (798d6c8ac0aa5a7a1940ca5345405ee0cec1891e7b4cad2ccd525af70e427da9) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '798d6c8ac0aa5a7a1940ca5345405ee0cec1891e7b4cad2ccd525af70e427da9') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (a1c85ec5a47beae1ec462dc83ccb3475715c6abbb74a2437f7d5021de27f17a1) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'a1c85ec5a47beae1ec462dc83ccb3475715c6abbb74a2437f7d5021de27f17a1') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full b/8/jre/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full index 6ec82e7fb..554b01b0a 100644 --- a/8/jre/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full +++ b/8/jre/windows/windowsservercore-ltsc2016/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (19f1d51e57d23f6d1e7c43ce949a0fbba11917dcc721bea4605f28b7108ce691) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '19f1d51e57d23f6d1e7c43ce949a0fbba11917dcc721bea4605f28b7108ce691') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (42e952a7e05c9c0d0a54ae1fad1a43a758b6c103166c17335d6fb65604688ae7) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '42e952a7e05c9c0d0a54ae1fad1a43a758b6c103166c17335d6fb65604688ae7') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full b/8/jre/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full index 02133ae85..35bdd4f46 100644 --- a/8/jre/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full +++ b/8/jre/windows/windowsservercore-ltsc2019/Dockerfile.hotspot.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_hotspot_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (798d6c8ac0aa5a7a1940ca5345405ee0cec1891e7b4cad2ccd525af70e427da9) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '798d6c8ac0aa5a7a1940ca5345405ee0cec1891e7b4cad2ccd525af70e427da9') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_hotspot_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (a1c85ec5a47beae1ec462dc83ccb3475715c6abbb74a2437f7d5021de27f17a1) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'a1c85ec5a47beae1ec462dc83ccb3475715c6abbb74a2437f7d5021de27f17a1') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \ diff --git a/8/jre/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full b/8/jre/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full index 65f6b785d..f830c1044 100644 --- a/8/jre/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full +++ b/8/jre/windows/windowsservercore-ltsc2019/Dockerfile.openj9.nightly.full @@ -24,11 +24,11 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref ENV JAVA_VERSION jdk8u -RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.msi ...'); \ +RUN Write-Host ('Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.msi ...'); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-18-03-55/OpenJDK8U-jre_x64_windows_openj9_2020-09-18-03-55.msi -O 'openjdk.msi'; \ - Write-Host ('Verifying sha256 (19f1d51e57d23f6d1e7c43ce949a0fbba11917dcc721bea4605f28b7108ce691) ...'); \ - if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '19f1d51e57d23f6d1e7c43ce949a0fbba11917dcc721bea4605f28b7108ce691') { \ + wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2020-09-25-06-22/OpenJDK8U-jre_x64_windows_openj9_2020-09-25-06-22.msi -O 'openjdk.msi'; \ + Write-Host ('Verifying sha256 (42e952a7e05c9c0d0a54ae1fad1a43a758b6c103166c17335d6fb65604688ae7) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne '42e952a7e05c9c0d0a54ae1fad1a43a758b6c103166c17335d6fb65604688ae7') { \ Write-Host 'FAILED!'; \ exit 1; \ }; \