Skip to content

Commit 5277d57

Browse files
authored
Merge pull request #233 from jmtd/jdk17-epel-test
Add OpenJDK17 container images (test/preview)
2 parents 5e0e434 + 7c5ce99 commit 5277d57

File tree

17 files changed

+193
-15
lines changed

17 files changed

+193
-15
lines changed
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 "-Xlog:gc::utctime -XX:NativeMemoryTracking=summary"
10+
}

modules/jdk/17/configure.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
# Set this JDK as the alternative in use
17+
_arch="$(uname -i)"
18+
alternatives --set java java-17-openjdk.${_arch}
19+
alternatives --set javac java-17-openjdk.${_arch}
20+
alternatives --set java_sdk_openjdk java-17-openjdk.${_arch}
21+
alternatives --set jre_openjdk java-17-openjdk.${_arch}
22+
23+
# Update securerandom.source for quicker starts (must be done after removing jdk 8, or it will hit the wrong files)
24+
JAVA_SECURITY_FILE=/usr/lib/jvm/java/conf/security/java.security
25+
SECURERANDOM=securerandom.source
26+
if grep -q "^$SECURERANDOM=.*" $JAVA_SECURITY_FILE; then
27+
sed -i "s|^$SECURERANDOM=.*|$SECURERANDOM=file:/dev/urandom|" $JAVA_SECURITY_FILE
28+
else
29+
echo $SECURERANDOM=file:/dev/urandom >> $JAVA_SECURITY_FILE
30+
fi

modules/jdk/17/module.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
schema_version: 1
2+
3+
name: "jboss.container.openjdk.jdk"
4+
description: "Installs the JDK for OpenJDK 17."
5+
version: "17"
6+
7+
labels:
8+
- name: "org.jboss.product"
9+
value: "openjdk"
10+
- name: "org.jboss.product.version"
11+
value: "17"
12+
- name: "org.jboss.product.openjdk.version"
13+
value: "17"
14+
15+
envs:
16+
- name: "JAVA_HOME"
17+
value: "/usr/lib/jvm/java-17"
18+
- name: "JAVA_VENDOR"
19+
value: "openjdk"
20+
- name: "JAVA_VERSION"
21+
value: "17"
22+
- name: JBOSS_CONTAINER_OPENJDK_JDK_MODULE
23+
value: /opt/jboss/container/openjdk/jdk
24+
25+
packages:
26+
install:
27+
- java-17-openjdk-devel
28+
29+
modules:
30+
install:
31+
- name: jboss.container.user
32+
33+
execute:
34+
- script: configure.sh

modules/jvm/api/module.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ envs:
5555
description: The maximum metaspace size.
5656
example: "100"
5757
- name: GC_CONTAINER_OPTIONS
58-
description: specify Java GC to use. The value of this variable should contain the necessary JRE command-line options to specify the required GC, which will override the default of `-XX:+UseParallelOldGC`.
58+
description: specify Java GC to use. The value of this variable should contain the necessary JRE command-line options to specify the required GC, which will override the default of `-XX:+UseParallelGC`.
5959
example: -XX:+UseG1GC
6060
# deprecated
6161
- name: JAVA_OPTIONS

