Skip to content

Commit

Permalink
Merge pull request #45 from WASdev/java17
Browse files Browse the repository at this point in the history
Java17
  • Loading branch information
kevin-ortega authored Jun 15, 2023
2 parents a13601c + 0829c9c commit 6fefd1d
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 7 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ jobs:
JAVA8_RUNTIME_IMAGE_VERSION=${LIBERTY_VERSION}-runtime-java8
JAVA11_IMAGE_VERSION=${LIBERTY_VERSION}-java11
JAVA11_RUNTIME_IMAGE_VERSION=${LIBERTY_VERSION}-runtime-java11
JAVA17_IMAGE_VERSION=${LIBERTY_VERSION}-java17
JAVA17_RUNTIME_IMAGE_VERSION=${LIBERTY_VERSION}-runtime-java17
NAMESPACE=ibmcom
PLATFORM=websphere-liberty-s2i
IMAGE_NAME=${NAMESPACE}/${PLATFORM}
echo Pushing the following versions of image ${IMAGE_NAME} to docker hub:
echo ${JAVA8_IMAGE_VERSION}, ${JAVA8_RUNTIME_IMAGE_VERSION}, ${JAVA11_IMAGE_VERSION}, ${JAVA11_RUNTIME_IMAGE_VERSION}
echo ${JAVA8_IMAGE_VERSION}, ${JAVA8_RUNTIME_IMAGE_VERSION}, ${JAVA11_IMAGE_VERSION}, ${JAVA11_RUNTIME_IMAGE_VERSION}, ${JAVA17_IMAGE_VERSION}, ${JAVA17_RUNTIME_IMAGE_VERSION}
docker login -u="${{ secrets.DOCKER_USERID }}" -p="${{ secrets.DOCKER_PASSWORD }}"
Expand All @@ -89,3 +91,11 @@ jobs:
docker push ${IMAGE_NAME}:${JAVA11_RUNTIME_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA11_RUNTIME_IMAGE_VERSION} ${IMAGE_NAME}:runtime-java11
docker push ${IMAGE_NAME}:runtime-java11

docker push ${IMAGE_NAME}:${JAVA17_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA17_IMAGE_VERSION} ${IMAGE_NAME}:java17
docker push ${IMAGE_NAME}:java17

docker push ${IMAGE_NAME}:${JAVA17_RUNTIME_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA17_RUNTIME_IMAGE_VERSION} ${IMAGE_NAME}:runtime-java17
docker push ${IMAGE_NAME}:runtime-java17
16 changes: 14 additions & 2 deletions .one-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,14 @@ containerize:
JAVA8_RUNTIME_IMAGE_VERSION=${LIBERTY_VERSION}-runtime-java8
JAVA11_IMAGE_VERSION=${LIBERTY_VERSION}-java11
JAVA11_RUNTIME_IMAGE_VERSION=${LIBERTY_VERSION}-runtime-java11
JAVA17_IMAGE_VERSION=${LIBERTY_VERSION}-java17
JAVA17_RUNTIME_IMAGE_VERSION=${LIBERTY_VERSION}-runtime-java17
NAMESPACE=cp/olc
PLATFORM=websphere-liberty-s2i
IMAGE_NAME=${NAMESPACE}/${PLATFORM}
echo Pushing the following versions of image ${IMAGE_NAME} to ${PIPELINE_REGISTRY}:
echo ${JAVA8_IMAGE_VERSION}, ${JAVA8_RUNTIME_IMAGE_VERSION}, ${JAVA11_IMAGE_VERSION}, ${JAVA11_RUNTIME_IMAGE_VERSION}
echo ${JAVA8_IMAGE_VERSION}, ${JAVA8_RUNTIME_IMAGE_VERSION}, ${JAVA11_IMAGE_VERSION}, ${JAVA11_RUNTIME_IMAGE_VERSION}, ${JAVA17_IMAGE_VERSION}, ${JAVA17_RUNTIME_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA8_IMAGE_VERSION} ${PIPELINE_REGISTRY}/${IMAGE_NAME}:${JAVA8_IMAGE_VERSION}
docker push ${PIPELINE_REGISTRY}/${IMAGE_NAME}:${JAVA8_IMAGE_VERSION}
Expand All @@ -164,9 +166,19 @@ containerize:
docker push ${PIPELINE_REGISTRY}/${IMAGE_NAME}:${JAVA11_RUNTIME_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA11_RUNTIME_IMAGE_VERSION} ${PIPELINE_REGISTRY}/${IMAGE_NAME}:runtime-java11
docker push ${PIPELINE_REGISTRY}/${IMAGE_NAME}:runtime-java11

docker tag ${IMAGE_NAME}:${JAVA17_IMAGE_VERSION} ${PIPELINE_REGISTRY}/${IMAGE_NAME}:${JAVA17_IMAGE_VERSION}
docker push ${PIPELINE_REGISTRY}/${IMAGE_NAME}:${JAVA17_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA17_IMAGE_VERSION} ${PIPELINE_REGISTRY}/${IMAGE_NAME}:java17
docker push ${PIPELINE_REGISTRY}/${IMAGE_NAME}:java17

