Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Java 21 support #377

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/quarkus-ecosystem-test
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ run_build() {
echo "Running build for Java 17"
echo "JAVA_HOME=${JAVA_HOME}"
run_build 17

# Now do it again for Java 21
JAVA_HOME=../${JAVA_21_PATH}
echo "Running build for Java 21"
echo "JAVA_HOME=${JAVA_HOME}"
run_build 21
18 changes: 12 additions & 6 deletions .github/workflows/build-push-container-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Build and Push Container images

env:
IMAGE_BASE_NAME: "quay.io/quarkus-super-heroes"
MANDREL_IMAGE: "quay.io/quarkus/ubi-quarkus-mandrel-builder-image"
MANDREL_VERSION: "23.0"
GRAALVM_IMAGE: "quay.io/quarkus/ubi-quarkus-mandrel-builder-image"
LATEST_IMAGE_TAG: "latest"

on:
Expand All @@ -28,6 +27,7 @@ jobs:
matrix:
java:
- '17'
- '21'
project:
- event-statistics
- rest-fights
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
fail-fast: false
matrix:
java:
- '17'
- '21'
project:
- event-statistics
- rest-fights
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
-Dmaven.compiler.release=${{ matrix.java }} \
-Dquarkus.http.host=0.0.0.0 \
-Dquarkus.native.container-build=true \
-Dquarkus.native.builder-image=${{ env.MANDREL_IMAGE }}:${{ env.MANDREL_VERSION }}-java${{ matrix.java }} \
-Dquarkus.native.builder-image=${{ env.GRAALVM_IMAGE }}:jdk-${{ matrix.java }} \
-Dquarkus.native.container-runtime-options=--platform=linux/${{ matrix.arch }} \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.push=false \
Expand All @@ -204,6 +204,7 @@ jobs:
matrix:
java:
- '17'
- '21'
kind:
- ""
- "native-"
Expand All @@ -218,10 +219,12 @@ jobs:
arch:
- amd64
- arm64
# Until https://github.com/microsoft/semantic-kernel/issues/2885 is resolved
exclude:
# Until https://github.com/microsoft/semantic-kernel/issues/2885 is resolved
- project: rest-narration
kind: "native-"
- java: 17
kind: "native-"
name: "Push app images (${{ matrix.arch }}-${{ matrix.project }}-${{ matrix.kind }}java${{ matrix.java }})"
steps:
- name: Calculate Branch (workflow_run event)
Expand Down Expand Up @@ -312,6 +315,7 @@ jobs:
matrix:
java:
- '17'
- '21'
kind:
- ""
- "native-"
Expand All @@ -323,10 +327,12 @@ jobs:
- rest-narration
- grpc-locations
- ui-super-heroes
# Until https://github.com/microsoft/semantic-kernel/issues/2885 is resolved
exclude:
# Until https://github.com/microsoft/semantic-kernel/issues/2885 is resolved
- project: rest-narration
kind: "native-"
- java: 17
kind: "native-"
name: Create app multiarch manifests (${{ matrix.project }}-${{ matrix.kind }}java${{ matrix.java }})
steps:
- name: Calculate Branch (workflow_run event)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-deploy-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
java-version: 21
distribution: temurin
cache: maven

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/quarkus-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ env:
ECOSYSTEM_CI_REPO: quarkusio/quarkus-ecosystem-ci
ECOSYSTEM_CI_REPO_FILE: context.yaml
ECOSYSTEM_CI_REPO_PATH: quarkus-super-heroes
JAVA_21_DOWNLOAD_URL: https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_x64_linux_hotspot_21.0.1_12.tar.gz
JAVA_21_PATH: jdk-21.0.1+12

jobs:
build:
Expand All @@ -23,6 +25,9 @@ jobs:
with:
java-version: 17
distribution: temurin

- name: Set up Java 21
run: wget -c ${{ env.JAVA_21_DOWNLOAD_URL }} -O - | tar -xz

- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -41,3 +46,4 @@ jobs:
ECOSYSTEM_CI_TOKEN: ${{ secrets.ECOSYSTEM_CI_TOKEN }}
QUARKUS_VERSION_POM_PATH: rest-fights
QUARKUS_VERSION_POM_PROPERTY: quarkus.platform.version
JAVA_21_PATH: ${{ env.JAVA_21_PATH }}
32 changes: 15 additions & 17 deletions .github/workflows/simple-build-test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Basic build and test

env:
MANDREL_VERSION: "23.0.1.2-Final"

on:
push:
paths-ignore:
Expand Down Expand Up @@ -56,6 +53,7 @@ jobs:
matrix:
java:
- '17'
- '21'
project:
- event-statistics
- rest-fights
Expand Down Expand Up @@ -89,7 +87,7 @@ jobs:
fail-fast: false
matrix:
java:
- '17'
- { graal: '23.1.1.0', java: '21'}
project:
- event-statistics
- rest-fights
Expand All @@ -103,32 +101,32 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Cache and restore Mandrel distro
id: check-mandrel-cache
- name: Cache and restore GraalVM (${{ matrix.java.graal }})
id: check-graal-cache
uses: actions/cache@v3
with:
path: mandrel-${{ env.MANDREL_VERSION }}-${{ matrix.java }}.tar.gz
key: mandrel-distro-${{ env.MANDREL_VERSION }}-${{ matrix.java }}
path: mandrel-java${{ matrix.java.java}}-linux-amd64-${{ matrix.java.graal }}-Final.tar.gz
key: mandrel-distro-${{ matrix.java.graal }}

- name: Download Mandrel
if: steps.check-mandrel-cache.outputs.cache-hit != 'true'
- name: Download GraalVM ${{ matrix.java.graal }}
if: steps.check-graal-cache.outputs.cache-hit != 'true'
run: |
download_url="https://github.com/graalvm/mandrel/releases/download/mandrel-${MANDREL_VERSION}/mandrel-java${{ matrix.java }}-linux-amd64-${MANDREL_VERSION}.tar.gz"
wget -q -O mandrel-${{ env.MANDREL_VERSION }}-${{ matrix.java }}.tar.gz $download_url
download_url="https://github.com/graalvm/mandrel/releases/download/mandrel-${{ matrix.java.graal }}-Final/mandrel-java${{ matrix.java.java }}-linux-amd64-${{ matrix.java.graal }}-Final.tar.gz"
wget -q -O mandrel-java${{ matrix.java.java }}-linux-amd64-${{ matrix.java.graal }}-Final.tar.gz $download_url

- name: Setup Maven+OpenJDK Distro
- name: Setup GraalVM CE ${{ matrix.java.graal }} distro
uses: actions/setup-java@v3
with:
distribution: 'jdkfile'
jdkFile: mandrel-${{ env.MANDREL_VERSION }}-${{ matrix.java }}.tar.gz
java-version: ${{ matrix.java }}
jdkFile: mandrel-java${{ matrix.java.java }}-linux-amd64-${{ matrix.java.graal }}-Final.tar.gz
java-version: ${{ matrix.java.java }}
architecture: x64
cache: maven

- name: "build-test-native-${{ matrix.project }}-java-${{ matrix.java }}"
- name: "build-test-native-${{ matrix.project }}-java-${{ matrix.java.java }}"
working-directory: ${{ matrix.project }}
run: |
./mvnw -B clean verify -Pnative \
-Dquarkus.http.host=0.0.0.0 \
-Dmaven.compiler.release=${{ matrix.java }}
-Dmaven.compiler.release=${{ matrix.java.java }}

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Pick one of the 4 versions of the application from the table below and execute t
| Description | Image Tag | Docker Compose Run Command | Docker Compose Run Command with Monitoring |
|-------------|-----------------|--------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| JVM Java 17 | `java17-latest` | `docker compose -f deploy/docker-compose/java17.yml up --remove-orphans` | `docker compose -f deploy/docker-compose/java17.yml -f deploy/docker-compose/monitoring.yml up --remove-orphans` |
| JVM Java 21 | `java21-latest` | `docker compose -f deploy/docker-compose/java21.yml up --remove-orphans` | `docker compose -f deploy/docker-compose/java21.yml -f deploy/docker-compose/monitoring.yml up --remove-orphans` |
| Native | `native-latest` | `docker compose -f deploy/docker-compose/native.yml up --remove-orphans` | `docker compose -f deploy/docker-compose/native.yml -f deploy/docker-compose/monitoring.yml up --remove-orphans` |

> [!TIP]
Expand Down Expand Up @@ -131,9 +132,10 @@ Pick one of the 4 versions of the system from the table below and deploy the app
>
> For a production-ready Apicurio Schema Registry, please see the [Apicurio Registry Operator documentation](https://www.apicur.io/registry/docs/apicurio-registry-operator/1.0.0/index.html). You can also try out a [fully hosted and managed Schema Registry service](https://console.redhat.com/application-services/service-registry)!

| Description | Image Tag | OpenShift Descriptor | Minikube Descriptor | Kubernetes Descriptor | Knative Descriptor |
| Description | Image Tag | OpenShift Descriptor | Minikube Descriptor | Kubernetes Descriptor | KNative Descriptor |
|-------------|-----------------|-----------------------------------------------------------|---------------------------------------------------------|-------------------------------------------------------------|-------------------------------------------------------|
| JVM Java 17 | `java17-latest` | [`java17-openshift.yml`](deploy/k8s/java17-openshift.yml) | [`java17-minikube.yml`](deploy/k8s/java17-minikube.yml) | [`java17-kubernetes.yml`](deploy/k8s/java17-kubernetes.yml) | [`java17-knative.yml`](deploy/k8s/java17-knative.yml) |
| JVM Java 21 | `java21-latest` | [`java21-openshift.yml`](deploy/k8s/java21-openshift.yml) | [`java21-minikube.yml`](deploy/k8s/java21-minikube.yml) | [`java21-kubernetes.yml`](deploy/k8s/java21-kubernetes.yml) | [`java21-knative.yml`](deploy/k8s/java21-knative.yml) |
| Native | `native-latest` | [`native-openshift.yml`](deploy/k8s/native-openshift.yml) | [`native-minikube.yml`](deploy/k8s/native-minikube.yml) | [`native-kubernetes.yml`](deploy/k8s/native-kubernetes.yml) | [`native-knative.yml`](deploy/k8s/native-knative.yml) |

### Monitoring
Expand Down
24 changes: 15 additions & 9 deletions event-statistics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ By default, the application is configured with the following:
## Running Locally via Docker Compose
Pre-built images for this application can be found at [`quay.io/quarkus-super-heroes/event-statistics`](https://quay.io/repository/quarkus-super-heroes/event-statistics?tab=tags).

Pick one of the 4 versions of the application from the table below and execute the appropriate docker compose command from the `quarkus-super-heroes/event-statistics` directory.
Pick one of the versions of the application from the table below and execute the appropriate docker compose command from the `quarkus-super-heroes/event-statistics` directory.

> [!NOTE]
> You may see errors as the applications start up. This may happen if an application completes startup before one if its required services (i.e. database, kafka, etc). This is fine. Once everything completes startup things will work fine.

| Description | Image Tag | Docker Compose Run Command |
|-------------|-----------------|--------------------------------------------------------------------------|
| JVM Java 17 | `java17-latest` | `docker compose -f deploy/docker-compose/java17.yml up --remove-orphans` |
| JVM Java 21 | `java21-latest` | `docker compose -f deploy/docker-compose/java21.yml up --remove-orphans` |
| Native | `native-latest` | `docker compose -f deploy/docker-compose/native.yml up --remove-orphans` |

These Docker Compose files are meant for standing up this application and the required Kafka broker only. If you want to stand up the entire system, [follow these instructions](../README.md#running-locally-via-docker-compose).
Expand All @@ -109,11 +110,12 @@ Deployment descriptors for these images are provided in the [`deploy/k8s`](deplo
> [!NOTE]
> The [Knative](https://knative.dev/docs/) variant can be used on any Knative installation that runs on top of Kubernetes or OpenShift. For OpenShift, you need [OpenShift Serverless](https://docs.openshift.com/serverless/latest/about/about-serverless.html) installed from the OpenShift operator catalog. Using Knative has the benefit that services are scaled down to zero replicas when they are not used.

Pick one of the 4 versions of the application from the table below and deploy the appropriate descriptor from the [`deploy/k8s` directory](deploy/k8s).
Pick one of the versions of the application from the table below and deploy the appropriate descriptor from the [`deploy/k8s` directory](deploy/k8s).

| Description | Image Tag | OpenShift Descriptor | Minikube Descriptor | Kubernetes Descriptor | Knative Descriptor |
|-------------|-----------------|-----------------------------------------------------------|---------------------------------------------------------|-------------------------------------------------------------|-------------------------------------------------------|
| JVM Java 17 | `java17-latest` | [`java17-openshift.yml`](deploy/k8s/java17-openshift.yml) | [`java17-minikube.yml`](deploy/k8s/java17-minikube.yml) | [`java17-kubernetes.yml`](deploy/k8s/java17-kubernetes.yml) | [`java17-knative.yml`](deploy/k8s/java17-knative.yml) |
| JVM Java 21 | `java21-latest` | [`java21-openshift.yml`](deploy/k8s/java21-openshift.yml) | [`java21-minikube.yml`](deploy/k8s/java21-minikube.yml) | [`java21-kubernetes.yml`](deploy/k8s/java21-kubernetes.yml) | [`java21-knative.yml`](deploy/k8s/java21-knative.yml) |
| Native | `native-latest` | [`native-openshift.yml`](deploy/k8s/native-openshift.yml) | [`native-minikube.yml`](deploy/k8s/native-minikube.yml) | [`native-kubernetes.yml`](deploy/k8s/native-kubernetes.yml) | [`native-knative.yml`](deploy/k8s/native-knative.yml) |

The application is exposed outside of the cluster on port `80`.
Expand All @@ -126,13 +128,17 @@ Following the [deployment section](https://quarkus.io/guides/deploying-to-kubern
> [!NOTE]
> For non-OpenShift or minikube Kubernetes variants, you will most likely need to [push the image to a container registry](https://quarkus.io/guides/container-image#pushing) by adding the `-Dquarkus.container-image.push=true` flag, as well as setting the `quarkus.container-image.registry`, `quarkus.container-image.group`, and/or the `quarkus.container-image.name` properties to different values.

| Target Platform | Java Version | Command |
|------------------------|:------------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Kubernetes | 17 | `./mvnw clean package -Dquarkus.profile=kubernetes -Dquarkus.kubernetes.deploy=true -DskipTests` |
| OpenShift | 17 | `./mvnw clean package -Dquarkus.profile=openshift -Dquarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000 -Dquarkus.container-image.group=$(oc project -q) -Dquarkus.kubernetes.deploy=true -DskipTests` |
| Minikube | 17 | `./mvnw clean package -Dquarkus.profile=minikube -Dquarkus.kubernetes.deploy=true -DskipTests` |
| Knative | 17 | `./mvnw clean package -Dquarkus.profile=knative -Dquarkus.kubernetes.deploy=true -DskipTests` |
| Knative (on OpenShift) | 17 | `./mvnw clean package -Dquarkus.profile=knative-openshift -Dquarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000 -Dquarkus.container-image.group=$(oc project -q) -Dquarkus.kubernetes.deploy=true -DskipTests` |
| Target Platform | Java Version | Command |
|------------------------|:------------:|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Kubernetes | 17 | `./mvnw clean package -Dquarkus.profile=kubernetes -Dquarkus.kubernetes.deploy=true -DskipTests` |
| Kubernetes | 21 | `./mvnw clean package -Dquarkus.profile=kubernetes-21 -Dquarkus.kubernetes.deploy=true -DskipTests` |
| OpenShift | 17 | `./mvnw clean package -Dquarkus.profile=openshift -Dquarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000 -Dquarkus.container-image.group=$(oc project -q) -Dquarkus.kubernetes.deploy=true -DskipTests` |
| OpenShift | 21 | `./mvnw clean package -Dquarkus.profile=openshift-21 -Dquarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000 -Dquarkus.container-image.group=$(oc project -q) -Dquarkus.kubernetes.deploy=true -DskipTests` |
| Minikube | 17 | `./mvnw clean package -Dquarkus.profile=minikube -Dquarkus.kubernetes.deploy=true -DskipTests` |
| Minikube | 21 | `./mvnw clean package -Dquarkus.profile=minikube-21 -Dquarkus.kubernetes.deploy=true -DskipTests` |
| Knative | 17 | `./mvnw clean package -Dquarkus.profile=knative -Dquarkus.kubernetes.deploy=true -DskipTests` |
| Knative (on OpenShift) | 17 | `./mvnw clean package -Dquarkus.profile=knative-openshift -Dquarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000 -Dquarkus.container-image.group=$(oc project -q) -Dquarkus.kubernetes.deploy=true -DskipTests` |
| Knative (on OpenShift) | 21 | `./mvnw clean package -Dquarkus.profile=knative-openshift-21 -Dquarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000 -Dquarkus.container-image.group=$(oc project -q) -Dquarkus.kubernetes.deploy=true -DskipTests` |

You may need to adjust other configuration options as well (see [Quarkus Kubernetes Extension configuration options](https://quarkus.io/guides/deploying-to-kubernetes#configuration-options) and [Quarkus OpenShift Extension configuration options](https://quarkus.io/guides/deploying-to-openshift#configuration-reference)).

Expand Down
Loading