Skip to content

Commit

Permalink
Move to Java 21 baseline
Browse files Browse the repository at this point in the history
Fixes #376

Signed-off-by: Eric Deandrea <edeandrea@redhat.com>
  • Loading branch information
edeandrea committed Oct 21, 2024
1 parent 2d5a264 commit 1b20808
Show file tree
Hide file tree
Showing 59 changed files with 174 additions and 825 deletions.
4 changes: 2 additions & 2 deletions .github/quarkus-ecosystem-test
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ run_build() {
done
}

echo "Running build for Java 17"
echo "Running build for Java 21"
echo "JAVA_HOME=${JAVA_HOME}"
run_build 17
run_build 21
10 changes: 5 additions & 5 deletions .github/workflows/build-push-container-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
strategy:
matrix:
java:
- '17'
- '21'
project: ${{ fromJson(needs.calculate-modules.outputs.projects_matrix) }}
arch:
- amd64
Expand All @@ -134,7 +134,7 @@ jobs:
- name: Create env vars
working-directory: ${{ matrix.project.name }}
run: |
if [[ ${{ matrix.java }} == '17' ]]; then
if [[ ${{ matrix.java }} == '21' ]]; then
echo "JVM_DOCKERFILE=Dockerfile.jvm" >> "$GITHUB_ENV"
else
echo "JVM_DOCKERFILE=Dockerfile.jvm${{ matrix.java }}" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
fail-fast: false
matrix:
java:
- { jvm: '17', mandrel: '21' }
- { jvm: '21', mandrel: '21' }
project: ${{ fromJson(needs.calculate-modules.outputs.projects_matrix) }}
arch:
- amd64
Expand Down Expand Up @@ -256,7 +256,7 @@ jobs:
strategy:
matrix:
java:
- '17'
- '21'
kind:
- ""
- "native-"
Expand Down Expand Up @@ -301,7 +301,7 @@ jobs:
strategy:
matrix:
java:
- '17'
- '21'
kind:
- ""
- "native-"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-push-ui-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: temurin
cache: maven

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-deploy-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: temurin
cache: maven

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quarkus-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: temurin

- name: Checkout repo
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/simple-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
fail-fast: false
matrix:
java:
- '17'
- '21'
project:
- { name: event-statistics }
- { name: rest-fights }
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
fail-fast: false
matrix:
java:
- '17'
- '21'
project:
- { name: rest-heroes }
- { name: rest-villains }
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
fail-fast: false
matrix:
java:
- '17'
- '21'
project:
- event-statistics
- rest-fights
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
fail-fast: false
matrix:
java:
- { jvm: '17', mandrel: '21' }
- { jvm: '21', mandrel: '21' }
project:
- { name: event-statistics }
- { name: rest-fights }
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
fail-fast: false
matrix:
java:
- { jvm: '17', mandrel: '21' }
- { jvm: '21', mandrel: '21' }
project:
- { name: rest-heroes }
- { name: rest-villains }
Expand Down Expand Up @@ -269,7 +269,7 @@ jobs:
fail-fast: false
matrix:
java:
- { jvm: '17', mandrel: '21' }
- { jvm: '21', mandrel: '21' }
project:
- event-statistics
- rest-fights
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Sonar scan

env:
BASE_JAVA_VERSION: '17'
BASE_JAVA_VERSION: '21'
SONAR_ORG: quarkusio-quarkus-super-heroes
SONAR_HOST_URL: https://sonarcloud.io

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This is **NOT** the workshop with the step-by-step instructions. If you are look

This is **NOT** a single multi-module project. Each service in the system is its own sub-directory of this parent directory. As such, each individual service needs to be run on its own.

The base JVM version for all the applications is Java 17.
The base JVM version for all the applications is Java 21.

- [Super Hero Battle UI](ui-super-heroes)
- [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=quarkusio-quarkus-super-heroes_ui-super-heroes&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=quarkusio-quarkus-super-heroes_ui-super-heroes) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=quarkusio-quarkus-super-heroes_ui-super-heroes&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=quarkusio-quarkus-super-heroes_ui-super-heroes) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=quarkusio-quarkus-super-heroes_ui-super-heroes&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=quarkusio-quarkus-super-heroes_ui-super-heroes) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=quarkusio-quarkus-super-heroes_ui-super-heroes&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=quarkusio-quarkus-super-heroes_ui-super-heroes) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=quarkusio-quarkus-super-heroes_ui-super-heroes&metric=coverage)](https://sonarcloud.io/summary/new_code?id=quarkusio-quarkus-super-heroes_ui-super-heroes) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=quarkusio-quarkus-super-heroes_ui-super-heroes&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=quarkusio-quarkus-super-heroes_ui-super-heroes)
Expand Down Expand Up @@ -101,7 +101,7 @@ Pick one of the 4 versions of the application from the table below and execute t
| Description | Image Tag | Docker Compose Run Command | Docker Compose Run Command with Monitoring |
|-------------|-----------------|--------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| JVM Java 17 | `java17-latest` | `docker compose -f deploy/docker-compose/java17.yml up --remove-orphans` | `docker compose -f deploy/docker-compose/java17.yml -f deploy/docker-compose/monitoring.yml up --remove-orphans` |
| JVM Java 21 | `java21-latest` | `docker compose -f deploy/docker-compose/java21.yml up --remove-orphans` | `docker compose -f deploy/docker-compose/java21.yml -f deploy/docker-compose/monitoring.yml up --remove-orphans` |
| Native | `native-latest` | `docker compose -f deploy/docker-compose/native.yml up --remove-orphans` | `docker compose -f deploy/docker-compose/native.yml -f deploy/docker-compose/monitoring.yml up --remove-orphans` |

> [!TIP]
Expand Down Expand Up @@ -145,7 +145,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
Expand Down
12 changes: 6 additions & 6 deletions docs/automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ It runs whenever code is pushed to the `main` branch as well as upon any pull re
> [!TIP]
> The workflow can also be [triggered manually](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow).
It runs `./mvnw clean verify` and `./mvnw clean verify -Pnative` on the [`event-statistics`](../event-statistics), [`rest-fights`](../rest-fights), [`rest-heroes`](../rest-heroes), [`rest-villains`](../rest-villains), [`rest-narration`](../rest-narration/deploy), [`grpc-locations`](../grpc-locations/deploy), and [`ui-super-heroes`](../ui-super-heroes) applications on Java 17.
It runs `./mvnw clean verify` and `./mvnw clean verify -Pnative` on the [`event-statistics`](../event-statistics), [`rest-fights`](../rest-fights), [`rest-heroes`](../rest-heroes), [`rest-villains`](../rest-villains), [`rest-narration`](../rest-narration/deploy), [`grpc-locations`](../grpc-locations/deploy), and [`ui-super-heroes`](../ui-super-heroes) applications on Java 21.

## Build and push container images workflow
The [Build and push container images](../.github/workflows/build-push-container-images.yml) workflow does pretty much what it sounds like: builds and pushes container images. For JVM images, it builds both `amd64` and `arm64` images. Multi-arch native images are coming soon.
Expand All @@ -48,14 +48,14 @@ This image is a visual of what the workflow consists of:
![build-push-images-workflow](../images/build-push-container-images-workflow.png)

### Build JVM container images job
This job [Builds JVM container images](https://quarkus.io/guides/container-image#building) for the [`event-statistics`](../event-statistics), [`rest-fights`](../rest-fights), [`rest-heroes`](../rest-heroes), [`rest-villains`](../rest-villains), [`rest-narration`](../rest-narration/deploy), [`grpc-locations`](../grpc-locations/deploy), and [`ui-super-heroes`](../ui-super-heroes) applications on Java 17 (both amd64 & arm64 platforms) using the [Docker Build action](https://github.com/docker/build-push-action).
This job [Builds JVM container images](https://quarkus.io/guides/container-image#building) for the [`event-statistics`](../event-statistics), [`rest-fights`](../rest-fights), [`rest-heroes`](../rest-heroes), [`rest-villains`](../rest-villains), [`rest-narration`](../rest-narration/deploy), [`grpc-locations`](../grpc-locations/deploy), and [`ui-super-heroes`](../ui-super-heroes) applications on Java 21 (both amd64 & arm64 platforms) using the [Docker Build action](https://github.com/docker/build-push-action).

Each container image created has 2 tags:
- `java{{java-version}}-latest-amd64`
- `java{{java-version}}-latest-arm64`

> [!TIP]
> - Replace `{{java-version}}` with the Java version the application was built with (i.e. `17`).
> - Replace `{{java-version}}` with the Java version the application was built with (i.e. `21`).
There are a total of 14 images built (7 applications x 1 JVM version x 2 platforms).

Expand Down Expand Up @@ -110,7 +110,7 @@ Each Quarkus project ([`event-statistics`](../event-statistics), [`rest-fights`]

These extensions generate the manifests needed for the application itself but not for any other services. [These extensions can also incorporate additional resources](https://quarkus.io/guides/deploying-to-kubernetes#using-existing-resources) by placing additional resources in each project's `src/main/kubernetes` directory.

The [`generate-k8s-resources.sh` script](../scripts/generate-k8s-resources.sh) loops through all versions of each application (Java version 17, both JVM and native - 8 total versions) and merges the contents of files these extensions generate and places them into each project's `deploy/k8s` directory as well as the respective files in the [root `deploy/k8s` directory](../deploy/k8s).
The [`generate-k8s-resources.sh` script](../scripts/generate-k8s-resources.sh) loops through all versions of each application (Java version 21, both JVM and native - 8 total versions) and merges the contents of files these extensions generate and places them into each project's `deploy/k8s` directory as well as the respective files in the [root `deploy/k8s` directory](../deploy/k8s).

The [`generate-k8s-resources.sh` script](../scripts/generate-k8s-resources.sh) additionally creates the monitoring (Prometheus/Jaeger/OpenTelemetry Collector) descriptors within the [root `deploy/k8s` directory](../deploy/k8s) for each Kubernetes variant platform.

Expand All @@ -130,10 +130,10 @@ This table describes the different files that can be found inside a project's `s

| File name | Description |
|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `infra.yml` | Any infrastructure definitions that are needed by the application. Definitions in here a re-used for each version of the application (i.e. JVM 17, Native). |
| `infra.yml` | Any infrastructure definitions that are needed by the application. Definitions in here a re-used for each version of the application (i.e. JVM 21, Native). |
| `java{{java-version}}.yml` | Definition for the JVM version of application itself for a particular java version, denoted by `{{java-version}}`. |
| `native.yml` | Definition for the native image version of the application itself. |

The [`generate-docker-compose-resources.sh` script](../scripts/generate-docker-compose-resources.sh) loops through all versions of each application (Java version 17, both JVM and native - 8 total versions) and merges contents of these files from each project's `src/main/docker-compose` directory into each project's `deploy/docker-compose` directory as well as the respective files in the [root `deploy/docker-compose` directory](../deploy/docker-compose).
The [`generate-docker-compose-resources.sh` script](../scripts/generate-docker-compose-resources.sh) loops through all versions of each application (Java version 21, both JVM and native - 8 total versions) and merges contents of these files from each project's `src/main/docker-compose` directory into each project's `deploy/docker-compose` directory as well as the respective files in the [root `deploy/docker-compose` directory](../deploy/docker-compose).

The [`generate-docker-compose-resources.sh` script](../scripts/generate-docker-compose-resources.sh) additionally creates the [monitoring compose file (`monitoring.yml`)](../deploy/docker-compose/monitoring.yml) within the [root `deploy/docker-compose` directory](../deploy/docker-compose).
2 changes: 1 addition & 1 deletion docs/deploying-to-azure-containerapps.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ For that, we need to set the following environment variables:
```shell
# Images
SUPERHEROES_IMAGES_BASE="quay.io/quarkus-super-heroes"
IMAGES_TAG="java17-latest"
IMAGES_TAG="java21-latest"

# Azure
RESOURCE_GROUP="super-heroes"
Expand Down
Loading

0 comments on commit 1b20808

Please sign in to comment.