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

Fix kie-issues #1217 - Replace quay.io with docker.io #3525

Merged
merged 2 commits into from
May 22, 2024

Conversation

ricardozanini
Copy link
Member

@ricardozanini ricardozanini commented May 20, 2024

Fixes apache/incubator-kie-issues#1217

Many thanks for submitting your Pull Request ❤️!

Please make sure that your PR meets the following requirements:

  • You have read the contributors guide
  • Your code is properly formatted according to this configuration
  • Pull Request title is properly formatted: KOGITO-XYZ Subject
  • Pull Request title contains the target branch if not targeting main: [0.9.x] KOGITO-XYZ Subject
  • Pull Request contains link to the JIRA issue
  • Pull Request contains link to any dependent or related Pull Request
  • Pull Request contains description of the issue
  • Pull Request does not include fixes for issues other than the main ticket
How to replicate CI configuration locally?

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 to handle cross repository builds and be sure that we always use latest version of the code for each repository.

build-chain tool 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 details to get more information about it.

How to retest this PR or trigger a specific build:
  • for pull request checks
    Please add comment: Jenkins retest this

  • for a specific pull request check
    Please add comment: Jenkins (re)run [kogito-runtimes|kogito-apps|kogito-examples] tests

  • for quarkus branch checks
    Run checks against Quarkus current used branch
    Please add comment: Jenkins run quarkus-branch

  • for a quarkus branch specific check
    Run checks against Quarkus current used branch
    Please add comment: Jenkins (re)run [kogito-runtimes|kogito-apps|kogito-examples] quarkus-branch

  • for quarkus main checks
    Run checks against Quarkus main branch
    Please add comment: Jenkins run quarkus-main

  • for a specific quarkus main check
    Run checks against Quarkus main branch
    Please add comment: Jenkins (re)run [kogito-runtimes|kogito-apps|kogito-examples] quarkus-main

  • for quarkus lts checks
    Run checks against Quarkus lts branch
    Please add comment: Jenkins run quarkus-lts

  • for a specific quarkus lts check
    Run checks against Quarkus lts branch
    Please add comment: Jenkins (re)run [kogito-runtimes|kogito-apps|kogito-examples] quarkus-lts

  • for native checks
    Run native checks
    Please add comment: Jenkins run native

  • for a specific native check
    Run native checks
    Please add comment: Jenkins (re)run [kogito-runtimes|kogito-apps|kogito-examples] native

  • for native lts checks
    Run native checks against quarkus lts branch
    Please add comment: Jenkins run native-lts

  • for a specific native lts check
    Run native checks against quarkus lts branch
    Please add comment: Jenkins (re)run [kogito-runtimes|kogito-apps|kogito-examples] native-lts

How to backport a pull request to a different branch?

In order to automatically create a backporting pull request please add one or more labels having the following format backport-<branch-name>, where <branch-name> is the name of the branch where the pull request must be backported to (e.g., backport-7.67.x to backport the original PR to the 7.67.x branch).

NOTE: backporting is an action aiming to move a change (usually a commit) from a branch (usually the main one) to another one, which is generally referring to a still maintained release branch. Keeping it simple: it is about to move a specific change or a set of them from one branch to another.

Once the original pull request is successfully merged, the automated action will create one backporting pull request per each label (with the previous format) that has been added.

If something goes wrong, the author will be notified and at this point a manual backporting is needed.

NOTE: this automated backporting is triggered whenever a pull request on main branch is labeled or closed, but both conditions must be satisfied to get the new PR created.

Quarkus-3 PR check is failing ... what to do ? The Quarkus 3 check is applying patches from the `.ci/environments/quarkus-3/patches`.

The first patch, called 0001_before_sh.patch, is generated from Openrewrite .ci/environments/quarkus-3/quarkus3.yml recipe. The patch is created to speed up the check. But it may be that some changes in the PR broke this patch.
No panic, there is an easy way to regenerate it. You just need to comment on the PR:

jenkins rewrite quarkus-3

and it should, after some minutes (~20/30min) apply a commit on the PR with the patch regenerated.

Other patches were generated manually. If any of it fails, you will need to manually update it... and push your changes.

Signed-off-by: Ricardo Zanini <zanini@redhat.com>
@ricardozanini ricardozanini requested a review from wmedvede May 20, 2024 20:01
@kie-ci3
Copy link
Contributor

kie-ci3 commented May 20, 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-runtimes -u #3525 --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-runtimes-pr/job/PR-3525/1/display/redirect

Test results:

  • PASSED: 3266
  • FAILED: 1

Those are the test failures:

