Skip to content

⚠️ Remove Deppy solver - #758

Merged
m1kola merged 2 commits into
operator-framework:mainfrom
m1kola:remove_resolver
May 2, 2024
Merged

⚠️ Remove Deppy solver#758
m1kola merged 2 commits into
operator-framework:mainfrom
m1kola:remove_resolver

Conversation

@m1kola

@m1kolam1kola commented Apr 17, 2024

Copy link
Copy Markdown
Member

Description

An attempt to remove Deppy and replace it with a simple catalog filtering. This also removes resolution CLI.

With this change we:

  • No longer check/solving bundle dependencies
  • No longer check bundle uniqueness on the cluster

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@openshift-ciopenshift-ciBot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 17, 2024
@netlify

netlifyBot commented Apr 17, 2024

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

NameLink
🔨 Latest commit0b5ae33
🔍 Latest deploy loghttps://app.netlify.com/sites/olmv1/deploys/662fbe218119fd00082a7e14
😎 Deploy Previewhttps://deploy-preview-758--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@m1kolam1kola closed this Apr 17, 2024
@m1kola
m1kola deleted the remove_resolver branch April 17, 2024 10:23
@m1kolam1kola reopened this Apr 17, 2024
@tmshort

Copy link
Copy Markdown
Contributor

Did you want to create a separate branch for this? e.g. rm-deppy-poc?

@m1kola

m1kola commented Apr 17, 2024

Copy link
Copy Markdown
MemberAuthor

Did you want to create a separate branch for this? e.g. rm-deppy-poc?

No, just accidentally removed the remote branch and GH closed the PR.

@codecov

codecovBot commented Apr 17, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 79.38144% with 20 lines in your changes are missing coverage. Please review.

Project coverage is 64.15%. Comparing base (32ed986) to head (0b5ae33).

FilesPatch %Lines
...nternal/controllers/clusterextension_controller.go83.33%5 Missing and 5 partials ⚠️
internal/controllers/successors.go72.97%5 Missing and 5 partials ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #758 +/- ##
==========================================
- Coverage 67.21% 64.15% -3.06% 
==========================================
Files 23 16 -7 Lines 1467 1303 -164 ==========================================
- Hits 986 836 -150 + Misses 415 404 -11 + Partials 66 63 -3 
FlagCoverage Δ
e2e41.82% <62.88%> (-3.71%)⬇️
unit56.94% <76.28%> (-4.40%)⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tmshort

Copy link
Copy Markdown
Contributor

But, if this is a PoC, you don't want it merged...?

@m1kola

Copy link
Copy Markdown
MemberAuthor

For now I'll keep in the draft. Eventually we can either split it into smaller PRs (if it is in a good enough state) or close it and use as a reference for proper removal.

Comment threadinternal/controllers/successors.go
Comment threadinternal/controllers/clusterextension_controller.go Outdated
Comment threadinternal/controllers/clusterextension_controller_test.go
Comment threadinternal/controllers/clusterextension_controller.go Outdated
Comment threadinternal/controllers/clusterextension_controller.go Outdated
Comment threadinternal/controllers/successors.go
@m1kola
m1kolaforce-pushed the remove_resolver branch 5 times, most recently from 4f85d7a to 95d809aCompareApril 18, 2024 16:28
Comment threadinternal/controllers/clusterextension_controller.go Outdated
@tmshort

Copy link
Copy Markdown
Contributor

Looks reasonable at first pass.

varshaprasad96
varshaprasad96 previously approved these changes Apr 18, 2024

@varshaprasad96varshaprasad96 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@m1kola The changes look good, just one nit.

Thanks for cleaning up the solver code and fixing cluster extension to work without it!

if err != nil {
return nil, err
}
upgradeErrorPrefix = fmt.Sprintf("error upgrading from currently installed version %q: ", installedBundleVersion.String())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: upgradeErrorPrefix can be defined as a separate error type globally, and can then be wrapped/formatted to include the bundle version, along with other respective error info like version range, or channel name in the condition. This way it's easier to check for this error with errors.Is for the client.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Wrapping errors makes them part of the API and I believe we currently do not have a use case for type checking. I suggest to leave errors opaque and add types, if/when we need them.

Comment threadinternal/controllers/clusterextension_controller.go Outdated
@m1kolam1kola changed the title ⚠️ PoC: Remove Deppy solver⚠️ Remove Deppy solverApr 19, 2024
@m1kola
m1kola marked this pull request as ready for review April 19, 2024 12:16
@m1kola
m1kola requested a review from a team as a code ownerApril 19, 2024 12:16
@openshift-ciopenshift-ciBot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 19, 2024
@@ -1,7 +1,8 @@
package variablesources_test
package controllers_test

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

