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

update: remove cache for deployment in model reg namespace #1270

Open
wants to merge 3 commits into
base: incubation
Choose a base branch
from

Conversation

zdtsw
Copy link
Member

@zdtsw zdtsw commented Oct 1, 2024

ODH operator no need to cache deployment in model reg namespace, as we only care about the applicationnamepsace and a bunch of other for monitorings.
it was a mistake in the past to add modelreg namespace into the cache for deployment resourcec.
this PR is to remove that piece of logic + move the comments about do not label model reg namespace in better place.

Description

How Has This Been Tested?

Screenshot or short clip

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

Copy link

openshift-ci bot commented Oct 1, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from zdtsw. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zdtsw zdtsw requested review from dhirajsb and VaishnaviHire and removed request for jackdelahunt October 1, 2024 17:13
const DefaultModelRegistryCert = "default-modelregistry-cert"
const (
DefaultModelRegistryCert = "default-modelregistry-cert"
ModelRegSelector = "model-registry"
Copy link
Contributor

Choose a reason for hiding this comment

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

can we use component name?

Copy link
Member Author

Choose a reason for hiding this comment

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

thought to use Component name at first, but then it uses model-registry-operator also move type var to const.
if that is fine, i can do the change.

Copy link
Contributor

Choose a reason for hiding this comment

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

I do not have a strong opinion, and yes, '-operator' confused me as well. But on the other hand, we have pretty defined components, and the label is designed for components, so I'm biased a bit to reuse it. @lburgazzoli ?

Copy link
Member Author

Choose a reason for hiding this comment

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

we could have use model-registry-operator maybe it is easier, since all other ModelReg resource have this already used.
tbh, i feel the value for ComponentName should be model-registry not model-registry-operator at first.

Copy link
Contributor

Choose a reason for hiding this comment

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

i feel the value for ComponentName should be model-registry not model-registry-operator at first.

Yep.

main.go Outdated
&appsv1.Deployment{}: {Namespaces: deploymentCache},
&appsv1.Deployment{}: {
Namespaces: deploymentCache,
Label: pkglables.Set{labels.ODH.Component(modelregistry.ModelRegSelector): "true"}.AsSelector(),
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure I get the rationale here, are we only expected to cache model registry's deployments ?

Copy link
Member Author

Choose a reason for hiding this comment

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

you are right. need to move the selector intoe deploymentCache, otherwise, it will only get the modelreg deployment and skip all others

@zdtsw zdtsw marked this pull request as draft October 2, 2024 08:01
@zdtsw zdtsw changed the title feat: add label on the model reg namespace to help cache that namespace update: remove cache for deployment in model reg namespace Oct 2, 2024
@zdtsw zdtsw marked this pull request as ready for review October 2, 2024 08:32
Copy link
Contributor

@ajaypratap003 ajaypratap003 left a comment

Choose a reason for hiding this comment

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

There is a inline question about commented code . Rest LGTM

components/modelregistry/modelregistry.go Show resolved Hide resolved
- Operator does not need to cache deployment in this namespace
- it is up to model reg operator for resoruces created there

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (incubation@e25487a). Learn more about missing BASE report.

Additional details and impacted files
@@              Coverage Diff              @@
##             incubation    #1270   +/-   ##
=============================================
  Coverage              ?   18.96%           
=============================================
  Files                 ?       30           
  Lines                 ?     3390           
  Branches              ?        0           
=============================================
  Hits                  ?      643           
  Misses                ?     2678           
  Partials              ?       69           

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

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

Successfully merging this pull request may close these issues.

4 participants