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

⚠️ Remove Deppy solver #758

Merged
merged 2 commits into from
May 2, 2024
Merged

Conversation

m1kola
Copy link
Member

@m1kola m1kola commented Apr 17, 2024

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-ci openshift-ci bot 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
Copy link

netlify bot commented Apr 17, 2024

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 0b5ae33
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/662fbe218119fd00082a7e14
😎 Deploy Preview https://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.

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

tmshort commented Apr 17, 2024

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

@m1kola
Copy link
Member Author

m1kola commented Apr 17, 2024

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.

Copy link

codecov bot commented Apr 17, 2024

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).

Files Patch % Lines
...nternal/controllers/clusterextension_controller.go 83.33% 5 Missing and 5 partials ⚠️
internal/controllers/successors.go 72.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     
Flag Coverage Δ
e2e 41.82% <62.88%> (-3.71%) ⬇️
unit 56.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
Contributor

tmshort commented Apr 17, 2024

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

@m1kola
Copy link
Member Author

m1kola commented Apr 17, 2024

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.

@m1kola m1kola force-pushed the remove_resolver branch 5 times, most recently from 4f85d7a to 95d809a Compare April 18, 2024 16:28
@tmshort
Copy link
Contributor

tmshort commented Apr 18, 2024

Looks reasonable at first pass.

varshaprasad96
varshaprasad96 previously approved these changes Apr 18, 2024
Copy link
Member

@varshaprasad96 varshaprasad96 left a comment

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
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
Member Author

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.

@m1kola m1kola changed the title ⚠️ PoC: Remove Deppy solver ⚠️ Remove Deppy solver Apr 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 owner April 19, 2024 12:16
@openshift-ci openshift-ci bot 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
Member Author

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-ci openshift-ci bot 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
Member Author

m1kola commented Apr 19, 2024

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 m1kola force-pushed the remove_resolver branch 2 times, most recently from 28733c2 to d7d0522 Compare April 25, 2024 15:29
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 26, 2024
Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
@openshift-merge-robot openshift-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
Member Author

m1kola commented Apr 29, 2024

#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-ci openshift-ci bot 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
Copy link
Member

@varshaprasad96 varshaprasad96 left a comment

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-ci openshift-ci bot 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
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
Member Author

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
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
Member Author

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.

Copy link
Member

@joelanford joelanford left a comment

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
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
Member Author

m1kola commented May 1, 2024

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 e37a2e6 May 2, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants