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

[incubator-kie-issues-1401] Fix build kogito-examples.build-and-test in kogito nightly.native folder #1987

Merged

Conversation

tkobayas
Copy link
Contributor

@tkobayas tkobayas commented Jul 30, 2024

Issue:

#1986 is a fix for 10.0.x branch, but this PR is for main branch to be a fundamental fix:

  • update serverless-workflow examples versions
  • disable dmn-tracing-quarkus and trusty-tracing-quarkus-devservices

…in kogito nightly.native folder

- Completely disabled dmn-tracing-quarkus and trusty-tracing-quarkus-devservices
Comment on lines +96 to +101
def pom = readMavenPom(file: 'pom.xml');
def oldKogitoVersion = pom.version
if (oldKogitoVersion == null) {
echo "pom version is null. Using parent pom version"
oldKogitoVersion = pom.parent.version
}
Copy link
Contributor Author

@tkobayas tkobayas Jul 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that oldKogitoVersion was null in past logs because readMavenPom cannot resolve the parent version (I cannot find a reason from logs). But locally confirmed that pom.parent.version returns the expected version.

Comment on lines +104 to +110
// special case for serverless-workflow-examples-parent
maven.mvnVersionsSet(
getMavenCommand('serverless-workflow-examples/serverless-workflow-examples-parent').withSettingsXmlFile(MAVEN_SETTINGS_FILE),
getKogitoVersion(),
true,
false
)
Copy link
Contributor Author

@tkobayas tkobayas Jul 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serverless-workflow-examples project versions were not updated by mvnVersionsUpdateParentAndChildModules, because serverless-workflow-examples-parent itself was not updated. So I explicitly call mvnVersionsSet. The project directory is hard-coded, but I couldn't find another approach. Let me know if there is a better way.

Comment on lines -122 to +134
def status = sh(script: "grep -ir '${oldKogitoVersion}' --include='pom.xml'", returnStatus: true)
def status = sh(script: "grep -ir '>${oldKogitoVersion}<' --include='pom.xml'", returnStatus: true)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously 10.0.999-SNAPSHOT may match when oldKogitoVersion is 999-SNAPSHOT. Added > < for precision.

Comment on lines -124 to +137
error "Old Kogito version ${oldKogitoVersion} is still present into the project... Please review it..."
// some orphaned projects may still have the old version. not an error
echo "Old Kogito version ${oldKogitoVersion} is still present into the project... Please review it..."
Copy link
Contributor Author

@tkobayas tkobayas Jul 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may still have old versions because some projects are orphaned (not associated by <modules>), so mvn setVersion doesn't affect. It's not an error.

15:31:22  + grep -ir '>999-SNAPSHOT<' --include=pom.xml
15:31:22  kogito-quarkus-examples/dmn-tracing-quarkus/pom.xml:    <kogito.bom.version>999-SNAPSHOT</kogito.bom.version>
15:31:22  kogito-quarkus-examples/dmn-tracing-quarkus/pom.xml:    <version.org.kie.kogito>999-SNAPSHOT</version.org.kie.kogito>
15:31:22  kogito-quarkus-examples/trusty-tracing-quarkus-devservices/pom.xml:    <kogito.bom.version>999-SNAPSHOT</kogito.bom.version>
15:31:22  kogito-quarkus-examples/trusty-tracing-quarkus-devservices/pom.xml:    <version.org.kie.kogito>999-SNAPSHOT</version.org.kie.kogito>
15:31:22  serverless-workflow-examples/serverless-workflow-github-showcase/pom.xml:    <version>999-SNAPSHOT</version>
15:31:22  serverless-workflow-examples/serverless-workflow-openvino-quarkus/pom.xml:    <kogito.bom.version>999-SNAPSHOT</kogito.bom.version>
15:31:22  serverless-workflow-examples/serverless-workflow-subflows-event/pom.xml:    <version>999-SNAPSHOT</version>
15:31:22  serverless-workflow-examples/serverless-workflow-subflows-event/pom.xml:        <kogito.bom.version>999-SNAPSHOT</kogito.bom.version>
15:31:22  serverless-workflow-examples/serverless-workflow-subflows-event/pom.xml:        <version.org.kie.kogito>999-SNAPSHOT</version.org.kie.kogito>

