Skip to content

Commit

Permalink
chore(quarkus): upgrade to 3.8 LTS (#687)
Browse files Browse the repository at this point in the history
* build(deps): update Quarkus to 3.8 LTS (#609)

* build(deps): update Quarkus to 3.8 LTS

* add hibernate format mapper override

* remove no longer necessary lazy init

* disable openapi management / swagger UI unless in dev mode

* remove duplicate healthcheck override

* reduce healthcheck start periods

* correct healthcheck URL

* use authproxy image which contains wget for healthcheck

* correct healthchecks for vertx agent test applications

* build(deps): replace direct fabric8 kubernetes-client with quarkus kubernetes-client (#606)

* compose fixup

* graphql test fixup

* auth proxy fixup

* startup discovery transactions

* chore(schema): automatic update

---------

Co-authored-by: Cryostat CI <[email protected]>
  • Loading branch information
andrewazores and Cryostat CI authored Nov 21, 2024
1 parent ada4220 commit f537021
Show file tree
Hide file tree
Showing 29 changed files with 273 additions and 262 deletions.
14 changes: 5 additions & 9 deletions compose/auth_proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ services:
QUARKUS_HTTP_PROXY_ENABLE_FORWARDED_HOST: 'true'
QUARKUS_HTTP_PROXY_ENABLE_FORWARDED_PREFIX: 'true'
QUARKUS_HTTP_PROXY_TRUSTED_PROXIES: 127.0.0.1:${CRYOSTAT_HTTP_PORT}
healthcheck:
test: curl --fail http://cryostat:8181/health/liveness || exit 1
interval: 10s
retries: 3
start_period: 30s
timeout: 5s
QUARKUS_HTTP_ACCESS_LOG_PATTERN: long
QUARKUS_HTTP_ACCESS_LOG_ENABLED: 'true'
auth:
# the proxy does not actually depend on cryostat being up, but we use this
# to ensure that when the smoketest tries to open the auth login page in a
Expand All @@ -30,7 +26,7 @@ services:
limits:
cpus: '0.1'
memory: 32m
image: ${OAUTH2_PROXY_IMAGE:-quay.io/oauth2-proxy/oauth2-proxy:latest}
image: ${OAUTH2_PROXY_IMAGE:-quay.io/oauth2-proxy/oauth2-proxy:latest-alpine}
command: --alpha-config=/tmp/auth_proxy_alpha_config.yaml
volumes:
- auth_proxy_cfg:/tmp
Expand All @@ -47,10 +43,10 @@ services:
# OAUTH2_PROXY_SKIP_AUTH_ROUTES: .*
restart: unless-stopped
healthcheck:
test: wget -q --spider http://localhost:8080/ping || exit 1
test: wget --no-check-certificate -q --spider http://localhost:8080/ping || exit 1
interval: 10s
retries: 3
start_period: 30s
start_period: 10s
timeout: 5s

volumes:
Expand Down
2 changes: 1 addition & 1 deletion compose/cryostat-grafana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ services:
test: curl --fail http://localhost:3000/ || exit 1
retries: 3
interval: 30s
start_period: 30s
start_period: 10s
timeout: 1s
14 changes: 8 additions & 6 deletions compose/cryostat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ services:
CRYOSTAT_DISCOVERY_DOCKER_ENABLED: ${CRYOSTAT_DISCOVERY_DOCKER_ENABLED:-true}
JAVA_OPTS_APPEND: "-XX:+FlightRecorder -XX:StartFlightRecording=name=onstart,settings=default,disk=true,maxage=5m -XX:StartFlightRecording=name=startup,settings=profile,disk=true,duration=30s -Dcom.sun.management.jmxremote.autodiscovery=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9091 -Dcom.sun.management.jmxremote.rmi.port=9091 -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false"
restart: unless-stopped
healthcheck:
test: curl --fail http://cryostat:${CRYOSTAT_HTTP_PORT}/health/liveness || exit 1
interval: 10s
retries: 3
start_period: 30s
timeout: 5s
# FIXME reenable this check. Somehow after upgrading to Quarkus 3.8, this check fails with 'connection refused',
# but the container comes up successfully without it and shelling into the container later to run curl succeeds
# healthcheck:
# test: curl --fail http://cryostat:${CRYOSTAT_HTTP_PORT}/health/liveness || exit 1
# interval: 10s
# retries: 3
# start_period: 30s
# timeout: 5s

volumes:
jmxtls_cfg:
Expand Down
2 changes: 1 addition & 1 deletion compose/db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
test: pg_isready -U cryostat3 -d cryostat3 || exit 1
interval: 10s
retries: 3
start_period: 30s
start_period: 10s
timeout: 5s

volumes:
Expand Down
2 changes: 1 addition & 1 deletion compose/jfr-datasource.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ services:
test: curl --fail http://localhost:8080/ || exit 1
retries: 3
interval: 30s
start_period: 30s
start_period: 10s
timeout: 1s
59 changes: 25 additions & 34 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,19 @@
<org.openjdk.jmc.version>9.0.0</org.openjdk.jmc.version>

<org.apache.commons.codec.version>1.16.1</org.apache.commons.codec.version>
<org.apache.commons.io.version>2.13.0</org.apache.commons.io.version>
<org.apache.commons.io.version>2.16.1</org.apache.commons.io.version>
<org.apache.commons.collections.version>4.4</org.apache.commons.collections.version>
<org.apache.httpcomponents.version>5.2.1</org.apache.httpcomponents.version>
<org.apache.commons.lang3.version>3.13.0</org.apache.commons.lang3.version>
<org.apache.commons.validator.version>1.7</org.apache.commons.validator.version>
<org.apache.commons.validator.version>1.8.0</org.apache.commons.validator.version>
<org.projectnessie.cel.bom.version>0.4.4</org.projectnessie.cel.bom.version>
<com.google.protobuf-java.version>3.25.5</com.google.protobuf-java.version>
<com.nimbusds.jose.jwt.version>9.37.3</com.nimbusds.jose.jwt.version>
<org.testcontainers.bom.version>1.19.8</org.testcontainers.bom.version>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.2.12.Final</quarkus.platform.version>
<quarkus-quinoa.version>2.3.6</quarkus-quinoa.version>
<io.netty.version>4.1.108.Final</io.netty.version>
<quarkus.platform.version>3.8.6</quarkus.platform.version>
<quarkus-quinoa.version>2.3.10</quarkus-quinoa.version>
<org.codehaus.mojo.build.helper.plugin.version>3.6.0</org.codehaus.mojo.build.helper.plugin.version>
<assembly-plugin.version>3.7.1</assembly-plugin.version>

Expand All @@ -66,19 +65,11 @@
<com.mycila.license.maven.plugin.version>4.5</com.mycila.license.maven.plugin.version>
<surefire-plugin.version>3.2.5</surefire-plugin.version>
<surefire.rerunFailingTestsCount>2</surefire.rerunFailingTestsCount>
<failsafe-plugin.version>3.2.5</failsafe-plugin.version>
<io.fabric8.client.version>6.7.2</io.fabric8.client.version>
<failsafe-plugin.version>3.3.1</failsafe-plugin.version>
<failsafe.rerunFailingTestsCount>${surefire.rerunFailingTestsCount}</failsafe.rerunFailingTestsCount>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-bom</artifactId>
<version>${io.netty.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
Expand Down Expand Up @@ -162,6 +153,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-netty</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
Expand All @@ -187,6 +182,18 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-websockets</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-reactive-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-cache</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-quartz</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm-panache</artifactId>
Expand All @@ -203,19 +210,21 @@
<groupId>io.quarkiverse.amazonservices</groupId>
<artifactId>quarkus-amazon-s3</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-kubernetes-client</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>url-connection-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${org.apache.commons.lang3.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>${org.apache.commons.codec.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down Expand Up @@ -251,29 +260,12 @@
<artifactId>nimbus-jose-jwt</artifactId>
<version>${com.nimbusds.jose.jwt.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-reactive-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-cache</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-quartz</artifactId>
</dependency>
<dependency>
<groupId>com.google.googlejavaformat</groupId>
<artifactId>google-java-format</artifactId>
<version>${com.google.java-format.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
<version>${io.fabric8.client.version}</version>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
Expand Down Expand Up @@ -541,7 +533,6 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>${io.netty.version}</version>
<classifier>${io.netty.netty-transport-native-epoll.classifier}</classifier>
<scope>${io.netty.netty-transport-native-epoll.scope}</scope>
</dependency>
Expand Down
19 changes: 8 additions & 11 deletions schema/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ components:
DiscoveryPlugin:
properties:
builtin:
readOnly: true
type: boolean
callback:
format: uri
Expand Down Expand Up @@ -296,6 +297,7 @@ components:
Target:
properties:
agent:
readOnly: true
type: boolean
alias:
pattern: \S
Expand Down Expand Up @@ -347,11 +349,6 @@ components:
meta:
$ref: '#/components/schemas/Meta'
type: object
securitySchemes:
SecurityScheme:
description: Authentication
scheme: basic
type: http
info:
contact:
email: [email protected]
Expand All @@ -362,7 +359,7 @@ info:
name: Apache 2.0
url: https://github.com/cryostatio/cryostat3/blob/main/LICENSE
title: Cryostat API
version: 3.0.1-snapshot
version: 3.0.2-snapshot
openapi: 3.0.3
paths:
/api/beta/credentials/{connectUrl}:
Expand Down Expand Up @@ -913,7 +910,7 @@ paths:
type: string
requestBody:
content:
application/json:
text/plain:
schema:
type: string
responses:
Expand Down Expand Up @@ -1906,7 +1903,7 @@ paths:
responses:
"200":
content:
application/json:
text/plain:
schema:
type: string
description: OK
Expand Down Expand Up @@ -2393,13 +2390,13 @@ paths:
type: integer
requestBody:
content:
application/json:
text/plain:
schema:
type: string
responses:
"200":
content:
application/json:
text/plain:
schema:
type: string
description: OK
Expand Down Expand Up @@ -2429,7 +2426,7 @@ paths:
responses:
"200":
content:
application/json:
text/plain:
schema:
type: string
description: OK
Expand Down
46 changes: 46 additions & 0 deletions src/main/java/io/cryostat/HibernateFormatMapperCustomization.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright The Cryostat Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.cryostat;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.quarkus.hibernate.orm.JsonFormat;
import io.quarkus.hibernate.orm.PersistenceUnitExtension;
import org.hibernate.type.descriptor.WrapperOptions;
import org.hibernate.type.descriptor.java.JavaType;
import org.hibernate.type.format.FormatMapper;
import org.hibernate.type.format.jackson.JacksonJsonFormatMapper;

@JsonFormat
@PersistenceUnitExtension
/**
* @see https://github.com/quarkusio/quarkus/issues/42596
*/
public class HibernateFormatMapperCustomization implements FormatMapper {

private final JacksonJsonFormatMapper delegate =
new JacksonJsonFormatMapper(new ObjectMapper().findAndRegisterModules());

@Override
public <T> T fromString(
CharSequence charSequence, JavaType<T> javaType, WrapperOptions wrapperOptions) {
return delegate.fromString(charSequence, javaType, wrapperOptions);
}

@Override
public <T> String toString(T value, JavaType<T> javaType, WrapperOptions wrapperOptions) {
return delegate.toString(value, javaType, wrapperOptions);
}
}
3 changes: 0 additions & 3 deletions src/main/java/io/cryostat/credentials/Credentials.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import io.cryostat.expressions.MatchExpression;
import io.cryostat.expressions.MatchExpression.TargetMatcher;

import io.smallrye.common.annotation.Blocking;
import jakarta.annotation.security.RolesAllowed;
import jakarta.inject.Inject;
import jakarta.transaction.Transactional;
Expand Down Expand Up @@ -113,7 +112,6 @@ static Map<String, Object> notificationResult(Credential credential) throws Scri
return result;
}

@Blocking
static Map<String, Object> safeResult(Credential credential, TargetMatcher matcher)
throws ScriptException {
Map<String, Object> result = new HashMap<>();
Expand All @@ -124,7 +122,6 @@ static Map<String, Object> safeResult(Credential credential, TargetMatcher match
return result;
}

@Blocking
static Map<String, Object> safeMatchedResult(Credential credential, TargetMatcher matcher)
throws ScriptException {
Map<String, Object> result = new HashMap<>();
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/io/cryostat/credentials/CredentialsFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import io.cryostat.targets.Target.TargetDiscovery;

import io.quarkus.vertx.ConsumeEvent;
import io.smallrye.common.annotation.Blocking;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import org.apache.commons.collections4.BidiMap;
Expand Down Expand Up @@ -52,7 +51,6 @@ void onMessage(TargetDiscovery event) {
}
}

@Blocking
public Optional<Credential> getCredentialsForTarget(Target target) {
return Optional.ofNullable(
cache.computeIfAbsent(
Expand All @@ -73,7 +71,6 @@ public Optional<Credential> getCredentialsForTarget(Target target) {
.orElse(null)));
}

@Blocking
public Optional<Credential> getCredentialsForConnectUrl(URI connectUrl) {
return Target.find("connectUrl", connectUrl)
.<Target>singleResultOptional()
Expand Down
Loading

0 comments on commit f537021

Please sign in to comment.