docker tag ${IMAGE_NAME}:${JAVA17_RUNTIME_IMAGE_VERSION} ${PIPELINE_REGISTRY}/${IMAGE_NAME}:${JAVA17_RUNTIME_IMAGE_VERSION}
docker push ${PIPELINE_REGISTRY}/${IMAGE_NAME}:${JAVA17_RUNTIME_IMAGE_VERSION}
docker tag ${IMAGE_NAME}:${JAVA17_RUNTIME_IMAGE_VERSION} ${PIPELINE_REGISTRY}/${IMAGE_NAME}:runtime-java17
docker push ${PIPELINE_REGISTRY}/${IMAGE_NAME}:runtime-java17

echo "**** Saving Artifacts ****"
declare -a tags=("${JAVA8_IMAGE_VERSION}" "${JAVA11_IMAGE_VERSION}" "${JAVA8_RUNTIME_IMAGE_VERSION}" "${JAVA11_RUNTIME_IMAGE_VERSION}")
declare -a tags=("${JAVA8_IMAGE_VERSION}" "${JAVA11_IMAGE_VERSION}" "${JAVA17_IMAGE_VERSION}" "${JAVA8_RUNTIME_IMAGE_VERSION}" "${JAVA11_RUNTIME_IMAGE_VERSION}" "${JAVA17_RUNTIME_IMAGE_VERSION}")
for i in "${tags[@]}"
do
IMAGE=$PIPELINE_REGISTRY/$NAMESPACE/$PIPELINE_S2I_IMAGE:$i
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ JAVA8_IMAGE_VERSION=$(LIBERTY_VERSION)-java8
JAVA8_RUNTIME_IMAGE_VERSION=$(LIBERTY_VERSION)-runtime-java8
JAVA11_IMAGE_VERSION=$(LIBERTY_VERSION)-java11
JAVA11_RUNTIME_IMAGE_VERSION=$(LIBERTY_VERSION)-runtime-java11
JAVA17_IMAGE_VERSION=$(LIBERTY_VERSION)-java17
JAVA17_RUNTIME_IMAGE_VERSION=$(LIBERTY_VERSION)-runtime-java17
NAMESPACE?=ibmcom
PROD_NAMESPACE?=ibmcom
PLATFORM=websphere-liberty-s2i
Expand All @@ -18,7 +20,9 @@ script_env = \
JAVA8_IMAGE_VERSION=$(JAVA8_IMAGE_VERSION) \
JAVA8_RUNTIME_IMAGE_VERSION=$(JAVA8_RUNTIME_IMAGE_VERSION) \
JAVA11_IMAGE_VERSION=$(JAVA11_IMAGE_VERSION) \
JAVA11_RUNTIME_IMAGE_VERSION=$(JAVA11_RUNTIME_IMAGE_VERSION)
JAVA11_RUNTIME_IMAGE_VERSION=$(JAVA11_RUNTIME_IMAGE_VERSION) \
JAVA17_IMAGE_VERSION=$(JAVA17_IMAGE_VERSION) \
JAVA17_RUNTIME_IMAGE_VERSION=$(JAVA17_RUNTIME_IMAGE_VERSION)

