Skip to content

Commit

Permalink
Merge pull request #415 from jmtd/ubi8-jdk21
Browse files Browse the repository at this point in the history
[OPENJDK-2411] JDK21 images for UBI8
  • Loading branch information
jmtd authored Nov 10, 2023
2 parents 1480a3e + 4eff5d8 commit 9b8a913
Show file tree
Hide file tree
Showing 56 changed files with 436 additions and 96 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ubi8-openjdk-21-runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: UBI8 OpenJDK 21 Runtime S2I Image CI
on: [push, pull_request]
env:
LANG: en_US.UTF-8
IMAGE: ubi8-openjdk-21-runtime
jobs:
call-openjdkci:
uses: ./.github/workflows/image-workflow-template.yml
with:
image: ubi8-openjdk-21-runtime
10 changes: 10 additions & 0 deletions .github/workflows/ubi8-openjdk-21.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: UBI8 OpenJDK 21 S2I Image CI
on: [push, pull_request]
env:
LANG: en_US.UTF-8
IMAGE: ubi8-openjdk-21
jobs:
call-openjdkci:
uses: ./.github/workflows/image-workflow-template.yml
with:
image: ubi8-openjdk-21
2 changes: 1 addition & 1 deletion modules/jdk/11/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R jboss:root $SCRIPT_DIR
chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jdk/*

Expand Down
2 changes: 1 addition & 1 deletion modules/jdk/17/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R jboss:root $SCRIPT_DIR
chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jdk/*

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

#!/bin/sh
# ==============================================================================
# JDK specific customizations
#
# ==============================================================================

function jvm_specific_diagnostics() {
echo "-Xlog:gc::utctime -XX:NativeMemoryTracking=summary"
}
30 changes: 30 additions & 0 deletions modules/jdk/21/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh
# Configure module
set -e

SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jdk/*

pushd ${ARTIFACTS_DIR}
cp -pr * /
popd

# Set this JDK as the alternative in use
_arch="$(uname -i)"
alternatives --set java java-21-openjdk.${_arch}
alternatives --set javac java-21-openjdk.${_arch}
alternatives --set java_sdk_openjdk java-21-openjdk.${_arch}
alternatives --set jre_openjdk java-21-openjdk.${_arch}

# Update securerandom.source for quicker starts (must be done after removing jdk 8, or it will hit the wrong files)
JAVA_SECURITY_FILE=/usr/lib/jvm/java/conf/security/java.security
SECURERANDOM=securerandom.source
if grep -q "^$SECURERANDOM=.*" $JAVA_SECURITY_FILE; then
sed -i "s|^$SECURERANDOM=.*|$SECURERANDOM=file:/dev/urandom|" $JAVA_SECURITY_FILE
else
echo $SECURERANDOM=file:/dev/urandom >> $JAVA_SECURITY_FILE
fi
34 changes: 34 additions & 0 deletions modules/jdk/21/module.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
schema_version: 1

name: "jboss.container.openjdk.jdk"
description: "Installs the JDK for OpenJDK 21."
version: &jdkver "21"

labels:
- name: "org.jboss.product"
value: "openjdk"
- name: "org.jboss.product.version"
value: *jdkver
- name: "org.jboss.product.openjdk.version"
value: *jdkver

envs:
- name: "JAVA_HOME"
value: "/usr/lib/jvm/java-21"
- name: "JAVA_VENDOR"
value: "openjdk"
- name: "JAVA_VERSION"
value: *jdkver
- name: JBOSS_CONTAINER_OPENJDK_JDK_MODULE
value: /opt/jboss/container/openjdk/jdk

packages:
install:
- java-21-openjdk-devel

modules:
install:
- name: jboss.container.user

execute:
- script: configure.sh
2 changes: 1 addition & 1 deletion modules/jdk/8/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R jboss:root $SCRIPT_DIR
chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jdk/*

Expand Down
2 changes: 1 addition & 1 deletion modules/jre/11/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo $SCRIPT_DIR
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts
echo $ARTIFACTS_DIR

chown -R jboss:root $SCRIPT_DIR
chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jre/*

Expand Down
2 changes: 1 addition & 1 deletion modules/jre/17/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo $SCRIPT_DIR
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts
echo $ARTIFACTS_DIR

chown -R jboss:root $SCRIPT_DIR
chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jre/*

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

#!/bin/sh
# ==============================================================================
# JDK specific customizations
#
# ==============================================================================

function jvm_specific_diagnostics() {
echo "-Xlog:gc::utctime -XX:NativeMemoryTracking=summary"
}
20 changes: 20 additions & 0 deletions modules/jre/21/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
# Configure module
set -e

SCRIPT_DIR=$(dirname $0)
echo $SCRIPT_DIR
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts
echo $ARTIFACTS_DIR

chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jre/*

pushd ${ARTIFACTS_DIR}
cp -pr * /
popd

# Set this JDK as the alternative in use
_arch="$(uname -i)"
alternatives --set java java-21-openjdk.${_arch}
34 changes: 34 additions & 0 deletions modules/jre/21/module.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
schema_version: 1

name: "jboss.container.openjdk.jre"
description: "Installs only the JRE headless for OpenJDK 21."
version: &jdkver "21"

labels:
- name: "org.jboss.product"
value: "openjdk"
- name: "org.jboss.product.version"
value: *jdkver
- name: "org.jboss.product.openjdk.version"
value: *jdkver

envs:
- name: "JAVA_HOME"
value: "/usr/lib/jvm/jre"
- name: "JAVA_VENDOR"
value: "openjdk"
- name: "JAVA_VERSION"
value: *jdkver
- name: JBOSS_CONTAINER_OPENJDK_JRE_MODULE
value: /opt/jboss/container/openjdk/jre

packages:
install:
- java-21-openjdk-headless

modules:
install:
- name: jboss.container.user

execute:
- script: configure.sh
2 changes: 1 addition & 1 deletion modules/jre/8/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R jboss:root $SCRIPT_DIR
chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jre/*

Expand Down
2 changes: 1 addition & 1 deletion modules/jvm/bash/backward_compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ set -e
mkdir -p /opt/run-java
ln -s /opt/jboss/container/java/jvm/* /opt/run-java

chown -R jboss:root /opt/run-java
chown -R $USER:root /opt/run-java
2 changes: 1 addition & 1 deletion modules/jvm/bash/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R jboss:root $SCRIPT_DIR
chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/java/jvm/*

Expand Down
1 change: 1 addition & 0 deletions modules/jvm/bash/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ execute:

modules:
install:
- name: jboss.container.user
- name: jboss.container.java.jvm.api
- name: jboss.container.java.proxy.bash
6 changes: 3 additions & 3 deletions modules/maven/default/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

# configure artifact permissions
chown -R jboss:root $ARTIFACTS_DIR
chown -R $USER:root $ARTIFACTS_DIR
chmod -R ug+rwX $ARTIFACTS_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/maven/default/maven.sh

Expand All @@ -19,11 +19,11 @@ MAVEN_VERSION_SQUASHED=${MAVEN_VERSION/./}

# pull in specific maven version to serve as default
ln -s /opt/jboss/container/maven/${MAVEN_VERSION_SQUASHED}/* /opt/jboss/container/maven/default
chown -h jboss:root /opt/jboss/container/maven/default/*
chown -h $USER:root /opt/jboss/container/maven/default/*

# install default settings.xml file in user home
mkdir -p $HOME/.m2
ln -s /opt/jboss/container/maven/default/jboss-settings.xml $HOME/.m2/settings.xml

chown -R jboss:root $HOME/.m2
chown -R $USER:root $HOME/.m2
chmod -R ug+rwX $HOME/.m2
1 change: 1 addition & 0 deletions modules/maven/default/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ execute:

modules:
install:
- name: jboss.container.user
- name: jboss.container.maven.api
- name: jboss.container.java.jvm.bash
- name: jboss.container.maven
Expand Down
2 changes: 1 addition & 1 deletion modules/maven/s2i/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R jboss:root $SCRIPT_DIR
chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/maven/s2i/*
chmod ug+x ${ARTIFACTS_DIR}/usr/local/s2i/*
Expand Down
1 change: 1 addition & 0 deletions modules/maven/s2i/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ execute:

modules:
install:
- name: jboss.container.user
- name: jboss.container.s2i.core.api
- name: jboss.container.s2i.core.bash
- name: jboss.container.maven.default
Expand Down
2 changes: 1 addition & 1 deletion modules/proxy/bash/backward_compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ set -e
mkdir -p /opt/run-java
ln -s /opt/jboss/container/java/proxy/* /opt/run-java

chown -R jboss:root /opt/run-java
chown -R $USER:root /opt/run-java
2 changes: 1 addition & 1 deletion modules/proxy/bash/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R jboss:root $SCRIPT_DIR
chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/java/proxy*

Expand Down
3 changes: 2 additions & 1 deletion modules/proxy/bash/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ execute:

modules:
install:
- name: jboss.container.proxy.api
- name: jboss.container.user
- name: jboss.container.proxy.api
4 changes: 2 additions & 2 deletions modules/run/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R jboss:root $SCRIPT_DIR
chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/java/run/*

Expand All @@ -15,7 +15,7 @@ popd

mkdir -p /deployments/data \
&& chmod -R "ug+rwX" /deployments/data \
&& chown -R jboss:root /deployments/data
&& chown -R $USER:root /deployments/data

# OPENJDK-100: turn off negative DNS caching
if [ -w ${JAVA_HOME}/jre/lib/security/java.security ]; then
Expand Down
1 change: 1 addition & 0 deletions modules/run/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ execute:

modules:
install:
- name: jboss.container.user
- name: jboss.container.java.jvm.bash
- name: jboss.container.util.logging.bash
2 changes: 1 addition & 1 deletion modules/s2i/bash/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R jboss:root $SCRIPT_DIR
chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/java/s2i/*
chmod ug+x ${ARTIFACTS_DIR}/usr/local/s2i/*
Expand Down
1 change: 1 addition & 0 deletions modules/s2i/bash/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ execute:

modules:
install:
- name: jboss.container.user
- name: jboss.container.maven.s2i
- name: jboss.container.java.run
- name: jboss.container.util.logging.bash
Expand Down
4 changes: 4 additions & 0 deletions modules/s2i/core/api/module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,7 @@ envs:
run:
cmd:
- "/usr/local/s2i/run"

modules:
install:
- name: jboss.container.user
6 changes: 3 additions & 3 deletions modules/s2i/core/bash/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
SCRIPT_DIR=$(dirname $0)
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts

chown -R jboss:root $SCRIPT_DIR
chown -R $USER:root $SCRIPT_DIR
chmod -R ug+rwX $SCRIPT_DIR
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/s2i/core/*

Expand All @@ -15,8 +15,8 @@ popd

mkdir -p /usr/local/s2i \
&& chmod 775 /usr/local/s2i \
&& chown -R jboss:root /usr/local/s2i
&& chown -R $USER:root /usr/local/s2i

mkdir -p /deployments \
&& chmod -R "ug+rwX" /deployments \
&& chown -R jboss:root /deployments
&& chown -R $USER:root /deployments
4 changes: 2 additions & 2 deletions modules/user/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
# We use the ID 185 for the group as well as for the user.
# This ID is registered static ID for the JBoss EAP product
# on RHEL which makes it safe to use.
groupadd -r jboss -g 185 && useradd -u 185 -r -g root -G jboss -m -d /home/jboss -s /sbin/nologin -c "JBoss user" jboss
groupadd -r $USER -g $UID && useradd -u $UID -r -g root -G $USER -m -d $HOME -s /sbin/nologin -c "$GECOS" $USER

# OPENJDK-533, OPENJDK-556: correct permissions for OpenShift etc
chmod 0770 /home/jboss
chmod 0770 $HOME
Loading

0 comments on commit 9b8a913

Please sign in to comment.