org.kie.kogito.tracing.QuarkusTracingAddonDevServicesIT.testEvaluateLoanEligibility io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor#startTrustyServiceDevService threw an exception: java.lang.RuntimeException: Failed to start Kogito TrustyService DevServices
at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.startTrustyServiceDevService(KogitoDevServicesProcessor.java:145)
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:833)
at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.lang.RuntimeException: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=docker.io/apache/incubator-kie-kogito-trusty-postgresql:latest, imagePullPolicy=AlwaysPullPolicy(), imageNameSubstitutor=Chained substitutor of 'DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')' and then 'Kogito Image Name Substitutor')
at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.lambda$startTrustyService$8(KogitoDevServicesProcessor.java:271)
at java.base/java.util.Optional.orElseGet(Optional.java:364)
at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.startTrustyService(KogitoDevServicesProcessor.java:276)
at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.startTrustyServiceDevService(KogitoDevServicesProcessor.java:133)
... 11 more
Caused by: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=docker.io/apache/incubator-kie-kogito-trusty-postgresql:latest, imagePullPolicy=AlwaysPullPolicy(), imageNameSubstitutor=Chained substitutor of 'DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')' and then 'Kogito Image Name Substitutor')
at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1364)
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:359)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:330)
at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.lambda$startTrustyService$8(KogitoDevServicesProcessor.java:267)
... 14 more
Caused by: com.github.dockerjava.api.exception.NotFoundException: Status 404: {"message":"pull access denied for apache/incubator-kie-kogito-trusty-postgresql, repository does not exist or may require 'docker login': denied: requested access to the resource is denied"}

at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:241)
at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.lambda$executeAndStream$1(DefaultInvocationBuilder.java:269)
at java.base/java.lang.Thread.run(Thread.java:833)

@@ -17,4 +17,4 @@
# under the License.
#

quarkus.kogito.dev-services-trusty.image-name=quay.io/kiegroup/kogito-trusty-postgresql:${version.org.kie.kogito.trusty-service-postgresql}
quarkus.kogito.dev-services-trusty.image-name=docker.io/apache/incubator-kie-kogito-trusty-postgresql:${version.org.kie.kogito.trusty-service-postgresql}
Copy link
Member

Choose a reason for hiding this comment

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

where this image is published?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not. We've deprecated it. Hence, we can either keep this image here for ubiquity, keep the outdated, or remove this addon for good. I'd rather take this decision for the maintainers of this addon. @gitgabrio do you know?

Copy link
Member

Choose a reason for hiding this comment

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

k, thank you for the clarifications.

I would like to preserve as much as possible the tracing decision, but it has to adjust to remove the image reference that has been removed.

@gitgabrio would be possible to adjust the code to avoid use the image?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this property is for the devservice. We should remove the devservice or review it. I recommend doing so in another PR. Waiting for @gitgabrio inputs. :D

@@ -31,6 +31,6 @@ mp.messaging.outgoing.kogito-tracing-model.topic=kogito-tracing-model
mp.messaging.outgoing.kogito-tracing-model.value.serializer=org.apache.kafka.common.serialization.StringSerializer
mp.messaging.outgoing.kogito-tracing-model.auto.offset.reset=earliest

quarkus.kogito.dev-services-trusty.image-name=quay.io/kiegroup/kogito-trusty-postgresql:latest
quarkus.kogito.dev-services-trusty.image-name=docker.io/apache/incubator-kie-kogito-trusty-postgresql:latest
Copy link
Member

Choose a reason for hiding this comment

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

can't find this image source; mind help locate it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Same.

@ricardozanini
Copy link
Member Author

ricardozanini commented May 21, 2024

@porcelli these are just integration tests that use these YAMLs as mock resources to check the integration with the k8s.

See: https://github.com/apache/incubator-kie-kogito-runtimes/blob/main/quarkus/addons/fabric8-kubernetes-service-catalog/runtime/src/test/java/org/kie/kogito/addons/quarkus/fabric8/k8s/service/catalog/DeploymentUtilsTest.java#L61-L62

I'll change to docker.io/bananas.

@porcelli
Copy link
Member

thank you @ricardozanini for clarifying

great idea to use bananas... so we don't confuse ourselves :)

Signed-off-by: Ricardo Zanini <zanini@redhat.com>
@kie-ci3
Copy link
Contributor

kie-ci3 commented May 21, 2024

PR job #2 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-runtimes -u #3525 --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-runtimes-pr/job/PR-3525/2/display/redirect

Test results:

  • PASSED: 3266
  • FAILED: 1

Those are the test failures:

org.kie.kogito.tracing.QuarkusTracingAddonDevServicesIT.testEvaluateLoanEligibility io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor#startTrustyServiceDevService threw an exception: java.lang.RuntimeException: Failed to start Kogito TrustyService DevServices
at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.startTrustyServiceDevService(KogitoDevServicesProcessor.java:145)
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:833)
at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.lang.RuntimeException: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=docker.io/apache/incubator-kie-kogito-trusty-postgresql:latest, imagePullPolicy=AlwaysPullPolicy(), imageNameSubstitutor=Chained substitutor of 'DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')' and then 'Kogito Image Name Substitutor')
at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.lambda$startTrustyService$8(KogitoDevServicesProcessor.java:271)
at java.base/java.util.Optional.orElseGet(Optional.java:364)
at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.startTrustyService(KogitoDevServicesProcessor.java:276)
at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.startTrustyServiceDevService(KogitoDevServicesProcessor.java:133)
... 11 more
Caused by: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=docker.io/apache/incubator-kie-kogito-trusty-postgresql:latest, imagePullPolicy=AlwaysPullPolicy(), imageNameSubstitutor=Chained substitutor of 'DefaultImageNameSubstitutor (composite of 'ConfigurationFileImageNameSubstitutor' and 'PrefixingImageNameSubstitutor')' and then 'Kogito Image Name Substitutor')
at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:1364)
at org.testcontainers.containers.GenericContainer.doStart(GenericContainer.java:359)
at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:330)
at org.kie.kogito.tracing.decision.quarkus.deployment.KogitoDevServicesProcessor.lambda$startTrustyService$8(KogitoDevServicesProcessor.java:267)
... 14 more
Caused by: com.github.dockerjava.api.exception.NotFoundException: Status 404: {"message":"pull access denied for apache/incubator-kie-kogito-trusty-postgresql, repository does not exist or may require 'docker login': denied: requested access to the resource is denied"}

at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:241)
at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.lambda$executeAndStream$1(DefaultInvocationBuilder.java:269)
at java.base/java.lang.Thread.run(Thread.java:833)

Copy link
Contributor

@tiagobento tiagobento left a comment

Choose a reason for hiding this comment

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

Rectifying my inicial review... cc @jstastny-cz @rodrigonull

Comment on lines 219 to 222
if (version.endsWith('-SNAPSHOT')) {
return "${dataIndexEphemeralImageName}-nightly:${util.getMajorMinorVersion(version)}"
return "${dataIndexEphemeralImageName}:${util.getMajorMinorVersion(version)}"
}
return "${dataIndexEphemeralImageName}:${util.getMajorMinorVersion(version)}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs adjustment.. For the main branch, the tag would be main, that's fine. But when the branch is not main, we actually agreed to use the branch name to represent the stream, so the tag of this image would be 10.0.x. Now when we're doing an ACTUAL release, meaning versions does not end with -SNAPSHOT, then that's when we're supposed to use getMajorMinor().. Let me know if I'm missing something.

Copy link
Contributor

@tiagobento tiagobento May 22, 2024

Choose a reason for hiding this comment

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

In practice:

if version ends in -SNAPSHOT
   tagVersion = branch name
else
   tagVersion = getMajorMinor(...)

Copy link
Contributor

@tiagobento tiagobento May 22, 2024

Choose a reason for hiding this comment

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

With that said, this is not something that should only be done on the deploy job, as the code itself needs to reflect that, so people building locally and developing will have the same behavior. I guess the best solution would be calling:

mvn versions:set-property -Dproperty=data-index-ephemeral.image -DnewVersion=<new-value> on this module during commits D and R, as per our release procedure described here: https://docs.google.com/document/d/1t-08b970i9PMBy-TSM64x0RUH46pzwnIhEi-LVeL0lg/edit

This way, the deployment CI doesn't need to alter this property when publishing, and the build from source is always accurate.

Better yet would be creating a new property to hold only have the tagVersion, not the full tag of the image. This new property (E.g., data-index-ephemeral.image.tagVersion) can then be used to compose the existing data-index-ephemeral.image property, like docker.io/apache/incubator-kie-kogito-data-index-ephemeral:${data-index-ephemeral.image.tagVersion}.

Sorry for dumping the entire reasoning here :)

Copy link
Member Author

Choose a reason for hiding this comment

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

@tiagobento I think we need another PR targeting CI changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok.

@tiagobento
Copy link
Contributor

What is missing here for us to merge it? @ricardozanini @porcelli

@ricardozanini
Copy link
Member Author

What is missing here for us to merge it? @ricardozanini @porcelli

nothing from my side

@porcelli
Copy link
Member

we need to be thoughtful that the build will be broken for a quite due the image references of data-index... but I'm ok to merge as there is no way to solve this in one shot.

@porcelli
Copy link
Member

@ricardozanini @tiagobento fyi #3526 this is an attempt to move Integration tests to -apps

@tiagobento tiagobento merged commit 030a82a into apache:main May 22, 2024
6 of 8 checks passed
@ricardozanini ricardozanini deleted the kie-issues-1217 branch May 22, 2024 15:25
rgdoliveira added a commit to rgdoliveira/kogito-runtimes that referenced this pull request Jun 10, 2024
)

* Fix kie-issues apache#1217 - Replace quay.io with docker.io

Signed-off-by: Ricardo Zanini <zanini@redhat.com>

* Replace outdated image with bananas 🍌

Signed-off-by: Ricardo Zanini <zanini@redhat.com>

---------

Signed-off-by: Ricardo Zanini <zanini@redhat.com>
# Conflicts:
#	.ci/jenkins/Jenkinsfile.setup-branch
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.

EPIC - Replace images references from quay.io/kiegroup to docker.io/apache/incubator-kie*
4 participants