diff --git a/.github/workflows/build-push-container-images.yml b/.github/workflows/build-push-container-images.yml index 4d2922aea4..74d257ed79 100644 --- a/.github/workflows/build-push-container-images.yml +++ b/.github/workflows/build-push-container-images.yml @@ -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-graalvmce-builder-image" LATEST_IMAGE_TAG: "latest" on: @@ -28,6 +27,7 @@ jobs: matrix: java: - '17' + - '21' project: - event-statistics - rest-fights @@ -62,7 +62,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} - distribution: temurin + distribution: zulu cache: maven - name: Create env vars @@ -115,7 +115,7 @@ jobs: fail-fast: false matrix: java: - - '17' + - '21' project: - event-statistics - rest-fights @@ -151,7 +151,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} - distribution: temurin + distribution: zulu cache: maven - name: Create env vars @@ -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 \ @@ -204,6 +204,7 @@ jobs: matrix: java: - '17' + - '21' kind: - "" - "native-" @@ -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) @@ -312,6 +315,7 @@ jobs: matrix: java: - '17' + - '21' kind: - "" - "native-" @@ -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) diff --git a/.github/workflows/simple-build-test.yml b/.github/workflows/simple-build-test.yml index 14cd624aa0..24c3c16137 100644 --- a/.github/workflows/simple-build-test.yml +++ b/.github/workflows/simple-build-test.yml @@ -1,8 +1,5 @@ name: Basic build and test -env: - MANDREL_VERSION: "23.0.1.2-Final" - on: push: paths-ignore: @@ -56,6 +53,7 @@ jobs: matrix: java: - '17' + - '21' project: - event-statistics - rest-fights @@ -72,7 +70,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: ${{ matrix.java }} - distribution: temurin + distribution: zulu cache: maven - name: "build-test-jvm-${{ matrix.project }}-java-${{ matrix.java }}" @@ -89,7 +87,8 @@ jobs: fail-fast: false matrix: java: - - '17' + - { graal: '17.0.8', java: '17' } + - { graal: '21.0.0', java: '21'} project: - event-statistics - rest-fights @@ -103,25 +102,25 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Cache and restore Mandrel distro - id: check-mandrel-cache + - name: Cache and restore GraalVM CE (${{ 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: graalvm-community-jdk-${{ matrix.java.graal }}_linux-x64_bin.tar.gz + key: graal-distro-${{ matrix.java.graal }} - - name: Download Mandrel - if: steps.check-mandrel-cache.outputs.cache-hit != 'true' + - name: Download GraalVM CE ${{ 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/graalvm-ce-builds/releases/download/jdk-${{ matrix.java.graal }}/graalvm-community-jdk-${{ matrix.java.graal }}_linux-x64_bin.tar.gz" + wget -q -O graalvm-community-jdk-${{ matrix.java.graal }}_linux-x64_bin.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: graalvm-community-jdk-${{ matrix.java.graal }}_linux-x64_bin.tar.gz + java-version: ${{ matrix.java.java }} architecture: x64 cache: maven diff --git a/README.md b/README.md index a29257c6d6..992e659826 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This is a sample application demonstrating Quarkus features and best practices. The application allows superheroes to fight against supervillains. The application consists of several microservices, communicating either synchronously via REST or asynchronously using Kafka. All the data used by the applications are [on the `characterdata` branch](https://github.com/quarkusio/quarkus-super-heroes/tree/characterdata) of this repository. -The base JVM version for all the applications is Java 17. +The base JVM version for all the applications is Java 17 but Java 21 is also supported. - [Super Hero Battle UI](ui-super-heroes) - An Angular application to pick up a random superhero, a random supervillain, and makes them fight. @@ -86,6 +86,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` | > **NOTE:** If your system does not have the `compose` sub-command, you can try the above commands with the `docker-compose` command instead of `docker compose`. @@ -124,6 +125,7 @@ Pick one of the 4 versions of the system from the table below and deploy the app | 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 diff --git a/event-statistics/README.md b/event-statistics/README.md index ee89d63263..4a7799fe29 100644 --- a/event-statistics/README.md +++ b/event-statistics/README.md @@ -84,13 +84,14 @@ 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). @@ -105,11 +106,12 @@ Pre-built images for this application can be found at [`quay.io/quarkus-super-he Deployment descriptors for these images are provided in the [`deploy/k8s`](deploy/k8s) directory. There are versions for [OpenShift](https://www.openshift.com), [Minikube](https://quarkus.io/guides/deploying-to-kubernetes#deploying-to-minikube), [Kubernetes](https://www.kubernetes.io), and [KNative](https://knative.dev). -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`. @@ -121,13 +123,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)). diff --git a/event-statistics/src/main/docker-compose/java21.yml b/event-statistics/src/main/docker-compose/java21.yml new file mode 100644 index 0000000000..0603953548 --- /dev/null +++ b/event-statistics/src/main/docker-compose/java21.yml @@ -0,0 +1,26 @@ + + event-statistics-java21: + image: quay.io/quarkus-super-heroes/event-statistics:java21-latest + container_name: event-statistics-java21 + depends_on: + - apicurio + - fights-kafka + ports: + - "8085:8085" + environment: + KAFKA_BOOTSTRAP_SERVERS: PLAINTEXT://fights-kafka:9092 + MP_MESSAGING_CONNECTOR_SMALLRYE_KAFKA_APICURIO_REGISTRY_URL: http://apicurio:8086/apis/registry/v2 + QUARKUS_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: http://otel-collector:4317 + restart: on-failure + networks: + default: + aliases: + - event-statistics + deploy: + resources: + limits: + memory: 1G + cpus: '1' + reservations: + memory: 256M + cpus: '0.5' diff --git a/event-statistics/src/main/docker/Dockerfile.jvm21 b/event-statistics/src/main/docker/Dockerfile.jvm21 new file mode 100644 index 0000000000..312cd10a6b --- /dev/null +++ b/event-statistics/src/main/docker/Dockerfile.jvm21 @@ -0,0 +1,18 @@ +# TODO: This needs to be fixed to look more like Dockerfile.jvm once the Temurin builds are out +FROM azul/zulu-openjdk:21-jre + +RUN mkdir -p /deployments/lib && \ + mkdir -p /deployments/app && \ + mkdir -p /deployments/quarkus + +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' + +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY target/quarkus-app/lib/ /deployments/lib/ +COPY target/quarkus-app/*.jar /deployments/ +COPY target/quarkus-app/app/ /deployments/app/ +COPY target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8085 + +ENTRYPOINT ["java", "-jar", "/deployments/quarkus-run.jar", "-Dquarkus.http.host=0.0.0.0", "-Djava.util.logging.manager=org.jboss.logmanager.LogManager"] diff --git a/event-statistics/src/main/kubernetes/openshift.yml b/event-statistics/src/main/kubernetes/openshift.yml index c4f7b3b219..5c8cef0dbd 100644 --- a/event-statistics/src/main/kubernetes/openshift.yml +++ b/event-statistics/src/main/kubernetes/openshift.yml @@ -36,6 +36,14 @@ spec: importPolicy: { } referencePolicy: type: Source + - name: java21-latest + annotations: null + from: + kind: DockerImage + name: 'quay.io/quarkus-super-heroes/event-statistics:java21-latest' + importPolicy: { } + referencePolicy: + type: Source - name: native-latest annotations: null from: diff --git a/event-statistics/src/main/resources/application.properties b/event-statistics/src/main/resources/application.properties index 08216773ac..6733994aa5 100644 --- a/event-statistics/src/main/resources/application.properties +++ b/event-statistics/src/main/resources/application.properties @@ -29,10 +29,15 @@ quarkus.container-image.builder=docker quarkus.container-image.registry=quay.io quarkus.container-image.group=quarkus-super-heroes quarkus.container-image.name=${quarkus.application.name} +paths.dockerfile.jvm-21=src/main/docker/Dockerfile.jvm21 +#TODO Need to update this when the RH openjdk-21 image comes out +paths.base-image.jvm-21=azul/zulu-openjdk:21-jre # Kubernetes %kubernetes.quarkus.config.profile.parent=prod %kubernetes.quarkus.kubernetes.deployment-target=kubernetes +%kubernetes-21.quarkus.config.profile.parent=kubernetes +%kubernetes-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} quarkus.kubernetes.part-of=event-stats quarkus.kubernetes.annotations."app.openshift.io/connects-to"=fights-kafka,apicurio,otel-collector quarkus.kubernetes.env.configmaps=${quarkus.application.name}-config @@ -45,7 +50,11 @@ quarkus.kubernetes.labels.system=quarkus-super-heroes %openshift.quarkus.config.profile.parent=prod %openshift.quarkus.kubernetes.deployment-target=openshift %openshift.quarkus.container-image.builder=openshift -quarkus.openshift.base-jvm-image=registry.access.redhat.com/ubi9/openjdk-17:1.14 +%openshift-21.quarkus.config.profile.parent=openshift +%openshift-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} +%openshift-21.quarkus.openshift.jvm-dockerfile=${paths.dockerfile.jvm-21} +%openshift-21.quarkus.openshift.base-jvm-image=${paths.base-image.jvm-21} +quarkus.openshift.base-jvm-image=azul/zulu-openjdk:21-jre quarkus.openshift.base-native-image=quay.io/quarkus/ubi-quarkus-native-binary-s2i:2.0 quarkus.openshift.route.expose=true quarkus.openshift.annotations."app.openshift.io/connects-to"=fights-kafka,apicurio,otel-collector @@ -56,6 +65,8 @@ quarkus.openshift.labels.system=${quarkus.kubernetes.labels.system} # KNative %knative.quarkus.config.profile.parent=prod %knative.quarkus.kubernetes.deployment-target=knative +%knative-21.quarkus.config.profile.parent=knative +%knative-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} quarkus.knative.annotations."app.openshift.io/connects-to"=fights-kafka,apicurio,otel-collector quarkus.knative.labels.app=${quarkus.kubernetes.labels.app} quarkus.knative.labels.application=${quarkus.kubernetes.labels.application} @@ -64,7 +75,13 @@ quarkus.knative.labels.system=${quarkus.kubernetes.labels.system} # KNative on OpenShift %knative-openshift.quarkus.config.profile.parent=knative %knative-openshift.quarkus.container-image.builder=openshift +%knative-openshift-21.quarkus.config.profile.parent=knative-openshift +%knative-openshift-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} +%knative-openshift-21.quarkus.openshift.jvm-dockerfile=${paths.dockerfile.jvm-21} +%knative-openshift-21.quarkus.openshift.base-jvm-image=${paths.base-image.jvm-21} # Minikube %minikube.quarkus.config.profile.parent=prod %minikube.quarkus.kubernetes.deployment-target=minikube +%minikube-21.quarkus.config.profile.parent=minikube +%minikube-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} diff --git a/rest-fights/README.md b/rest-fights/README.md index 1480fbf1bb..7db004fb8b 100644 --- a/rest-fights/README.md +++ b/rest-fights/README.md @@ -157,33 +157,36 @@ By default, the application is configured with the following: Pre-built images for this application can be found at [`quay.io/quarkus-super-heroes/rest-fights`](https://quay.io/repository/quarkus-super-heroes/rest-fights?tab=tags). ### Only Fights Service -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/rest-fights` 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/rest-fights` 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 | `java17-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` | ### Fights Service and all Downstream Dependencies -The above Docker Compose files are meant for standing up this application and the required database, Kafka broker, and Apicurio Schema Registry only. If you want to stand up this application and its downstream services ([rest-villains](../rest-villains), [rest-heroes](../rest-heroes), & [rest-narration](../rest-narration)), pick one of the 4 versions from the table below and execute the appropriate docker compose command from the `quarkus-super-heroes/rest-fights` directory. +The above Docker Compose files are meant for standing up this application and the required database, Kafka broker, and Apicurio Schema Registry only. If you want to stand up this application and its downstream services ([rest-villains](../rest-villains), [rest-heroes](../rest-heroes), & [rest-narration](../rest-narration)), pick one of the versions from the table below and execute the appropriate docker compose command from the `quarkus-super-heroes/rest-fights` 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-all-downstream.yml up --remove-orphans` | +| JVM Java 21 | `java21-latest` | `docker compose -f deploy/docker-compose/java21-all-downstream.yml up --remove-orphans` | | Native | `native-latest` | `docker compose -f deploy/docker-compose/native-all-downstream.yml up --remove-orphans` | ### Only Downstream Dependencies -If you want to develop the Fights service (i.e. via [Quarkus Dev Mode](https://quarkus.io/guides/maven-tooling#dev-mode)) but want to stand up just it's downstream services ([rest-villains](../rest-villains), [rest-heroes](../rest-heroes), & [rest-narration](../rest-narration)), pick one of the 4 versions from the table below and execute the appropriate docker compose command from the `quarkus-super-heroes` directory. +If you want to develop the Fights service (i.e. via [Quarkus Dev Mode](https://quarkus.io/guides/maven-tooling#dev-mode)) but want to stand up just it's downstream services ([rest-villains](../rest-villains), [rest-heroes](../rest-heroes), & [rest-narration](../rest-narration)), pick one of the versions from the table below and execute the appropriate docker compose command from the `quarkus-super-heroes` 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 rest-heroes/deploy/docker-compose/java17.yml -f rest-villains/deploy/docker-compose/java17.yml -f rest-narration/deploy/docker-compose/java17.yml up --remove-orphans` | +| JVM Java 21 | `java21-latest` | `docker compose -f rest-heroes/deploy/docker-compose/java21.yml -f rest-villains/deploy/docker-compose/java21.yml -f rest-narration/deploy/docker-compose/java21.yml up --remove-orphans` | | Native | `native-latest` | `docker compose -f rest-heroes/deploy/docker-compose/native.yml -f rest-villains/deploy/docker-compose/native.yml -f rest-narration/deploy/docker-compose/native.yml up --remove-orphans` | If you want to stand up the entire system, [follow these instructions](../README.md#running-locally-via-docker-compose). @@ -198,20 +201,22 @@ Pre-built images for this application can be found at [`quay.io/quarkus-super-he Deployment descriptors for these images are provided in the [`deploy/k8s`](deploy/k8s) directory. There are versions for [OpenShift](https://www.openshift.com), [Minikube](https://quarkus.io/guides/deploying-to-kubernetes#deploying-to-minikube), [Kubernetes](https://www.kubernetes.io), and [KNative](https://knative.dev). -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`. -These are only the descriptors for this application and the required database, Kafka broker, and Apicurio Schema Registry only. If you want to deploy this application and its downstream services ([rest-villains](../rest-villains), [rest-heroes](../rest-heroes), & [rest-narration](../rest-narration)), pick one of the 4 versions of the application from the table below and deploy the appropriate descriptor from the [`rest-fights/deploy/k8s` directory](deploy/k8s). +These are only the descriptors for this application and the required database, Kafka broker, and Apicurio Schema Registry only. If you want to deploy this application and its downstream services ([rest-villains](../rest-villains), [rest-heroes](../rest-heroes), & [rest-narration](../rest-narration)), pick one of the versions of the application from the table below and deploy the appropriate descriptor from the [`rest-fights/deploy/k8s` directory](deploy/k8s). | Description | Image Tag | OpenShift Descriptor | Minikube Descriptor | Kubernetes Descriptor | KNative Descriptor | |-------------|-----------------|-----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------| | JVM Java 17 | `java17-latest` | [`java17-openshift-all-downstream.yml`](deploy/k8s/java17-openshift-all-downstream.yml) | [`java17-minikube-all-downstream.yml`](deploy/k8s/java17-minikube-all-downstream.yml) | [`java17-kubernetes-all-downstream.yml`](deploy/k8s/java17-kubernetes-all-downstream.yml) | [`java17-knative-all-downstream.yml`](deploy/k8s/java17-knative-all-downstream.yml) | +| JVM Java 21 | `java21-latest` | [`java21-openshift-all-downstream.yml`](deploy/k8s/java21-openshift-all-downstream.yml) | [`java21-minikube-all-downstream.yml`](deploy/k8s/java21-minikube-all-downstream.yml) | [`java21-kubernetes-all-downstream.yml`](deploy/k8s/java21-kubernetes-all-downstream.yml) | [`java21-knative-all-downstream.yml`](deploy/k8s/java21-knative-all-downstream.yml) | | Native | `native-latest` | [`native-openshift-all-downstream.yml`](deploy/k8s/native-openshift-all-downstream.yml) | [`native-minikube-all-downstream.yml`](deploy/k8s/native-minikube-all-downstream.yml) | [`native-kubernetes-all-downstream.yml`](deploy/k8s/native-kubernetes-all-downstream.yml) | [`native-knative-all-downstream.yml`](deploy/k8s/native-knative-all-downstream.yml) | Each application is exposed outside of the cluster on port `80`. @@ -223,13 +228,18 @@ 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 | 21 | `./mvnw clean package -Dquarkus.profile=knative-21 -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)). diff --git a/rest-fights/src/main/docker-compose/java21.yml b/rest-fights/src/main/docker-compose/java21.yml new file mode 100644 index 0000000000..73d618f75b --- /dev/null +++ b/rest-fights/src/main/docker-compose/java21.yml @@ -0,0 +1,37 @@ + + rest-fights-java21: + image: quay.io/quarkus-super-heroes/rest-fights:java21-latest + container_name: rest-fights-java21 + depends_on: + - fights-db + - apicurio + - fights-kafka + - rest-heroes-java21 + - rest-villains-java21 + - rest-narration-java21 + ports: + - "8082:8082" + environment: + QUARKUS_MONGODB_HOSTS: fights-db:27017 + KAFKA_BOOTSTRAP_SERVERS: PLAINTEXT://fights-kafka:9092 + QUARKUS_LIQUIBASE_MONGODB_MIGRATE_AT_START: "false" + QUARKUS_MONGODB_CREDENTIALS_USERNAME: superfight + QUARKUS_MONGODB_CREDENTIALS_PASSWORD: superfight + QUARKUS_STORK_HERO_SERVICE_SERVICE_DISCOVERY_ADDRESS_LIST: rest-heroes:8083 + QUARKUS_STORK_VILLAIN_SERVICE_SERVICE_DISCOVERY_ADDRESS_LIST: rest-villains:8084 + QUARKUS_STORK_NARRATION_SERVICE_SERVICE_DISCOVERY_ADDRESS_LIST: rest-narration:8087 + MP_MESSAGING_CONNECTOR_SMALLRYE_KAFKA_APICURIO_REGISTRY_URL: http://apicurio:8086/apis/registry/v2 + QUARKUS_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: http://otel-collector:4317 + restart: on-failure + networks: + default: + aliases: + - rest-fights + deploy: + resources: + limits: + memory: 1G + cpus: '1' + reservations: + memory: 256M + cpus: '0.5' diff --git a/rest-fights/src/main/docker/Dockerfile.jvm21 b/rest-fights/src/main/docker/Dockerfile.jvm21 new file mode 100644 index 0000000000..886ead743c --- /dev/null +++ b/rest-fights/src/main/docker/Dockerfile.jvm21 @@ -0,0 +1,19 @@ +# TODO: This needs to be fixed to look more like Dockerfile.jvm once the Temurin builds are out + +FROM azul/zulu-openjdk:21-jre + +RUN mkdir -p /deployments/lib && \ + mkdir -p /deployments/app && \ + mkdir -p /deployments/quarkus + +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' + +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY target/quarkus-app/lib/ /deployments/lib/ +COPY target/quarkus-app/*.jar /deployments/ +COPY target/quarkus-app/app/ /deployments/app/ +COPY target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8082 + +ENTRYPOINT ["java", "-jar", "/deployments/quarkus-run.jar", "-Dquarkus.http.host=0.0.0.0", "-Djava.util.logging.manager=org.jboss.logmanager.LogManager"] diff --git a/rest-fights/src/main/kubernetes/openshift.yml b/rest-fights/src/main/kubernetes/openshift.yml index abddf44ec8..d0d7d95b89 100644 --- a/rest-fights/src/main/kubernetes/openshift.yml +++ b/rest-fights/src/main/kubernetes/openshift.yml @@ -65,6 +65,14 @@ spec: importPolicy: { } referencePolicy: type: Source + - name: java21-latest + annotations: null + from: + kind: DockerImage + name: 'quay.io/quarkus-super-heroes/rest-fights:java21-latest' + importPolicy: { } + referencePolicy: + type: Source - name: native-latest annotations: null from: diff --git a/rest-fights/src/main/resources/application.properties b/rest-fights/src/main/resources/application.properties index cde2badacf..0af5a00833 100644 --- a/rest-fights/src/main/resources/application.properties +++ b/rest-fights/src/main/resources/application.properties @@ -94,12 +94,17 @@ quarkus.container-image.builder=docker quarkus.container-image.registry=quay.io quarkus.container-image.group=quarkus-super-heroes quarkus.container-image.name=${quarkus.application.name} +paths.dockerfile.jvm-21=src/main/docker/Dockerfile.jvm21 +#TODO Need to update this when the RH openjdk-21 image comes out +paths.base-image.jvm-21=azul/zulu-openjdk:21-jre # Kubernetes quarkus.kubernetes-client.devservices.enabled=false quarkus.kubernetes-client.generate-rbac=false %kubernetes.quarkus.config.profile.parent=prod %kubernetes.quarkus.kubernetes.deployment-target=kubernetes +%kubernetes-21.quarkus.config.profile.parent=kubernetes +%kubernetes-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} quarkus.kubernetes.part-of=fights-service quarkus.kubernetes.externalize-init=false quarkus.kubernetes.env.configmaps=${quarkus.application.name}-config @@ -113,6 +118,10 @@ quarkus.kubernetes.labels.system=quarkus-super-heroes %openshift.quarkus.config.profile.parent=prod %openshift.quarkus.kubernetes.deployment-target=openshift %openshift.quarkus.container-image.builder=openshift +%openshift-21.quarkus.config.profile.parent=openshift +%openshift-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} +%openshift-21.quarkus.openshift.jvm-dockerfile=${paths.dockerfile.jvm-21} +%openshift-21.quarkus.openshift.base-jvm-image=${paths.base-image.jvm-21} quarkus.openshift.base-jvm-image=registry.access.redhat.com/ubi9/openjdk-17:1.14 quarkus.openshift.base-native-image=quay.io/quarkus/ubi-quarkus-native-binary-s2i:2.0 quarkus.openshift.route.expose=true @@ -124,6 +133,8 @@ quarkus.openshift.labels.system=${quarkus.kubernetes.labels.system} # KNative %knative.quarkus.config.profile.parent=prod %knative.quarkus.kubernetes.deployment-target=knative +%knative-21.quarkus.config.profile.parent=knative +%knative-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} quarkus.knative.min-scale=1 quarkus.knative.annotations."app.openshift.io/connects-to"=fights-db,fights-kafka,apicurio,rest-villains,rest-heroes,rest-narration,grpc-locations,otel-collector quarkus.knative.labels.app=${quarkus.kubernetes.labels.app} @@ -133,7 +144,13 @@ quarkus.knative.labels.system=${quarkus.kubernetes.labels.system} # KNative on OpenShift %knative-openshift.quarkus.config.profile.parent=knative %knative-openshift.quarkus.container-image.builder=openshift +%knative-openshift-21.quarkus.config.profile.parent=knative-openshift +%knative-openshift-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} +%knative-openshift-21.quarkus.openshift.jvm-dockerfile=${paths.dockerfile.jvm-21} +%knative-openshift-21.quarkus.openshift.base-jvm-image=${paths.base-image.jvm-21} # Minikube %minikube.quarkus.config.profile.parent=prod %minikube.quarkus.kubernetes.deployment-target=minikube +%minikube-21.quarkus.config.profile.parent=minikube +%minikube-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} diff --git a/rest-heroes/README.md b/rest-heroes/README.md index fea50166e5..ae4557c4f2 100644 --- a/rest-heroes/README.md +++ b/rest-heroes/README.md @@ -81,13 +81,14 @@ The application also contains a simple UI, showing the list of Heroes currently ## Running Locally via Docker Compose Pre-built images for this application can be found at [`quay.io/quarkus-super-heroes/rest-heroes`](https://quay.io/repository/quarkus-super-heroes/rest-heroes?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/rest-heroes` 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/rest-heroes` 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 database only. If you want to stand up the entire system, [follow these instructions](../README.md#running-locally-via-docker-compose). @@ -102,11 +103,12 @@ Pre-built images for this application can be found at [`quay.io/quarkus-super-he Deployment descriptors for these images are provided in the [`deploy/k8s`](deploy/k8s) directory. There are versions for [OpenShift](https://www.openshift.com), [Minikube](https://quarkus.io/guides/deploying-to-kubernetes#deploying-to-minikube), [Kubernetes](https://www.kubernetes.io), and [KNative](https://knative.dev). -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`. @@ -118,13 +120,18 @@ 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 | 21 | `./mvnw clean package -Dquarkus.profile=knative-21 -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)). diff --git a/rest-heroes/src/main/docker-compose/java21.yml b/rest-heroes/src/main/docker-compose/java21.yml new file mode 100644 index 0000000000..e9e3dd9fba --- /dev/null +++ b/rest-heroes/src/main/docker-compose/java21.yml @@ -0,0 +1,28 @@ + + rest-heroes-java21: + image: quay.io/quarkus-super-heroes/rest-heroes:java21-latest + container_name: rest-heroes-java21 + depends_on: + - heroes-db + ports: + - "8083:8083" + environment: + QUARKUS_DATASOURCE_REACTIVE_URL: postgresql://heroes-db:5432/heroes_database + QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION: validate + QUARKUS_DATASOURCE_USERNAME: superman + QUARKUS_DATASOURCE_PASSWORD: superman + QUARKUS_HIBERNATE_ORM_SQL_LOAD_SCRIPT: no-file + QUARKUS_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: http://otel-collector:4317 + restart: on-failure + networks: + default: + aliases: + - rest-heroes + deploy: + resources: + limits: + memory: 1G + cpus: '1' + reservations: + memory: 256M + cpus: '0.5' diff --git a/rest-heroes/src/main/docker/Dockerfile.jvm21 b/rest-heroes/src/main/docker/Dockerfile.jvm21 new file mode 100644 index 0000000000..aba4c66838 --- /dev/null +++ b/rest-heroes/src/main/docker/Dockerfile.jvm21 @@ -0,0 +1,19 @@ +# TODO: This needs to be fixed to look more like Dockerfile.jvm once the Temurin builds are out + +FROM azul/zulu-openjdk:21-jre + +RUN mkdir -p /deployments/lib && \ + mkdir -p /deployments/app && \ + mkdir -p /deployments/quarkus + +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' + +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY target/quarkus-app/lib/ /deployments/lib/ +COPY target/quarkus-app/*.jar /deployments/ +COPY target/quarkus-app/app/ /deployments/app/ +COPY target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8083 + +ENTRYPOINT ["java", "-jar", "/deployments/quarkus-run.jar", "-Dquarkus.http.host=0.0.0.0", "-Djava.util.logging.manager=org.jboss.logmanager.LogManager"] diff --git a/rest-heroes/src/main/kubernetes/openshift.yml b/rest-heroes/src/main/kubernetes/openshift.yml index 577710c65c..38568e79ac 100644 --- a/rest-heroes/src/main/kubernetes/openshift.yml +++ b/rest-heroes/src/main/kubernetes/openshift.yml @@ -15,6 +15,14 @@ spec: importPolicy: { } referencePolicy: type: Source + - name: java21-latest + annotations: null + from: + kind: DockerImage + name: 'quay.io/quarkus-super-heroes/rest-heroes:java21-latest' + importPolicy: { } + referencePolicy: + type: Source - name: native-latest annotations: null from: diff --git a/rest-heroes/src/main/resources/application.yml b/rest-heroes/src/main/resources/application.yml index 6b95cd7b17..ea09e31bbc 100644 --- a/rest-heroes/src/main/resources/application.yml +++ b/rest-heroes/src/main/resources/application.yml @@ -1,3 +1,9 @@ +paths: + dockerfile: + jvm-21: src/main/docker/Dockerfile.jvm21 + base-image: + jvm-21: azul/zulu-openjdk:21-jre + quarkus: application: name: rest-heroes @@ -91,6 +97,14 @@ quarkus: kubernetes: deployment-target: kubernetes +"%kubernetes-21": + quarkus: + config: + profile: + parent: kubernetes + docker: + dockerfile-jvm-path: "${paths.dockerfile.jvm-21}" + "%openshift": quarkus: config: @@ -101,6 +115,17 @@ quarkus: kubernetes: deployment-target: openshift +"%openshift-21": + quarkus: + config: + profile: + parent: openshift + docker: + dockerfile-jvm-path: "${paths.dockerfile.jvm-21}" + openshift: + jvm-dockerfile: "${paths.dockerfile.jvm-21}" + base-jvm-image: "${paths.base-image.jvm-21}" + "%knative": quarkus: config: @@ -109,6 +134,14 @@ quarkus: kubernetes: deployment-target: knative +"%knative-21": + quarkus: + config: + profile: + parent: knative + docker: + dockerfile-jvm-path: "${paths.dockerfile.jvm-21}" + "%knative-openshift": quarkus: config: @@ -117,6 +150,17 @@ quarkus: container-image: builder: openshift +"%knative-openshift-21": + quarkus: + config: + profile: + parent: knative-openshift + docker: + dockerfile-jvm-path: "${paths.dockerfile.jvm-21}" + openshift: + jvm-dockerfile: "${paths.dockerfile.jvm-21}" + base-jvm-image: "${paths.base-image.jvm-21}" + "%minikube": quarkus: config: @@ -124,3 +168,11 @@ quarkus: parent: prod kubernetes: deployment-target: minikube + +"%minikube-21": + quarkus: + config: + profile: + parent: minikube + docker: + dockerfile-jvm-path: "${paths.dockerfile.jvm-21}" diff --git a/rest-narration/README.md b/rest-narration/README.md index 15bf21d63e..83c867a80c 100644 --- a/rest-narration/README.md +++ b/rest-narration/README.md @@ -92,6 +92,7 @@ Pick one of the versions of the application from the table below and execute the | 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` |) @@ -112,6 +113,7 @@ Pick one of the versions of the application from the table below and deploy the | 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) |) @@ -124,13 +126,18 @@ 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 | 21 | `./mvnw clean package -Dquarkus.profile=knative-21 -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)). diff --git a/rest-narration/src/main/docker-compose/java21.yml b/rest-narration/src/main/docker-compose/java21.yml new file mode 100644 index 0000000000..5a8013f418 --- /dev/null +++ b/rest-narration/src/main/docker-compose/java21.yml @@ -0,0 +1,21 @@ + + rest-narration-java21: + image: quay.io/quarkus-super-heroes/rest-narration:java21-latest + container_name: rest-narration-java21 + ports: + - "8087:8087" + environment: + QUARKUS_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: http://otel-collector:4317 + restart: on-failure + networks: + default: + aliases: + - rest-narration + deploy: + resources: + limits: + memory: 1G + cpus: '1' + reservations: + memory: 256M + cpus: '0.5' diff --git a/rest-narration/src/main/docker/Dockerfile.jvm21 b/rest-narration/src/main/docker/Dockerfile.jvm21 new file mode 100644 index 0000000000..02a42e7d44 --- /dev/null +++ b/rest-narration/src/main/docker/Dockerfile.jvm21 @@ -0,0 +1,16 @@ +FROM azul/zulu-openjdk:21-jre +RUN mkdir -p /deployments/lib && \ + mkdir -p /deployments/app && \ + mkdir -p /deployments/quarkus + +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' + +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY target/quarkus-app/lib/ /deployments/lib/ +COPY target/quarkus-app/*.jar /deployments/ +COPY target/quarkus-app/app/ /deployments/app/ +COPY target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8087 + +ENTRYPOINT ["java", "-jar", "/deployments/quarkus-run.jar", "-Dquarkus.http.host=0.0.0.0", "-Djava.util.logging.manager=org.jboss.logmanager.LogManager"] diff --git a/rest-narration/src/main/kubernetes/openshift.yml b/rest-narration/src/main/kubernetes/openshift.yml index b7b01e467d..a61d11ac40 100644 --- a/rest-narration/src/main/kubernetes/openshift.yml +++ b/rest-narration/src/main/kubernetes/openshift.yml @@ -15,6 +15,14 @@ spec: importPolicy: { } referencePolicy: type: Source + - name: java21-latest + annotations: null + from: + kind: DockerImage + name: 'quay.io/quarkus-super-heroes/rest-narration:java21-latest' + importPolicy: { } + referencePolicy: + type: Source # Until https://github.com/microsoft/semantic-kernel/issues/2885 is resolved # - name: native-latest # annotations: null diff --git a/rest-narration/src/main/resources/application.properties b/rest-narration/src/main/resources/application.properties index 715cfb2de2..873bfe231a 100644 --- a/rest-narration/src/main/resources/application.properties +++ b/rest-narration/src/main/resources/application.properties @@ -39,10 +39,15 @@ quarkus.container-image.builder=docker quarkus.container-image.registry=quay.io quarkus.container-image.group=quarkus-super-heroes quarkus.container-image.name=${quarkus.application.name} +paths.dockerfile.jvm-21=src/main/docker/Dockerfile.jvm21 +#TODO Need to update this when the RH openjdk-21 image comes out +paths.base-image.jvm-21=azul/zulu-openjdk:21-jre # Kubernetes %kubernetes.quarkus.config.profile.parent=prod %kubernetes.quarkus.kubernetes.deployment-target=kubernetes +%kubernetes-21.quarkus.config.profile.parent=kubernetes +%kubernetes-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} quarkus.kubernetes.part-of=narration-service quarkus.kubernetes.annotations."app.openshift.io/connects-to"=otel-collector quarkus.kubernetes.env.configmaps=${quarkus.application.name}-config @@ -54,6 +59,10 @@ quarkus.kubernetes.labels.system=quarkus-super-heroes %openshift.quarkus.config.profile.parent=prod %openshift.quarkus.kubernetes.deployment-target=openshift %openshift.quarkus.container-image.builder=openshift +%openshift-21.quarkus.config.profile.parent=openshift +%openshift-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} +%openshift-21.quarkus.openshift.jvm-dockerfile=${paths.dockerfile.jvm-21} +%openshift-21.quarkus.openshift.base-jvm-image=${paths.base-image.jvm-21} quarkus.openshift.base-jvm-image=registry.access.redhat.com/ubi9/openjdk-17:1.14 quarkus.openshift.base-native-image=quay.io/quarkus/ubi-quarkus-native-binary-s2i:2.0 quarkus.openshift.route.expose=true @@ -65,6 +74,8 @@ quarkus.openshift.labels.system=${quarkus.kubernetes.labels.system} # KNative %knative.quarkus.config.profile.parent=prod %knative.quarkus.kubernetes.deployment-target=knative +%knative-21.quarkus.config.profile.parent=knative +%knative-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} quarkus.knative.annotations."app.openshift.io/connects-to"=otel-collector quarkus.knative.labels.app=${quarkus.kubernetes.labels.app} quarkus.knative.labels.application=${quarkus.kubernetes.labels.application} @@ -73,7 +84,13 @@ quarkus.knative.labels.system=${quarkus.kubernetes.labels.system} # KNative on OpenShift %knative-openshift.quarkus.config.profile.parent=knative %knative-openshift.quarkus.container-image.builder=openshift +%knative-openshift-21.quarkus.config.profile.parent=knative-openshift +%knative-openshift-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} +%knative-openshift-21.quarkus.openshift.jvm-dockerfile=${paths.dockerfile.jvm-21} +%knative-openshift-21.quarkus.openshift.base-jvm-image=${paths.base-image.jvm-21} # Minikube %minikube.quarkus.config.profile.parent=prod %minikube.quarkus.kubernetes.deployment-target=minikube +%minikube-21.quarkus.config.profile.parent=minikube +%minikube-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} diff --git a/rest-villains/README.md b/rest-villains/README.md index 560eab5f0d..e6ef26eb24 100644 --- a/rest-villains/README.md +++ b/rest-villains/README.md @@ -79,13 +79,14 @@ The application also contains a simple UI, showing the list of Villains currentl ## Running Locally via Docker Compose Pre-built images for this application can be found at [`quay.io/quarkus-super-heroes/rest-villains`](https://quay.io/repository/quarkus-super-heroes/rest-villains?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/rest-villains` 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/rest-villains` 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 database only. If you want to stand up the entire system, [follow these instructions](../README.md#running-locally-via-docker-compose). @@ -100,11 +101,12 @@ Pre-built images for this application can be found at [`quay.io/quarkus-super-he Deployment descriptors for these images are provided in the [`deploy/k8s`](deploy/k8s) directory. There are versions for [OpenShift](https://www.openshift.com), [Minikube](https://quarkus.io/guides/deploying-to-kubernetes#deploying-to-minikube), [Kubernetes](https://www.kubernetes.io), and [KNative](https://knative.dev). -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`. @@ -116,13 +118,18 @@ 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 | 21 | `./mvnw clean package -Dquarkus.profile=knative-21 -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)). diff --git a/rest-villains/src/main/docker-compose/java21.yml b/rest-villains/src/main/docker-compose/java21.yml new file mode 100644 index 0000000000..9a65b00e8f --- /dev/null +++ b/rest-villains/src/main/docker-compose/java21.yml @@ -0,0 +1,28 @@ + + rest-villains-java21: + image: quay.io/quarkus-super-heroes/rest-villains:java21-latest + container_name: rest-villains-java21 + depends_on: + - villains-db + ports: + - "8084:8084" + environment: + QUARKUS_DATASOURCE_JDBC_URL: jdbc:postgresql://villains-db:5432/villains_database + QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION: validate + QUARKUS_DATASOURCE_USERNAME: superbad + QUARKUS_DATASOURCE_PASSWORD: superbad + QUARKUS_HIBERNATE_ORM_SQL_LOAD_SCRIPT: no-file + QUARKUS_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: http://otel-collector:4317 + restart: on-failure + networks: + default: + aliases: + - rest-villains + deploy: + resources: + limits: + memory: 1G + cpus: '1' + reservations: + memory: 256M + cpus: '0.5' diff --git a/rest-villains/src/main/docker/Dockerfile.jvm21 b/rest-villains/src/main/docker/Dockerfile.jvm21 new file mode 100644 index 0000000000..3c68a44162 --- /dev/null +++ b/rest-villains/src/main/docker/Dockerfile.jvm21 @@ -0,0 +1,19 @@ +# TODO: This needs to be fixed to look more like Dockerfile.jvm once the Temurin builds are out + +FROM azul/zulu-openjdk:21-jre + +RUN mkdir -p /deployments/lib && \ + mkdir -p /deployments/app && \ + mkdir -p /deployments/quarkus + +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' + +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY target/quarkus-app/lib/ /deployments/lib/ +COPY target/quarkus-app/*.jar /deployments/ +COPY target/quarkus-app/app/ /deployments/app/ +COPY target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8084 + +ENTRYPOINT ["java", "-jar", "/deployments/quarkus-run.jar", "-Dquarkus.http.host=0.0.0.0", "-Djava.util.logging.manager=org.jboss.logmanager.LogManager"] diff --git a/rest-villains/src/main/kubernetes/openshift.yml b/rest-villains/src/main/kubernetes/openshift.yml index 329d7e0b65..ace1270e36 100644 --- a/rest-villains/src/main/kubernetes/openshift.yml +++ b/rest-villains/src/main/kubernetes/openshift.yml @@ -15,6 +15,14 @@ spec: importPolicy: { } referencePolicy: type: Source + - name: java21-latest + annotations: null + from: + kind: DockerImage + name: 'quay.io/quarkus-super-heroes/rest-villains:java21-latest' + importPolicy: { } + referencePolicy: + type: Source - name: native-latest annotations: null from: diff --git a/rest-villains/src/main/resources/application.properties b/rest-villains/src/main/resources/application.properties index 012fa96b73..457f4a35e2 100644 --- a/rest-villains/src/main/resources/application.properties +++ b/rest-villains/src/main/resources/application.properties @@ -46,10 +46,15 @@ quarkus.container-image.builder=docker quarkus.container-image.registry=quay.io quarkus.container-image.group=quarkus-super-heroes quarkus.container-image.name=${quarkus.application.name} +paths.dockerfile.jvm-21=src/main/docker/Dockerfile.jvm21 +#TODO Need to update this when the RH openjdk-21 image comes out +paths.base-image.jvm-21=azul/zulu-openjdk:21-jre # Kubernetes %kubernetes.quarkus.config.profile.parent=prod %kubernetes.quarkus.kubernetes.deployment-target=kubernetes +%kubernetes-21.quarkus.config.profile.parent=kubernetes +%kubernetes-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} quarkus.kubernetes.part-of=villains-service quarkus.kubernetes.annotations."app.openshift.io/connects-to"=villains-db,otel-collector quarkus.kubernetes.env.configmaps=${quarkus.application.name}-config @@ -62,6 +67,10 @@ quarkus.kubernetes.labels.system=quarkus-super-heroes %openshift.quarkus.config.profile.parent=prod %openshift.quarkus.kubernetes.deployment-target=openshift %openshift.quarkus.container-image.builder=openshift +%openshift-21.quarkus.config.profile.parent=openshift +%openshift-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} +%openshift-21.quarkus.openshift.jvm-dockerfile=${paths.dockerfile.jvm-21} +%openshift-21.quarkus.openshift.base-jvm-image=${paths.base-image.jvm-21} quarkus.openshift.base-jvm-image=registry.access.redhat.com/ubi9/openjdk-17:1.14 quarkus.openshift.base-native-image=quay.io/quarkus/ubi-quarkus-native-binary-s2i:2.0 quarkus.openshift.route.expose=true @@ -73,6 +82,8 @@ quarkus.openshift.labels.system=${quarkus.kubernetes.labels.system} # KNative %knative.quarkus.config.profile.parent=prod %knative.quarkus.kubernetes.deployment-target=knative +%knative-21.quarkus.config.profile.parent=knative +%knative-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} quarkus.knative.annotations."app.openshift.io/connects-to"=villains-db,otel-collector quarkus.knative.labels.app=${quarkus.kubernetes.labels.app} quarkus.knative.labels.application=${quarkus.kubernetes.labels.application} @@ -81,7 +92,13 @@ quarkus.knative.labels.system=${quarkus.kubernetes.labels.system} # KNative on OpenShift %knative-openshift.quarkus.config.profile.parent=knative %knative-openshift.quarkus.container-image.builder=openshift +%knative-openshift-21.quarkus.config.profile.parent=knative-openshift +%knative-openshift-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} +%knative-openshift-21.quarkus.openshift.jvm-dockerfile=${paths.dockerfile.jvm-21} +%knative-openshift-21.quarkus.openshift.base-jvm-image=${paths.base-image.jvm-21} # Minikube %minikube.quarkus.config.profile.parent=prod %minikube.quarkus.kubernetes.deployment-target=minikube +%minikube-21.quarkus.config.profile.parent=minikube +%minikube-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} diff --git a/scripts/generate-docker-compose-resources.sh b/scripts/generate-docker-compose-resources.sh index a533b2a7ac..331426a4f3 100755 --- a/scripts/generate-docker-compose-resources.sh +++ b/scripts/generate-docker-compose-resources.sh @@ -162,10 +162,10 @@ do do # Keeping this if/else here for the future when we might want to build multiple java versions if [[ "$kind" == "native-" ]]; then - javaVersions=(17) + javaVersions=(21) else - javaVersions=(17) - # javaVersions=(11 17) +# javaVersions=(17) + javaVersions=(17 21) fi for javaVersion in ${javaVersions[@]} diff --git a/scripts/generate-k8s-resources.sh b/scripts/generate-k8s-resources.sh index 295b2edc8b..eda61b2bcb 100755 --- a/scripts/generate-k8s-resources.sh +++ b/scripts/generate-k8s-resources.sh @@ -163,13 +163,13 @@ for kind in "" "native-" do # Keeping this if/else here for the future when we might want to build multiple java versions if [[ "$kind" == "native-" ]]; then - javaVersions=(17) + javaVersions=(21) # Until https://github.com/microsoft/semantic-kernel/issues/2885 is resolved projects=("grpc-locations" "rest-villains" "rest-heroes" "rest-fights" "event-statistics" "ui-super-heroes") else - javaVersions=(17) +# javaVersions=(17) projects=("grpc-locations" "rest-narration" "rest-villains" "rest-heroes" "rest-fights" "event-statistics" "ui-super-heroes") -# javaVersions=(11 17) + javaVersions=(17 21) fi for javaVersion in "${javaVersions[@]}" diff --git a/ui-super-heroes/README.md b/ui-super-heroes/README.md index d9e07591f4..b8470b8e11 100644 --- a/ui-super-heroes/README.md +++ b/ui-super-heroes/README.md @@ -70,21 +70,17 @@ docker run -p 8080:8080 -e API_BASE_URL=http://localhost:8082 quay.io/quarkus-su ## Running Locally via Docker Compose Pre-built images for this application can be found at [`quay.io/quarkus-super-heroes/ui-super-heroes`](https://quay.io/repository/quarkus-super-heroes/ui-super-heroes?tab=tags). -The application can be started outside of docker compose simply with `docker run -p 8080:8080 quay.io/quarkus-super-heroes/ui-super-heroes:latest`. +Pick one of the versions of the application from the table below and execute the appropriate docker compose command from the `quarkus-super-heroes/ui-super-heroes` directory. -If you want to use docker compose, from the `quarkus-super-heroes/ui-super-heroes` directory run: + > **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. -```bash -docker-compose -f deploy/docker-compose/java17.yml up -``` - -or - -```bash -docker-compose -f deploy/docker-compose/native.yml up -``` +| 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` | -If you want to stand up the entire system, [follow these instructions](../README.md#running-locally-via-docker-compose). +These Docker Compose files are meant for standing up this application and the required database only. If you want to stand up the entire system, [follow these instructions](../README.md#running-locally-via-docker-compose). Once started the application will be exposed at `http://localhost:8080`. @@ -96,11 +92,12 @@ Pre-built images for this application can be found at [`quay.io/quarkus-super-he Deployment descriptors for these images are provided in the [`deploy/k8s`](deploy/k8s) directory. There are versions for [OpenShift](https://www.openshift.com), [Minikube](https://quarkus.io/guides/deploying-to-kubernetes#deploying-to-minikube), [Kubernetes](https://www.kubernetes.io), and [KNative](https://knative.dev). -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 java21 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`. @@ -112,13 +109,18 @@ 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 | 21 | `./mvnw clean package -Dquarkus.profile=knative-21 -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)). diff --git a/ui-super-heroes/src/main/docker-compose/java17.yml b/ui-super-heroes/src/main/docker-compose/java17.yml index 0b03704235..5acd968dce 100644 --- a/ui-super-heroes/src/main/docker-compose/java17.yml +++ b/ui-super-heroes/src/main/docker-compose/java17.yml @@ -1,7 +1,7 @@ ui-super-heroes-java17: image: quay.io/quarkus-super-heroes/ui-super-heroes:java17-latest - container_name: ui-super-heroes + container_name: ui-super-heroes-java17 ports: - "8080:8080" restart: on-failure diff --git a/ui-super-heroes/src/main/docker-compose/java21.yml b/ui-super-heroes/src/main/docker-compose/java21.yml new file mode 100644 index 0000000000..1e9b1bd6d9 --- /dev/null +++ b/ui-super-heroes/src/main/docker-compose/java21.yml @@ -0,0 +1,9 @@ + + ui-super-heroes-java21: + image: quay.io/quarkus-super-heroes/ui-super-heroes:java21-latest + container_name: ui-super-heroes-java21 + ports: + - "8080:8080" + restart: on-failure + environment: + API_BASE_URL: http://localhost:8082 diff --git a/ui-super-heroes/src/main/docker-compose/native.yml b/ui-super-heroes/src/main/docker-compose/native.yml index 22bed5e7d7..6382dca598 100644 --- a/ui-super-heroes/src/main/docker-compose/native.yml +++ b/ui-super-heroes/src/main/docker-compose/native.yml @@ -1,7 +1,7 @@ ui-super-heroes-native: image: quay.io/quarkus-super-heroes/ui-super-heroes:native-latest - container_name: ui-super-heroes + container_name: ui-super-heroes-native ports: - "8080:8080" restart: on-failure diff --git a/ui-super-heroes/src/main/docker/Dockerfile.jvm21 b/ui-super-heroes/src/main/docker/Dockerfile.jvm21 new file mode 100644 index 0000000000..0e43baaac9 --- /dev/null +++ b/ui-super-heroes/src/main/docker/Dockerfile.jvm21 @@ -0,0 +1,19 @@ +# TODO: This needs to be fixed to look more like Dockerfile.jvm once the Temurin builds are out + +FROM azul/zulu-openjdk:21-jre + +RUN mkdir -p /deployments/lib && \ + mkdir -p /deployments/app && \ + mkdir -p /deployments/quarkus + +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' + +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY target/quarkus-app/lib/ /deployments/lib/ +COPY target/quarkus-app/*.jar /deployments/ +COPY target/quarkus-app/app/ /deployments/app/ +COPY target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8080 + +ENTRYPOINT ["java", "-jar", "/deployments/quarkus-run.jar", "-Dquarkus.http.host=0.0.0.0", "-Djava.util.logging.manager=org.jboss.logmanager.LogManager"] diff --git a/ui-super-heroes/src/main/kubernetes/openshift.yml b/ui-super-heroes/src/main/kubernetes/openshift.yml index 6bce4f167a..17b84a23c9 100644 --- a/ui-super-heroes/src/main/kubernetes/openshift.yml +++ b/ui-super-heroes/src/main/kubernetes/openshift.yml @@ -15,6 +15,14 @@ spec: importPolicy: { } referencePolicy: type: Source + - name: java21-latest + annotations: null + from: + kind: DockerImage + name: 'quay.io/quarkus-super-heroes/ui-super-heroes:java21-latest' + importPolicy: { } + referencePolicy: + type: Source - name: native-latest annotations: null from: diff --git a/ui-super-heroes/src/main/resources/application.properties b/ui-super-heroes/src/main/resources/application.properties index 6fcebcfb68..5113e670ce 100644 --- a/ui-super-heroes/src/main/resources/application.properties +++ b/ui-super-heroes/src/main/resources/application.properties @@ -17,10 +17,15 @@ quarkus.container-image.builder=docker quarkus.container-image.registry=quay.io quarkus.container-image.group=quarkus-super-heroes quarkus.container-image.name=${quarkus.application.name} +paths.dockerfile.jvm-21=src/main/docker/Dockerfile.jvm21 +#TODO Need to update this when the RH openjdk-21 image comes out +paths.base-image.jvm-21=azul/zulu-openjdk:21-jre # Kubernetes %kubernetes.quarkus.config.profile.parent=prod %kubernetes.quarkus.kubernetes.deployment-target=kubernetes +%kubernetes-21.quarkus.config.profile.parent=kubernetes +%kubernetes-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} quarkus.kubernetes.part-of=ui-super-heroes quarkus.kubernetes.annotations."app.openshift.io/connects-to"=rest-fights,otel-collector quarkus.kubernetes.labels.app=${quarkus.application.name} @@ -31,6 +36,10 @@ quarkus.kubernetes.labels.system=quarkus-super-heroes %openshift.quarkus.config.profile.parent=prod %openshift.quarkus.kubernetes.deployment-target=openshift %openshift.quarkus.container-image.builder=openshift +%openshift-21.quarkus.config.profile.parent=openshift +%openshift-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} +%openshift-21.quarkus.openshift.jvm-dockerfile=${paths.dockerfile.jvm-21} +%openshift-21.quarkus.openshift.base-jvm-image=${paths.base-image.jvm-21} quarkus.openshift.base-jvm-image=registry.access.redhat.com/ubi9/openjdk-17:1.14 quarkus.openshift.base-native-image=quay.io/quarkus/ubi-quarkus-native-binary-s2i:2.0 quarkus.openshift.route.expose=true @@ -43,6 +52,8 @@ quarkus.openshift.env.vars.CALCULATE_API_BASE_URL=true # KNative %knative.quarkus.config.profile.parent=prod %knative.quarkus.kubernetes.deployment-target=knative +%knative-21.quarkus.config.profile.parent=knative +%knative-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} quarkus.knative.annotations."app.openshift.io/connects-to"=rest-fights,otel-collector quarkus.knative.labels.app=${quarkus.kubernetes.labels.app} quarkus.knative.labels.application=${quarkus.kubernetes.labels.application} @@ -53,10 +64,16 @@ quarkus.knative.env.vars.CALCULATE_API_BASE_URL=true # KNative on OpenShift %knative-openshift.quarkus.config.profile.parent=knative %knative-openshift.quarkus.container-image.builder=openshift +%knative-openshift-21.quarkus.config.profile.parent=knative-openshift +%knative-openshift-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} +%knative-openshift-21.quarkus.openshift.jvm-dockerfile=${paths.dockerfile.jvm-21} +%knative-openshift-21.quarkus.openshift.base-jvm-image=${paths.base-image.jvm-21} # Minikube %minikube.quarkus.config.profile.parent=prod %minikube.quarkus.kubernetes.deployment-target=minikube +%minikube-21.quarkus.config.profile.parent=minikube +%minikube-21.quarkus.docker.dockerfile-jvm-path=${paths.dockerfile.jvm-21} # OpenTelemetry quarkus.otel.resource.attributes=app=${quarkus.application.name},application=ui-super-heroes,system=quarkus-super-heroes