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

feat: add gate in TrustyAI if ISVC CRD is not in the cluster #1620

Merged
merged 8 commits into from
Feb 11, 2025

Conversation

zdtsw
Copy link
Member

@zdtsw zdtsw commented Feb 6, 2025

if Trustyai is enabled but cluster does not have ISVC (new cluster, cluster never had serving enabled)
DSC.status.components.trustyai

  • InferenceServiceCRDMissing"
  • InferenceServices CRD does not exist, please enable serving component first

Description

Due of the ongoing changes in TrustyAI, SR wont be a problem any more, the only dependency is ISVC
this requires trustyai-explainability/trustyai-service-operator#400 and its sync to ODH done first

https://issues.redhat.com/browse/RHOAIENG-19261

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

@zdtsw zdtsw requested review from ruivieira and lburgazzoli and removed request for MarianMacik and ykaliuta February 6, 2025 11:12
@zdtsw zdtsw changed the title feat: add gate in TrustyAI if ISVC CRD is not in the cluster [WIP] feat: add gate in TrustyAI if ISVC CRD is not in the cluster Feb 6, 2025
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 0% with 25 lines in your changes missing coverage. Please review.

Project coverage is 20.34%. Comparing base (4b86e21) to head (0ec43fb).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...components/trustyai/trustyai_controller_actions.go 0.00% 18 Missing ⚠️
...rollers/components/trustyai/trustyai_controller.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1620      +/-   ##
==========================================
- Coverage   20.35%   20.34%   -0.01%     
==========================================
  Files         163      163              
  Lines       11155    11160       +5     
==========================================
  Hits         2271     2271              
- Misses       8644     8649       +5     
  Partials      240      240              

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

@zdtsw zdtsw changed the title [WIP] feat: add gate in TrustyAI if ISVC CRD is not in the cluster feat: add gate in TrustyAI if ISVC CRD is not in the cluster Feb 10, 2025
- remove wrong comments in test

Signed-off-by: Wen Zhou <[email protected]>
Copy link
Member

@MarianMacik MarianMacik left a comment

Choose a reason for hiding this comment

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

Looks good to me now, thanks!

@@ -55,8 +57,17 @@ func (s *componentHandler) NewComponentReconciler(ctx context.Context, mgr ctrl.
handlers.ToNamed(componentApi.TrustyAIInstanceName)),
reconciler.WithPredicates(
component.ForLabel(labels.ODH.Component(LegacyComponentName), labels.True)),
reconciler.WithPredicates(
Copy link
Contributor

@lburgazzoli lburgazzoli Feb 11, 2025

Choose a reason for hiding this comment

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

I don't remember all the low level details, but if I recall it properly, if you don't explicit use an Or, then by default it is an And , can you verify it works as intended ?

Copy link
Member Author

Choose a reason for hiding this comment

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

i think i did that at first, but not triggered reconcile, but let me try again.
the previous intenation i was to have a
OR on "kserve" "model-mesh" then the default "AND" on CRD = isvc, from the test it did not work as well (apart from the missing on TrustyAI itself)

Copy link
Member

@MarianMacik MarianMacik left a comment

Choose a reason for hiding this comment

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

LGTM.
One comment typo is optional to fix.
Thanks!

).
reconciler.WithPredicates(predicate.Or( // if TrustyAI CR is changed
component.ForLabel(labels.ODH.Component(LegacyComponentName), labels.True),
predicate.Funcs{ // OR if ISVC from kserve or model-mesh is craeted
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
predicate.Funcs{ // OR if ISVC from kserve or model-mesh is craeted
predicate.Funcs{ // OR if ISVC from kserve or model-mesh is created

Signed-off-by: Wen Zhou <[email protected]>
Copy link

openshift-ci bot commented Feb 11, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lburgazzoli, MarianMacik

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [MarianMacik,lburgazzoli]

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

@zdtsw zdtsw merged commit dc64ee1 into opendatahub-io:main Feb 11, 2025
9 of 10 checks passed
zdtsw added a commit to zdtsw-forking/opendatahub-operator that referenced this pull request Feb 12, 2025
…ahub-io#1620)

* update: add gate in TrustyAI if ISVC CRD is not in the cluster

---------
Signed-off-by: Wen Zhou <[email protected]>
(cherry picked from commit dc64ee1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants