Skip to content

Commit 023a905

Browse files
authored
Merge branch 'jlink-dev' into OPENJKD-3052-jlink-builder-tag-template
2 parents 5222576 + 6548e31 commit 023a905

File tree

8 files changed

+38
-26
lines changed

8 files changed

+38
-26
lines changed

modules/jdk/11/module.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ envs:
2525
packages:
2626
install:
2727
- java-11-openjdk-devel
28-
- java-11-openjdk-jmods
2928
- tzdata-java
3029

3130
modules:

modules/jdk/17/module.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ envs:
2525
packages:
2626
install:
2727
- java-17-openjdk-devel
28-
- java-17-openjdk-jmods
2928

3029
modules:
3130
install:

modules/jdk/21/module.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ envs:
2525
packages:
2626
install:
2727
- java-21-openjdk-devel
28-
- java-21-openjdk-jmods
2928

3029
modules:
3130
install:

modules/jlink/artifacts/opt/jboss/container/java/jlink/preflight.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
jlink_techpreview_warning()
2+
{
3+
{
4+
echo "WARNING WARNING WARNING"
5+
echo " Jlink integration is a Tech Preview feature!"
6+
echo " See <https://access.redhat.com/support/offerings/techpreview/>"
7+
echo " for more information."
8+
echo "WARNING WARNING WARNING"
9+
} >&2
10+
}
11+
112
jlink_preflight_check()
213
{
314
# preflight check: do we have what we need?

modules/jlink/tests/features/jlink.feature

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
@ubi9/openjdk-11
21
@ubi9/openjdk-17
32
@ubi9/openjdk-21
43
Feature: Openshift OpenJDK S2I tests (jlink specific)
5-
Scenario: Ensure jlinked builder is used to build the containerized application image
6-
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from quarkus-quickstarts/getting-started-3.0.1.Final-nos2i
4+
5+
Scenario: tech preview warning is printed (OPENJDK-3038)
6+
Given failing s2i build https://github.com/jboss-container-images/openjdk-test-applications from spring-boot-sample-simple/target using master
77
| variable | value |
88
| S2I_ENABLE_JLINK | true |
9-
| QUARKUS_PACKAGE_TYPE| uber-jar |
10-
Then run ls /tmp/jre in container and check its output for bin
9+
Then s2i build log should contain Jlink integration is a Tech Preview feature
1110

1211
Scenario: Ensure S2I_ENABLE_JLINK is not set to true
1312
Given s2i build https://github.com/jboss-container-images/openjdk-test-applications from quarkus-quickstarts/getting-started-3.0.1.Final-nos2i

modules/s2i/bash/artifacts/usr/local/s2i/assemble

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ setup_java_app_and_lib
2222
if [ "$S2I_ENABLE_JLINK" = "true" ]; then
2323

2424
source "${JBOSS_CONTAINER_JAVA_JLINK_MODULE}/preflight.sh"
25+
jlink_techpreview_warning
2526
jlink_preflight_check
2627

2728
source "${JBOSS_CONTAINER_JAVA_JLINK_MODULE}/mkdeps.sh"

templates/jlink/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ Some suitable test values for the parameters are
5656
* APP_URI: https://github.com/jboss-container-images/openjdk-test-applications
5757
* REF: master
5858
* CONTEXT_DIR: quarkus-quickstarts/getting-started-3.9.2-uberjar
59+
* APPNAME: quarkus-quickstart
5960

6061
oc process \
6162
-p JDK_VERSION=17 \
6263
-p APP_URI=https://github.com/jboss-container-images/openjdk-test-applications \
6364
-p REF=master \
6465
-p CONTEXT_DIR=quarkus-quickstarts/getting-started-3.9.2-uberjar \
66+
-p APPNAME=quarkus-quickstart \
6567
templates/jlink-app-template \
6668
| oc create -f -
6769

templates/jlink/jlinked-app.yaml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ parameters:
1515
- description: OpenJDK builder image version tag
1616
name: BUILDER_IMAGE_TAG
1717
value: "latest"
18+
- description: A name for the application used to ensure created resources are uniquely named
19+
name: APPNAME
1820
required: true
1921
- description: Application to run the jlink workflow on
2022
name: APP_URI
@@ -39,7 +41,7 @@ objects:
3941
- apiVersion: image.openshift.io/v1
4042
kind: ImageStream
4143
metadata:
42-
name: ubi9-openjdk-${JDK_VERSION}-jlink
44+
name: ${APPNAME}-ubi9-openjdk-${JDK_VERSION}-jlink
4345
spec:
4446
lookupPolicy:
4547
local: false
@@ -48,9 +50,9 @@ objects:
4850
- apiVersion: build.openshift.io/v1
4951
kind: BuildConfig
5052
metadata:
51-
name: jlink-builder-jdk-${JDK_VERSION}
53+
name: ${APPNAME}-jlink-builder-jdk-${JDK_VERSION}
5254
labels:
53-
app: jlink-builder-jdk-${JDK_VERSION}
55+
app: ${APPNAME}-jlink-builder-jdk-${JDK_VERSION}
5456
spec:
5557
source:
5658
dockerfile: |
@@ -76,7 +78,7 @@ objects:
7678
output:
7779
to:
7880
kind: ImageStreamTag
79-
name: ubi9-openjdk-${JDK_VERSION}-jlink:latest
81+
name: ${APPNAME}-ubi9-openjdk-${JDK_VERSION}-jlink:latest
8082
triggers:
8183
- type: ConfigChange
8284
- type: ImageChange
@@ -89,7 +91,7 @@ objects:
8991
- apiVersion: image.openshift.io/v1
9092
kind: ImageStream
9193
metadata:
92-
name: intermediate
94+
name: ${APPNAME}-intermediate
9395
spec:
9496
lookupPolicy:
9597
local: false
@@ -98,9 +100,9 @@ objects:
98100
- apiVersion: build.openshift.io/v1
99101
kind: BuildConfig
100102
metadata:
101-
name: jlink-s2i-jdk-${JDK_VERSION}
103+
name: ${APPNAME}-jlink-s2i-jdk-${JDK_VERSION}
102104
labels:
103-
app: jlink-s2i-jdk-${JDK_VERSION}
105+
app: ${APPNAME}-jlink-s2i-jdk-${JDK_VERSION}
104106
spec:
105107
source:
106108
type: Git
@@ -112,7 +114,7 @@ objects:
112114
sourceStrategy:
113115
from:
114116
kind: ImageStreamTag
115-
name: ubi9-openjdk-${JDK_VERSION}-jlink:latest # Output Imagestream from stage-1
117+
name: ${APPNAME}-ubi9-openjdk-${JDK_VERSION}-jlink:latest # Output Imagestream from stage-1
116118
pullPolicy: Always
117119
env:
118120
- name: S2I_ENABLE_JLINK
@@ -122,14 +124,14 @@ objects:
122124
output:
123125
to:
124126
kind: ImageStreamTag
125-
name: intermediate:latest
127+
name: ${APPNAME}-intermediate:latest
126128
triggers:
127129
- type: ConfigChange
128130
- type: ImageChange
129131
imageChange:
130132
from:
131133
kind: ImageStreamTag
132-
name: ubi9-openjdk-${JDK_VERSION}-jlink:latest # Output of stage-1 which serves as input to stage-2
134+
name: ${APPNAME}-ubi9-openjdk-${JDK_VERSION}-jlink:latest # Output of stage-1 which serves as input to stage-2
133135
- type: GitHub
134136
github:
135137
secret: ${GITHUB_WEBHOOK_SECRET}
@@ -139,7 +141,7 @@ objects:
139141
- apiVersion: image.openshift.io/v1
140142
kind: ImageStream
141143
metadata:
142-
name: ubimicro
144+
name: ${APPNAME}-ubimicro
143145
spec:
144146
lookupPolicy:
145147
local: true
@@ -155,7 +157,7 @@ objects:
155157
- apiVersion: image.openshift.io/v1
156158
kind: ImageStream
157159
metadata:
158-
name: lightweight-image
160+
name: ${APPNAME}-lightweight-image
159161
spec:
160162
lookupPolicy:
161163
local: false
@@ -164,13 +166,13 @@ objects:
164166
- apiVersion: build.openshift.io/v1
165167
kind: BuildConfig
166168
metadata:
167-
name: multistage-buildconfig
169+
name: ${APPNAME}-multistage-buildconfig
168170
spec:
169171
source:
170172
images:
171173
- from:
172174
kind: ImageStreamTag
173-
name: intermediate:latest
175+
name: ${APPNAME}-intermediate:latest
174176
paths:
175177
- sourcePath: /mnt/jrootfs
176178
destinationDir: jrootfs
@@ -200,20 +202,20 @@ objects:
200202
dockerStrategy:
201203
from:
202204
kind: ImageStreamTag
203-
name: ubimicro:latest
205+
name: ${APPNAME}-ubimicro:latest
204206
output:
205207
to:
206208
kind: ImageStreamTag
207-
name: lightweight-image:latest # Tag for the final output image
209+
name: ${APPNAME}-lightweight-image:latest # Tag for the final output image
208210
triggers:
209211
- type: ConfigChange
210212
- type: ImageChange
211213
imageChange:
212214
from:
213215
kind: ImageStreamTag
214-
name: intermediate:latest # output of stage-2
216+
name: ${APPNAME}-intermediate:latest # output of stage-2
215217
- type: ImageChange
216218
imageChange:
217219
from:
218220
kind: ImageStreamTag
219-
name: ubimicro:latest # ImageStreamTag for registry.access.redhat.com/ubi9/ubi-micro
221+
name: ${APPNAME}-ubimicro:latest # ImageStreamTag for registry.access.redhat.com/ubi9/ubi-micro

0 commit comments

Comments
 (0)