It might be easier to review this file with "hide whitespace" option (-w in git diff).

@m1kola
m1kola marked this pull request as draft April 19, 2024 14:16
@openshift-ciopenshift-ciBot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 19, 2024
@m1kola

Copy link
Copy Markdown
MemberAuthor

Converted back to draft while we are looking into solving package uniqueness for ClusterExtension.

I had a chat with @joelanford about package uniqueness and we decided that it is best to not allow ClusterExtension to install the same package multiple times.

We will look into whether we can achieve that with ValidatingAdmissionPolicy. In the meantime I'm putting this on hold.

The plan is:

  • Introduce validating admission for uniqueness
  • Merge this PR (without uniqueness on the controller level)

@m1kola
m1kolaforce-pushed the remove_resolver branch 2 times, most recently from 28733c2 to d7d0522CompareApril 25, 2024 15:29
@openshift-merge-robotopenshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 26, 2024
Mikalai Radchuk added 2 commits April 29, 2024 17:34
Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
@openshift-merge-robotopenshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 29, 2024
@m1kola

Copy link
Copy Markdown
MemberAuthor

#774 and #785 are now merged. I rebased the PR to solve conflicts. Should be ready for review now.

@m1kola
m1kola marked this pull request as ready for review April 29, 2024 15:45
@openshift-ciopenshift-ciBot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 29, 2024

@varshaprasad96varshaprasad96 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The resolver removals and version filter additions look good to me!
/lgtm

@openshift-ciopenshift-ciBot added the lgtm Indicates that a PR is ready to be merged. label Apr 29, 2024
clusterExtensionList := ocv1alpha1.ClusterExtensionList{}
if err := r.Client.List(ctx, &clusterExtensionList); err != nil {

installedBundle, err := r.installedBundle(ctx, allBundles, ext)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

At some point, I know we talked about adding some labels or annotations to the BD for the installed package name and version and using that in order to derive successors.

Looking on the removed code in the installed_package variable source, I see that we never made that change. So I think it's fine to stick with that same logic like we are in this PR. But I also think we should capture a follow-up issue (if we don't already have one), to implement the installed bundle detection that way.

Somewhat related: I don't think we should have to find the existing installed bundle in the catalog in order to be able to upgrade from it.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

At some point, I know we talked about adding some labels or annotations to the BD for the installed package name and version and using that in order to derive successors.

Looking on the removed code in the installed_package variable source, I see that we never made that change. So I think it's fine to stick with that same logic like we are in this PR. But I also think we should capture a follow-up issue (if we don't already have one), to implement the installed bundle detection that way.

@joelanford I can't find the thread in upstream slack, but I think we ended up deciding against using labels and in favour of digests which were supposed to support non-image sources. We have this issue for non-image bundle types support and the idea with digests captured here.

Somewhat related: I don't think we should have to find the existing installed bundle in the catalog in order to be able to upgrade from it.

I might be missing something, but in order to support both server and legacy semantics we seem to need the following data:

  • Package name (for both server and legacy)
  • Current version (for both server and legacy)
  • Bundle name (for legacy)

Now that we have #679 we might be able to get this info from ClusterExtensions's status, but we probably don't want to to read from ClusterExtensions's status while reconciling ClusterExtensions.

Even if we store this data in labels and use on upgrades - it will be an equivalent of looking at ClusterExtensions's status.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed we should not read from ClusterExtension status. I think @varshaprasad96 is planning to include that information as labels on the Helm release secret. Prior to the helm integration landing, we could include that information as BD labels or annotations.

I could have sworn we added BD annotations for that info already, but maybe not.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

@joelanford I think you did it in your PoC a while ago and I had a draft PR which we then closed in favour of the digest idea, but we didn't get to implement the the digest idea.

@joelanfordjoelanford left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left one comment about capturing a follow-up. Otherwise LGTM to merge this as is.

@grokspawn

Copy link
Copy Markdown
Contributor

Left one comment about capturing a follow-up. Otherwise LGTM to merge this as is.

I'd merge this, but I'd like to make sure that a follow-up need is captured somewhere first. @m1kola is there an issue/pr for this yet? Could you create one (if not already existing) and mention it here?

@m1kola

Copy link
Copy Markdown
MemberAuthor

I'd merge this, but I'd like to make sure that a follow-up need is captured somewhere first. @m1kola is there an issue/pr for this yet? Could you create one (if not already existing) and mention it here?

@grokspawn we already have something that captures this. See #758 (comment) for more details.

@m1kola
m1kola added this pull request to the merge queue May 2, 2024
Merged via the queue into operator-framework:main with commit e37a2e6May 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtmIndicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@m1kola@tmshort@grokspawn@joelanford@varshaprasad96@openshift-merge-robot