You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "wmedvede (via GitHub)" <gi...@apache.org> on 2025/09/29 12:03:41 UTC

[PR] [NO-ISSUE] restore Kogito data-index and job-service availability health checks [incubator-kie-kogito-runtimes]

wmedvede opened a new pull request, #4073:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4073

   
       - restores data-index and jobs service availabitly checks that 1) works fine, 2) are diabled by default and only used in the knative-eventing addon, and 3) where removed by notifying nobody
   
   <!--
     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
     regarding copyright ownership.  The ASF licenses this file
     to you 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.
     -->
   
   Many thanks for submitting your Pull Request :heart:! 
   
   <!-- Please don't forget your Issue link -->
   Closes/Fixes/Resolves #ISSUE-NUMBER
   
   <!-- Please provide a short description of what this PR does -->
   **Description:**
   
   <!-- Link to related PRs: -->
   
   Please make sure that your PR meets the following requirements:
   
   - [X] You have read the [contributors guide](CONTRIBUTING.md)
   - [X] Your code is properly formatted according to [this configuration](https://github.com/apache/incubator-kie-kogito-runtimes/tree/main/kogito-build/kogito-ide-config)
   - [X] Pull Request title is properly formatted: `Issue-XYZ Subject`
   - [X] Pull Request title contains the target branch if not targeting main: `[0.9.x] Issue-XYZ Subject`
   - [X] Pull Request contains link to the JIRA issue
   - [X] Pull Request contains link to any dependent or related Pull Request
   - [X] Pull Request contains description of the issue
   - [X] Pull Request does not include fixes for issues other than the main ticket
   
   <details>
   <summary>
   How to replicate CI configuration locally?
   </summary>
   
   Build Chain tool does "simple" maven build(s), the builds are just Maven commands, but because the repositories relates and depends on each other and any change in API or class method could affect several of those repositories there is a need to use [build-chain tool](https://github.com/kiegroup/github-action-build-chain) to handle cross repository builds and be sure that we always use latest version of the code for each repository.
    
   [build-chain tool](https://github.com/kiegroup/github-action-build-chain) is a build tool which can be used on command line locally or in Github Actions workflow(s), in case you need to change multiple repositories and send multiple dependent pull requests related with a change you can easily reproduce the same build by executing it on Github hosted environment or locally in your development environment. See [local execution](https://github.com/kiegroup/github-action-build-chain#local-execution) details to get more information about it.
   </details>
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [NO-ISSUE] restore Kogito data-index and job-service availability health checks [incubator-kie-kogito-runtimes]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede merged PR #4073:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4073


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [NO-ISSUE] restore Kogito data-index and job-service availability health checks [incubator-kie-kogito-runtimes]

Posted by "elguardian (via GitHub)" <gi...@apache.org>.
elguardian commented on code in PR #4073:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4073#discussion_r2391384458


##########
quarkus/addons/common/kogito-addons-quarkus-common-health/src/main/java/org/kie/kogito/addon/quarkus/common/health/AbstractAvailabilityHealthCheck.java:
##########
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.kie.kogito.addon.quarkus.common.health;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.time.Duration;
+
+import org.eclipse.microprofile.health.HealthCheck;
+import org.eclipse.microprofile.health.HealthCheckResponse;
+import org.eclipse.microprofile.health.HealthCheckResponseBuilder;
+
+import io.vertx.core.http.HttpMethod;
+import io.vertx.core.json.JsonObject;
+import io.vertx.mutiny.core.Vertx;
+import io.vertx.mutiny.core.buffer.Buffer;
+import io.vertx.mutiny.ext.web.client.HttpResponse;
+import io.vertx.mutiny.ext.web.client.WebClient;
+
+public abstract class AbstractAvailabilityHealthCheck implements HealthCheck {
+
+    private static final Duration DEFAULT_TIMEOUT = Duration.ofMillis(500);
+    private static final int DEFAULT_PORT = 80;
+
+    protected String serviceName;
+
+    protected String serviceUrl;
+
+    protected String healthPath;
+
+    protected String checkType;
+
+    protected Vertx vertx;
+
+    protected WebClient webClient;
+
+    protected Duration requestTimeout;
+
+    public AbstractAvailabilityHealthCheck() {
+        // CDI
+    }
+
+    public AbstractAvailabilityHealthCheck(String serviceName, String serviceUrl, String healthPath, String checkType,
+            Vertx vertx, Duration requestTimeout) {
+        this.serviceName = serviceName;
+        this.serviceUrl = serviceUrl;
+        this.healthPath = healthPath;
+        this.checkType = checkType;
+        this.vertx = vertx;
+        this.requestTimeout = requestTimeout != null ? requestTimeout : DEFAULT_TIMEOUT;
+        this.webClient = createClient();
+    }
+
+    /**
+     * facilitates tests.
+     */
+    protected WebClient createClient() {
+        return WebClient.create(vertx);
+    }
+
+    @Override
+    public HealthCheckResponse call() {
+        HealthCheckResponseBuilder builder = HealthCheckResponse.named(serviceName + " Availability - " + checkType).up();
+        if (serviceUrl == null) {
+            builder.down().withData("error", serviceName + " url is not configured");
+        } else {
+            URL url;
+            try {
+                url = new URL(serviceUrl);
+                HttpResponse<Buffer> response = webClient.request(HttpMethod.GET,

Review Comment:
   this is incorrect and it does not work. @wmedvede also you are forcing to respin a container that is healthy if there is a network glith. this is not how it works.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [NO-ISSUE] restore Kogito data-index and job-service availability health checks [incubator-kie-kogito-runtimes]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on PR #4073:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4073#issuecomment-3347934191

   Failing test in jenknis is unrelated
   
   v [error]: Build step io.quarkus.devservices.keycloak.KeycloakDevServicesProcessor#startKeycloakContainer threw an exception: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image quay.io/keycloak/keycloak:26.1.3
    at io.quarkus.devservices.keycloak.KeycloakDevServicesProcessor.startKeycloakContainer(KeycloakDevServicesProcessor.java:250


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [NO-ISSUE] restore Kogito data-index and job-service availability health checks [incubator-kie-kogito-runtimes]

Posted by "kie-ci3 (via GitHub)" <gi...@apache.org>.
kie-ci3 commented on PR #4073:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/4073#issuecomment-3347795354

   
   **PR job** `#1` was: **UNSTABLE**
   Possible explanation: This should be test failures
   
   
   <details>
   <summary><b>Reproducer</b></summary>
   
   
   
   build-chain build full_downstream  -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-runtimes -u https://github.com/apache/incubator-kie-kogito-runtimes/pull/4073 --skipParallelCheckout
   
   NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution
   
   </details>
   
   
   Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4073/1/display/redirect
   
   **Test results:**
   - PASSED: 3663
   - FAILED: 1
   
   Those are the test failures: 
   <details>
   <summary><a href="https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-runtimes-pr/job/PR-4073/1/testReport/org.kie.kogito.quarkus.token.persistence.workflows/TokenExchangeIT/tokenExchange/">org.kie.kogito.quarkus.token.persistence.workflows.TokenExchangeIT.tokenExchange</a></summary>
   java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors<br/> [error]: Build step io.quarkus.devservices.keycloak.KeycloakDevServicesProcessor#startKeycloakContainer threw an exception: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image quay.io/keycloak/keycloak:26.1.3<br/> at io.quarkus.devservices.keycloak.KeycloakDevServicesProcessor.startKeycloakContainer(KeycloakDevServicesProcessor.java:250)<br/> at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)<br/> at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)<br/> at io.quarkus.builder.BuildContext.run(BuildContext.java:255)<br/> at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)<br/> at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)<br/> at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQu
 eueExecutor.java:2654)<br/> at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)<br/> at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)<br/> at java.base/java.lang.Thread.run(Thread.java:840)<br/> at org.jboss.threads.JBossThread.run(JBossThread.java:499)<br/>Caused by: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image quay.io/keycloak/keycloak:26.1.3<br/> at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:351)<br/> at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:322)<br/> at io.quarkus.devservices.keycloak.KeycloakDevServicesProcessor.lambda$startContainer$4(KeycloakDevServicesProcessor.java:421)<br/> at java.base/java.util.Optional.orElseGet(Optional.java:364)<br/> at io.quarkus.devservices.keycloak.KeycloakDevServicesProcessor.startContainer(KeycloakDevServicesProcessor.java:447)<br/> at io.quarkus.devser
 vices.keycloak.KeycloakDevServicesProcessor.startKeycloakContainer(KeycloakDevServicesProcessor.java:200)<br/> ... 10 more<br/>Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception<br/> at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)<br/> at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:336)<br/> ... 15 more<br/>Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container<br/> at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:556)<br/> at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:346)<br/> at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)<br/> ... 16 more<br/>Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '.*Keycloak.*started.*'<br/> at org.testcontainers.containers.wait
 .strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)<br/> at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)<br/> at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:909)<br/> at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:492)<br/> ... 18 more<br/>
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org