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

kie-issues#2789: [sonataflow-operator] Implement DB Migrator Changes into SonataFlow Operator #2790

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

rhkp
Copy link
Contributor

@rhkp rhkp commented Dec 4, 2024

Closes #2789
Implement DB Migrator Changes into SonataFlow Operator.

const (
dbMigrationJobName = "sonataflow-db-migrator-job"
dbMigrationContainerName = "db-migration-container"
dbMigratorToolImage = "quay.io/rhkp/incubator-kie-kogito-service-db-migration-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.

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@wmedvede wmedvede left a 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!

@tiagobento
Copy link
Contributor

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!

@rhkp
Copy link
Contributor Author

rhkp commented Dec 23, 2024

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!

In short, the SonataFlow Operator PR#2790 will make use of the image created by PR#2697.

@wmedvede wmedvede requested a review from jakubschwan January 14, 2025 16:12
packages/sonataflow-operator/operator.yaml Show resolved Hide resolved
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 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

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Comment on lines +33 to +34
# 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"
Copy link
Contributor

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

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[sonataflow-operator] Implement DB Migrator Changes into SonataFlow Operator
5 participants