Skip to content

Commit ea39861

Browse files
author
Osni Oliveira
committed
Change the JVM used to OpenJ9
Changes/fixes include: - Change the image name and labels to reference OpenJ9 - Include a module to remove OpenJDK (HotSpot) 8 it's installed indirectly as a Maven dependency - Add a new OpenJ9 11 module and use it in replacement of HotSpot OpenJDK 11 - Integrate the OpenJ9 11 binaries package provided by RCM - Change dist-git branch names to use specific OpenJ9 ones References: IBMZP-28, JDG-3368, CLOUD-3527, RCM-79651 WARNING: the image might be in a non-buildable state after this commit, required changes might be present in future commits.
1 parent fe35e8e commit ea39861

File tree

12 files changed

+114
-10
lines changed

12 files changed

+114
-10
lines changed

container.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,9 @@ platforms:
44

55
compose:
66
pulp_repos: true
7+
packages:
8+
- java-11-openj9
9+
- java-11-openj9-headless
10+
- java-11-openj9-devel
11+
signing_intent: release
12+
inherit: true

content_sets.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
x86_64:
2-
- rhel-server-rhscl-7-rpms
3-
- rhel-7-server-rpms
2+
- rhel-8-for-x86_64-baseos-rpms
3+
- rhel-8-for-x86_64-appstream-rpms

image.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
schema_version: 1
2-
name: jboss-datagrid-7/datagrid73-openshift
2+
name: jboss-datagrid-7/datagrid73-openj9-11-openshift
33
version: 1.4
44
description: "Red Hat JBoss Data Grid 7.3 for OpenShift container image"
55

66
from: rh-osbs/ubi8:8.1-released
77

88
labels:
99
- name: "com.redhat.component"
10-
value: "jboss-datagrid-7-datagrid73-openshift-container"
10+
value: "jboss-datagrid-7-datagrid73-openj9-11-openshift-container"
1111
- name: "org.jboss.product"
1212
value: "datagrid"
1313
- name: "org.jboss.product.version"
@@ -27,7 +27,7 @@ labels:
2727
- name: "io.k8s.description"
2828
value: "Provides a scalable in-memory distributed database designed for fast access to large volumes of data."
2929
- name: "io.k8s.display-name"
30-
value: "JBoss Data Grid 7.3"
30+
value: "JBoss Data Grid 7.3 OpenJ9 11"
3131
- name: "io.openshift.expose-services"
3232
value: "8080:http"
3333
- name: "io.openshift.tags"
@@ -185,8 +185,9 @@ modules:
185185
- name: common.modules
186186
path: modules/common
187187
install:
188+
- name: jboss.container.java.rm-openjdk
188189
- name: jboss.container.openjdk.jdk
189-
version: "11"
190+
version: "openj9-11"
190191
- name: datagrid.distribution
191192
- name: dynamic-resources
192193
- name: os-eap7-openshift
@@ -203,6 +204,7 @@ modules:
203204

204205
packages:
205206
content_sets_file: content_sets.yml
207+
manager: dnf
206208
install:
207209
- hostname
208210
- openssl
@@ -221,4 +223,4 @@ osbs:
221223
container_file: container.yaml
222224
repository:
223225
name: containers/jboss-datagrid-7
224-
branch: jb-datagrid-7.3-openshift-rhel-7
226+
branch: jb-datagrid-7.3-openj9-11-openshift-rhel8
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
set -u
3+
set -e
4+
5+
for pkg in java-1.8.0-openjdk-devel \
6+
java-1.8.0-openjdk-headless \
7+
java-1.8.0-openjdk; do
8+
if rpm -q "$pkg"; then
9+
rpm -e --nodeps "$pkg"
10+
fi
11+
done
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
schema_version: 1
2+
name: jboss.container.java.rm-openjdk
3+
version: '1.0'
4+
description: Remove OpenJDK 1.8
5+
6+
execute:
7+
- script: configure.sh

modules/common/jboss/container/openjdk/jdk/11/configure.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ pushd ${ARTIFACTS_DIR}
1313
cp -pr * /
1414
popd
1515

16+
# Set this JDK as the alternative in use
17+
_arch="$(uname -i)"
18+
alternatives --set java java-11-openjdk.${_arch}
19+
alternatives --set javac java-11-openjdk.${_arch}
20+
alternatives --set java_sdk_openjdk java-11-openjdk.${_arch}
21+
alternatives --set jre_openjdk java-11-openjdk.${_arch}
22+
1623
# As of rhel 7.6, rh-maven35 pulls in jdk8, so we need to remove them
1724
# XXX: This code should eventually move to the maven module, once layering is fully supported in cekit, as this module
1825
# would be installed before maven (i.e. there's nothing to remove when this module is installed)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
#!/bin/sh
3+
# ==============================================================================
4+
# JDK specific customizations
5+
#
6+
# ==============================================================================
7+
8+
function jvm_specific_diagnostics() {
9+
echo ""
10+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
# Configure module
3+
set -e
4+
5+
SCRIPT_DIR=$(dirname $0)
6+
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts
7+
8+
chown -R jboss:root $SCRIPT_DIR
9+
chmod -R ug+rwX $SCRIPT_DIR
10+
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jdk/*
11+
12+
pushd ${ARTIFACTS_DIR}
13+
cp -pr * /
14+
popd
15+
16+
_arch="$(uname -i)"
17+
alternatives --set java java-11-openj9.${_arch}
18+
alternatives --set javac java-11-openj9.${_arch}
19+
alternatives --set java_sdk_openj9 java-11-openj9.${_arch}
20+
alternatives --set jre_openj9 java-11-openj9.${_arch}
21+
22+
# Update securerandom.source for quicker starts (must be done after removing jdk 8, or it will hit the wrong files)
23+
JAVA_SECURITY_FILE=/usr/lib/jvm/java/conf/security/java.security
24+
SECURERANDOM=securerandom.source
25+
if grep -q "^$SECURERANDOM=.*" $JAVA_SECURITY_FILE; then
26+
sed -i "s|^$SECURERANDOM=.*|$SECURERANDOM=file:/dev/urandom|" $JAVA_SECURITY_FILE
27+
else
28+
echo $SECURERANDOM=file:/dev/urandom >> $JAVA_SECURITY_FILE
29+
fi
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
schema_version: 1
2+
3+
name: "jboss.container.openjdk.jdk"
4+
description: "Installs the JDK for OpenJ9 11."
5+
version: "openj9-11"
6+
7+
labels:
8+
- name: "org.jboss.product"
9+
value: "openjdk"
10+
- name: "org.jboss.product.version"
11+
value: "11"
12+
- name: "org.jboss.product.openjdk.version"
13+
value: "11"
14+
15+
envs:
16+
- name: "JAVA_HOME"
17+
value: "/usr/lib/jvm/jre-11-openj9"
18+
- name: "JAVA_VENDOR"
19+
value: "openj9"
20+
- name: "JAVA_VERSION"
21+
value: "11"
22+
23+
packages:
24+
install:
25+
- java-11-openj9-devel
26+
27+
modules:
28+
install:
29+
- name: jboss.container.user
30+
31+
execute:
32+
- script: configure.sh

override-cp.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
osbs:
22
repository:
33
name: containers/jboss-datagrid-7
4-
branch: jb-datagrid-7.3-openshift-cp-rhel-7
4+
branch: jb-datagrid-7.3-openj9-11-openshift-cp-rhel8

0 commit comments

Comments
 (0)