.PHONY: build
build:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $ cd $IMAGE_DIR
$ cekit build docker
```

Example values for IMAGE_DIR are `images/java8/builder`, `images/java8/runtime`, `images/java11/builder`, or `images/java11/runtime`.
Example values for IMAGE_DIR are `images/java8/builder`, `images/java8/runtime`, `images/java11/builder`, `images/java11/runtime`, `images/java17/builder`, or `images/java17/runtime`.

S2I Usage
---------
Expand Down
17 changes: 17 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SCRIPT_DIR=$(dirname $0)

JAVA8_BASE_IMAGE_NAME="${NAMESPACE:=ibmcom}/websphere-liberty:${LIBERTY_VERSION}-full-java8-openj9-ubi"
JAVA11_BASE_IMAGE_NAME="${NAMESPACE:=ibmcom}/websphere-liberty:${LIBERTY_VERSION}-full-java11-openj9-ubi"
JAVA17_BASE_IMAGE_NAME="${NAMESPACE:=ibmcom}/websphere-liberty:${LIBERTY_VERSION}-full-java17-openj9-ubi"

echo "Building Java 8 Builder Image ${JAVA8_BASE_IMAGE_NAME}"
pushd ${SCRIPT_DIR}/images/java8/builder
Expand Down Expand Up @@ -36,3 +37,19 @@ if [[ ! -z "${TEST_MODE:-}" ]]; then
IMAGE_VERSION=${JAVA11_IMAGE_VERSION}; RUNTIME_IMAGE_VERSION=${JAVA11_RUNTIME_IMAGE_VERSION}; . ${SCRIPT_DIR}/test/run
fi

echo "Building Java 17 Builder Image"
pushd ${SCRIPT_DIR}/images/java17/builder
cekit build --overrides '{"from": "'"${JAVA17_BASE_IMAGE_NAME}"'"}' --overrides '{"version": "'"${JAVA17_IMAGE_VERSION}"'"}' --overrides '{"name": "'"${PROD_NAMESPACE:=ibmcom}/websphere-liberty-s2i"'"}' docker
popd

echo "Building Java 17 Runtime Image"
pushd ${SCRIPT_DIR}/images/java17/runtime
cekit build --overrides '{"from": "'"${JAVA17_BASE_IMAGE_NAME}"'"}' --overrides '{"version": "'"${JAVA17_RUNTIME_IMAGE_VERSION}"'"}' --overrides '{"name": "'"${PROD_NAMESPACE:=ibmcom}/websphere-liberty-s2i"'"}' docker
popd

# Test Java 17 image if TEST_MODE is set
if [[ ! -z "${TEST_MODE:-}" ]]; then
echo "Testing versions ${JAVA17_IMAGE_VERSION} and ${JAVA17_RUNTIME_IMAGE_VERSION}"
IMAGE_VERSION=${JAVA17_IMAGE_VERSION}; RUNTIME_IMAGE_VERSION=${JAVA17_RUNTIME_IMAGE_VERSION}; . ${SCRIPT_DIR}/test/run
fi

52 changes: 52 additions & 0 deletions images/java17/builder/image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
schema_version: 1

name: ibmcom/websphere-liberty-s2i
version: 23.0.0.1-java17
from: ibmcom/websphere-liberty:23.0.0.1-full-java17-openj9-ubi
description: "IBM WebSphere Liberty UBI image with OpenJDK17"
labels:
- name: io.k8s.description
value: "IBM WebSphere Liberty S2I Image"
- name: io.k8s.display-name
value: "IBM WebSphere Liberty S2I Builder"
- name: io.openshift.tags
value: "runner,builder,javaee"
- name: io.openshift.s2i.scripts-url
value: image:///usr/local/s2i
- name: io.s2i.scripts-url
value: image:///usr/local/s2i
- name: io.openshift.expose-services
value: "9080/tcp:http, 9443/tcp:https"
- name: io.openshift.s2i.destination
value: "/tmp"

envs:
- name: STI_SCRIPTS_PATH
value: "/usr/local/s2i"
- name: WORKDIR
value: "/tmp/installables"
- name: S2I_DESTINATION
value: "/tmp"
- name: JAVA_HOME
value: /opt/java/openjdk
- name: PATH
value: /opt/java/openjdk/bin:$PATH

packages:
manager: microdnf

modules:
repositories:
- path: ../../../modules

# Install selected modules (in order)
install:
- name: maven
- name: websphere-s2i

run:
user: 1001
workdir: /tmp/installables
cmd:
- "/liberty/wlp/bin/server run defaultServer"

51 changes: 51 additions & 0 deletions images/java17/runtime/image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
schema_version: 1

name: ibmcom/websphere-liberty-s2i
version: 23.0.0.1-runtime-java17
from: ibmcom/websphere-liberty:23.0.0.1-full-java17-openj9-ubi
description: "IBM WebSphere Liberty UBI runtime image with OpenJDK 17"
labels:
- name: io.k8s.description
value: "IBM WebSphere Liberty S2I Image"
- name: io.k8s.display-name
value: "IBM WebSphere Liberty S2I Builder"
- name: io.openshift.tags
value: "runner,javaee"
- name: io.openshift.s2i.scripts-url
value: image:///usr/local/s2i
- name: io.s2i.scripts-url
value: image:///usr/local/s2i
- name: io.openshift.expose-services
value: "9080/tcp:http, 9443/tcp:https"
- name: io.openshift.s2i.destination
value: "/tmp"

envs:
- name: STI_SCRIPTS_PATH
value: "/usr/local/s2i"
- name: WORKDIR
value: "/tmp/installables"
- name: S2I_DESTINATION
value: "/tmp"
- name: JAVA_HOME
value: /opt/java/openjdk
- name: PATH
value: /opt/java/openjdk/bin:$PATH

packages:
manager: microdnf

modules:
repositories:
- path: ../../../modules

# Install selected modules (in order)
install:
- name: websphere-s2i

run:
user: 1001
workdir: /tmp/installables
cmd:
- "/liberty/wlp/bin/server run defaultServer"

2 changes: 1 addition & 1 deletion test/test-app-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<version>3.3.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<outputDirectory>target</outputDirectory>
Expand Down
2 changes: 1 addition & 1 deletion test/test-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<version>3.3.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<outputDirectory>target</outputDirectory>
Expand Down

0 comments on commit 6fefd1d

Please sign in to comment.