modules/jvm/bash/artifacts/opt/jboss/container/java/jvm/java-default-options

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ gc_config() {
135135
local maxHeapFreeRatio=${GC_MAX_HEAP_FREE_RATIO:-20}
136136
local timeRatio=${GC_TIME_RATIO:-4}
137137
local adaptiveSizePolicyWeight=${GC_ADAPTIVE_SIZE_POLICY_WEIGHT:-90}
138-
local gcOptions="${GC_CONTAINER_OPTIONS:--XX:+UseParallelOldGC}"
138+
local gcOptions="${GC_CONTAINER_OPTIONS:--XX:+UseParallelGC}"
139+
139140
# for compat reasons we don't set a default value for metaspaceSize
140141
local metaspaceSize
141142
# We also don't set a default value for maxMetaspaceSize

redhat/ubi8-openjdk-17.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
osbs:
2+
configuration:
3+
container:
4+
compose:
5+
pulp_repos: true
6+
packages: []
7+
signing_intent: unsigned
8+
repository:
9+
name: containers/openjdk
10+
branch: openjdk-17-ubi8
11+
koji_target: openjdk-17-ubi8-containers-candidate
12+
13+
packages:
14+
manager: microdnf
15+
content_sets:
16+
x86_64:
17+
- rhel-8-for-x86_64-baseos-rpms__8
18+
- rhel-8-for-x86_64-appstream-rpms__8
19+
ppc64le:
20+
- rhel-8-for-ppc64le-appstream-rpms__8
21+
- rhel-8-for-ppc64le-baseos-rpms__8
22+
aarch64:
23+
- rhel-8-for-aarch64-baseos-rpms__8
24+
- rhel-8-for-aarch64-appstream-rpms__8
25+
s390x:
26+
- rhel-8-for-s390x-baseos-rpms__8
27+
- rhel-8-for-s390x-appstream-rpms__8

tests/features/java.security.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@openjdk
22
@ubi8/openjdk-8
33
@ubi8/openjdk-11
4+
@ubi8/openjdk-17
45
@redhat-openjdk-18
56
Feature: Openshift S2I tests
67
Scenario: Check networkaddress.cache.negative.ttl has been set correctly

tests/features/java/gc.feature

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,55 @@
11
@openjdk
22
@ubi8/openjdk-8
33
@ubi8/openjdk-11
4+
@ubi8/openjdk-17
45
@redhat-openjdk-18
56
@openj9
67
Feature: Openshift OpenJDK GC tests
78

89
Scenario: Check default GC configuration
910
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
10-
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
11-
And container log should contain -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
11+
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
12+
And container log should contain -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
1213

1314
Scenario: Check GC_MIN_HEAP_FREE_RATIO GC configuration
1415
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
1516
| variable | value |
1617
| GC_MIN_HEAP_FREE_RATIO | 5 |
17-
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
18-
And container log should contain -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
18+
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
19+
And container log should contain -XX:+UseParallelGC -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
1920

2021
Scenario: Check GC_MAX_HEAP_FREE_RATIO GC configuration
2122
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
2223
| variable | value |
2324
| GC_MAX_HEAP_FREE_RATIO | 50 |
24-
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
25-
And container log should contain -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
25+
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
26+
And container log should contain -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90
2627

2728
Scenario: Check GC_TIME_RATIO GC configuration
2829
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
2930
| variable | value |
3031
| GC_TIME_RATIO | 5 |
31-
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=5 -XX:AdaptiveSizePolicyWeight=90
32-
And container log should contain -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=5 -XX:AdaptiveSizePolicyWeight=90
32+
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=5 -XX:AdaptiveSizePolicyWeight=90
33+
And container log should contain -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=5 -XX:AdaptiveSizePolicyWeight=90
3334

3435
Scenario: Check GC_ADAPTIVE_SIZE_POLICY_WEIGHT GC configuration
3536
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
3637
| variable | value |
3738
| GC_ADAPTIVE_SIZE_POLICY_WEIGHT | 80 |
38-
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=80
39-
And container log should contain -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=80
39+
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=80
40+
And container log should contain -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=80
4041

4142
Scenario: Check GC_MAX_METASPACE_SIZE GC configuration
4243
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
4344
| variable | value |
4445
| GC_MAX_METASPACE_SIZE | 120 |
45-
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=120m
46-
And container log should contain -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=120m
46+
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=120m
47+
And container log should contain -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=120m
4748

4849
Scenario: Check GC_CONTAINER_OPTIONS configuration
4950
Given s2i build https://github.com/jboss-openshift/openshift-quickstarts from undertow-servlet
5051
| variable | value |
5152
| GC_CONTAINER_OPTIONS | -XX:+UseG1GC |
5253
Then s2i build log should contain Using MAVEN_OPTS -XX:+UseG1GC
5354
And container log should contain -XX:+UseG1GC
54-
And container log should not contain -XX:+UseParallelOldGC
55+
And container log should not contain -XX:+UseParallelGC

tests/features/java/java_s2i.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@openjdk
22
@ubi8/openjdk-8
33
@ubi8/openjdk-11
4+
@ubi8/openjdk-17
45
@redhat-openjdk-18
56
@openj9
67
Feature: Openshift OpenJDK S2I tests

tests/features/java/java_s2i_inc.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@openjdk
22
@ubi8/openjdk-8
33
@ubi8/openjdk-11
4+
@ubi8/openjdk-17
45
@redhat-openjdk-18
56
@openj9
67
Feature: Openshift OpenJDK S2I tests

0 commit comments

Comments
 (0)