Btw, previously, oldKogitoVersion was null, so it didn't hit the error.

Copy link

@jstastny-cz jstastny-cz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks @tkobayas

@jstastny-cz
Copy link

I suspect this problem might come from fact that the serverless-workflow-examples-parent is actually a sibling of modules which are using it.
I couldn't find the right place, but noticed, that the following construct is a problem on its own:
https://github.com/apache/incubator-kie-kogito-examples/blob/main/serverless-workflow-examples/pom.xml#L41

If the examples are built with "any" profile being active (either using -P or by any other activation means), this default profile is not activated at all, so the parent module falls out of the reactor.

@tkobayas
Copy link
Contributor Author

Hi @pefernan , What do you think about @jstastny-cz 's point? : #1987 (comment) (I see that it was introduced by #1852 )

I think this is not rushed for v10 release, but if you think this can be improved, please file a GH issue.

@kie-ci3
Copy link
Contributor

kie-ci3 commented Jul 30, 2024

PR job #1 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

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-examples -u #1987 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-examples-pr/job/PR-1987/1/display/redirect

Test results:

  • PASSED: 389
  • FAILED: 1

Those are the test failures:

org.acme.AcmeExchangeResourceIT.unauthorizedTest java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevServicesProcessor#startKeycloakContainer threw an exception: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image quay.io/keycloak/keycloak:23.0.7
at io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevServicesProcessor.startKeycloakContainer(KeycloakDevServicesProcessor.java:249)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
at java.base/java.lang.Thread.run(Thread.java:840)
at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image quay.io/keycloak/keycloak:23.0.7
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:359)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:330)
at io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevServicesProcessor.lambda$startContainer$4(KeycloakDevServicesProcessor.java:376)
at java.base/java.util.Optional.orElseGet(Optional.java:364)
at io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevServicesProcessor.startContainer(KeycloakDevServicesProcessor.java:401)
at io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevServicesProcessor.startKeycloakContainer(KeycloakDevServicesProcessor.java:197)
... 11 more
Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:88)
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:344)
... 16 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:563)
at org.testcontainers.containers.GenericContainer.lambda$doStart$0(GenericContainer.java:354)
at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:81)
... 17 more
Caused by: org.testcontainers.containers.ContainerLaunchException: Timed out waiting for log output matching '.*Keycloak.*started.*'
at org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
at org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:909)
at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:500)
... 19 more

@pefernan
Copy link
Contributor

@tkobayas oh. I don't remember the reason why, but the swf examples had no parent at the time and we needed that serverless-workflow-examples-parent so all the examples could have a common parent so they could inherit the java.module.name... that was a quick fix we did.

IDK if removing it and setting serverless-workflow-examples as with other examples (quarkus / springboot) would help here.

@tkobayas
Copy link
Contributor Author

Thanks @pefernan , I filed #1989

For now, we may go ahead with this PR.

@tkobayas
Copy link
Contributor Author

jenkins/pr-head: This error is being seen these days. Not related to this PR.

[2024-07-30T10:20:15.960Z] [ERROR] Tests run: 4, Failures: 0, Errors: 1, Skipped: 3, Time elapsed: 80.135 s <<< FAILURE! - in org.acme.AcmeExchangeResourceIT
...
[2024-07-30T10:20:15.960Z] Caused by: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image quay.io/keycloak/keycloak:23.0.7

Copy link

@rodrigonull rodrigonull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@tkobayas
Copy link
Contributor Author

The setup-branch change might be affected by the dev ML discussion "[DISCUSS] Kogito Examples and Properties". But at the moment, it's safe to merge, I think.

@tkobayas tkobayas merged commit 9253d3b into apache:main Aug 15, 2024
4 of 5 checks passed
rgdoliveira added a commit to rgdoliveira/kogito-examples that referenced this pull request Aug 26, 2024
…in kogito nightly.native folder (apache#1987)

* [incubator-kie-issues-1401] Fix build kogito-examples.build-and-test in kogito nightly.native folder
- Completely disabled dmn-tracing-quarkus and trusty-tracing-quarkus-devservices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants