-
Notifications
You must be signed in to change notification settings - Fork 204
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
kie-issues#2789: [sonataflow-operator] Implement DB Migrator Changes into SonataFlow Operator #2790
base: main
Are you sure you want to change the base?
Conversation
packages/sonataflow-operator/api/v1alpha08/sonataflowplatform_services_types.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/dbMigratorJob.go
Outdated
Show resolved
Hide resolved
const ( | ||
dbMigrationJobName = "sonataflow-db-migrator-job" | ||
dbMigrationContainerName = "db-migration-container" | ||
dbMigratorToolImage = "quay.io/rhkp/incubator-kie-kogito-service-db-migration-postgresql:latest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image must come from the image package. So can you bring that here? Or we can merge the image first and then you review this const. I'm about to change this versioning/image naming in the operator package to read this info from ENV/Configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to "docker.io/apache/incubator-kie-kogito-db-migrator-tool:latest"
as named in DB Migrator Image package here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, unresolving this and reverting to old image for sake of seeing how CI behaves.
packages/sonataflow-operator/internal/controller/platform/dbMigratorJob.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/dbMigratorJob.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/dbMigratorJob.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/dbMigratorJob.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/services/secrets.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/services/services.go
Show resolved
Hide resolved
...est/e2e/testdata/platform/persistence/service_based_db_migration/02-sonataflow_platform.yaml
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_Job.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rhkp I have added some comments, but couldn't finish the review.
Will continue on this after Christmas.
Many thanks!
packages/sonataflow-operator/api/v1alpha08/sonataflow_persistence_types.go
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
503f490
to
ab197e9
Compare
Can someone please help me understand the relationship between this PR and #2697? This PR's issue has no description, which makes it hard to follow what's the overall plan for the DB Migrator image. Thanks! |
90cdbd4
to
00e2a1d
Compare
packages/sonataflow-operator/config/manager/controllers_cfg.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the dbMigrationStrategy must be added to the DI and JS in this file too.
dbMigrationStrategy:
default: service
description: |-
DB Migration approach for service?
job: use job based approach
service: service itself shall migrate the db
none: no db migration needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wmedvede Where are DI and JS in this file? Please advise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhkp your observation is good, and mine too 🤔
Rethinking here, It looks like we have a sort of outdated (and not necessarily outdated) specification of the CustomResourceDefinitions in this file... i.e., not all the fields were always added to the respective CRDs.
Some fields were added, and some other don't.
For example:
we have things like path: services.jobService.podTemplate
but we don't have things like services.jobService.persistence
Which makes me think that not all the fields for the different CRDs owned by this operator where added to this file along the time. Question is, do we need them all added there? I think that not, see below.
Also, by looking at here: https://olm.operatorframework.io/docs/concepts/crds/clusterserviceversion I think the full specification of each CRD in that list is not needed (that information is not used for creating the respective CRDs), instead we could just only declare file the list of owned resources by this operator....
@ricardozanini is my reasoning correct?
packages/sonataflow-operator/internal/controller/cfg/controllers_cfg.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/services/secrets.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/k8s.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/k8s.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/k8s.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/k8s.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/k8s.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/k8s.go
Outdated
Show resolved
Hide resolved
# The Kogito PostgreSQL DB Migrator image to use (TBD: to replace with apache image) | ||
dbMigratorToolImageTag: "quay.io/rhkp/incubator-kie-kogito-service-db-migration-postgresql:latest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not forget to replace with apache image
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed as soon as the image PR is approved and image is available, we will do the same.
packages/sonataflow-operator/api/v1alpha08/sonataflow_persistence_types.go
Outdated
Show resolved
Hide resolved
packages/sonataflow-operator/internal/controller/platform/db_migrator_job.go
Outdated
Show resolved
Hide resolved
@ricardozanini @wmedvede once #2697, will this PR get approved or is there any more work needed? |
Hi @rhkp , I have built the db-migrator locally and pushed to my quay, etc, and also the latest changes in this RP. Then, after installing everything in my OpenShift, etc, when deploying a SonataFlowPlatorm I go this error: This is the platform I was working with:
However, the migrator tool image works well if I execute it locally. |
Hi @wmedvede ,
|
Hi @rhkp , Let me explain: A database produced by the DB Migrator looks like this: On the other hand, if we start the data index service (not using the db migrator) and we enable flyway for the data index, we can see a database like this: So we have a 1.5.0 and 1.5.1 files that are included by the data index service but not by the db migrator. This is basically because the data index service has a dependency on the Your work is good! but we need to make the db migrator incorporate the .sql files provided by that module. See here in the db migrator build structure: would you mind take a look ? |
f0687a7
to
7f1d3d2
Compare
Hi @wmedvede / @ricardozanini, |
@wmedvede @ricardozanini any news about this? |
@ricardozanini any progress with this change? |
@jakubschwan can you please verify? |
@@ -30,6 +30,8 @@ jobsServiceEphemeralImageTag: "docker.io/apache/incubator-kie-kogito-jobs-servic | |||
# The Data Index image to use, if empty the operator will use the default Apache Community one based on the current operator's version | |||
dataIndexPostgreSQLImageTag: "docker.io/apache/incubator-kie-kogito-data-index-postgresql:main" | |||
dataIndexEphemeralImageTag: "docker.io/apache/incubator-kie-kogito-data-index-ephemeral:main" | |||
# The Kogito PostgreSQL DB Migrator image to use (TBD: to replace with apache image) | |||
dbMigratorToolImageTag: "quay.io/rhkp/incubator-kie-kogito-service-db-migration-postgresql:latest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dbMigratorToolImageTag: "quay.io/rhkp/incubator-kie-kogito-service-db-migration-postgresql:latest" | |
dbMigratorToolImageTag: "docker.io/apache/incubator-kie-kogito-db-migrator-tool:latest" |
Can you please also review this image name in the DBMigrator Image package? https://github.com/apache/incubator-kie-tools/tree/main/packages/kogito-db-migrator-tool-image
I think it's wrong there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhkp ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree but we need the built image to be available on docker registry before we change this line. That is why we still have this comment in unresolved state. Once the image is available on docker, we will update this line and resolve this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhkp can you please double check the image tag?
Many thanks for this work, we really appreciate!
Hi @ricardozanini, ![]() |
@rhkp I meant to review this package: https://github.com/apache/incubator-kie-tools/tree/main/packages/kogito-db-migrator-tool-image to check if the image tag name is correct. |
Hi @ricardozanini I understand what you are referring to.
|
So every place required the tag |
Hi @ricardozanini But please refer to my earlier comment to @jakubschwan and to you too that we do not have the If we change the name at this moment to non-existent image, the operator will not work with DB migration job as the desired image My recommendation is to keep the current name only for now so the testing can proceed. And as soon as the real Please let me know if we are on same understanding or still we have some difference in understanding? |
@rhkp I'm not talking about changing the image name here, but in this package: https://github.com/apache/incubator-kie-tools/tree/main/packages/kogito-db-migrator-tool-image Can you please double-check if all the naming there is correct and have the expected tag name? If there's a place in that package that the name is not And I have a ticket to create the Dockerhub namespace: https://issues.apache.org/jira/browse/INFRA-26557 Once it's created we can run the Jenkins job to publish the first tag and you change it here if the PR is still opened. |
Thanks @ricardozanini. This clarifies it and I will check it first thing start of the next week and submit change PR if needed. |
Closes #2789
Implement DB Migrator Changes into SonataFlow Operator.