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 support for modelmeshserving as component #1338

Open
wants to merge 4 commits into
base: feature-operator-refactor
Choose a base branch
from

Conversation

zdtsw
Copy link
Member

@zdtsw zdtsw commented Nov 4, 2024

Description

add modelmeshserving into component
introduce a non-DSC spec visible modelcontroller component.

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 Nov 4, 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 force-pushed the jira/13177 branch 2 times, most recently from 6694329 to d862434 Compare November 4, 2024 10:56
@zdtsw
Copy link
Member Author

zdtsw commented Nov 4, 2024

/test opendatahub-operator-e2e

@@ -21,6 +21,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
ModelMeshCtrlerComponentName = "odh-model-controller" // shared by kserve and mm
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
ModelMeshCtrlerComponentName = "odh-model-controller" // shared by kserve and mm
ModelControllerComponentName = "odh-model-controller" // shared by kserve and mm

I assume that it shouldn't have ModelMesh in the name if it's not modelmesh specific?

@zdtsw zdtsw force-pushed the jira/13177 branch 2 times, most recently from f2ae263 to 206adab Compare November 19, 2024 15:55
@zdtsw zdtsw force-pushed the jira/13177 branch 2 times, most recently from 2fbf65d to f84aa91 Compare November 19, 2024 17:38
@zdtsw zdtsw changed the title [WIP] feat: add support for modelmeshserving as component feat: add support for modelmeshserving as component Nov 19, 2024
@zdtsw zdtsw force-pushed the jira/13177 branch 2 times, most recently from e363f25 to b828d2a Compare November 19, 2024 17:48
}
// Implement devflags support logic
// If dev flags are set, update default manifests path
if len(mc.Spec.DevFlags.Manifests) != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

A common pattern is to try to align the happy path on the left, so I would do something like:

if len(mc.Spec.DevFlags.Manifests) == 0 {
    return nil
}

}
// Implement devflags support logic
// If dev flags are set, update default manifests path
if len(mm.Spec.DevFlags.Manifests) != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

A common pattern is to try to align the happy path on the left, so I would do something like:

if len(mc.Spec.DevFlags.Manifests) == 0 {
    return nil
}

return nil
}

func updatePodSecurityRolebinding(ctx context.Context, rr *odhtypes.ReconciliationRequest) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

we have a shared action for this

return nil
}

func updatePodSecurityRolebinding(ctx context.Context, rr *odhtypes.ReconciliationRequest) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

we have a shared action for this

Copy link
Member Author

Choose a reason for hiding this comment

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

yep this is not updated since dashbaord's change, let me remove it

}

// Deploy ModelController
if instance, err = r.ReconcileComponent(ctx, instance, componentsv1.ModelControllerComponentName, func() (error, bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Guess this should be synced with #1347

Copy link
Member Author

Choose a reason for hiding this comment

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

correct. i can comment out the placeholder for kserve first

Owns(&templatev1.Template{}).
Owns(&appsv1.Deployment{}, builder.WithPredicates(resources.NewDeploymentPredicate())).
Owns(&componentsv1.ModelMeshServing{}). // watch ModelMeshServing
Owns(&componentsv1.Kserve{}). // watch Kserve
Copy link
Contributor

Choose a reason for hiding this comment

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

is Own correct here ? I think the ModelMeshServing and Kserve are owned by the DSC

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, should be watch...... my code not match my comments

Copy link
Contributor

@lburgazzoli lburgazzoli Nov 20, 2024

Choose a reason for hiding this comment

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

the watch should also probably have some custom handler since the default one uses the part-of label to find out the parent, like a resources.ToNamed(componentsv1.ModelControllerInstanceName)

}
rr.Manifests = []odhtypes.ManifestInfo{}
// setup Manifets[0] for modelmeshserving
rr.Manifests = append(rr.Manifests, odhtypes.ManifestInfo{
Copy link
Contributor

Choose a reason for hiding this comment

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

you can probably combine line 36 & 38

main.go Outdated
if err := mmctrl.Init(p); err != nil {
return err
}
if err := mmctrl.Init(p); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

seems a duplication, probably you meant mcctrl

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, came after rebase , fixed now

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

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

Please upload report for BASE (feature-operator-refactor@d748e02). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...atasciencecluster/datasciencecluster_controller.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##             feature-operator-refactor    #1338   +/-   ##
============================================================
  Coverage                             ?   27.19%           
============================================================
  Files                                ?       60           
  Lines                                ?     4722           
  Branches                             ?        0           
============================================================
  Hits                                 ?     1284           
  Misses                               ?     3289           
  Partials                             ?      149           

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


🚨 Try these New Features:

- add new modelcontroller component: do not show in DSC.components
- e2e on modelcontroller wont run in parallel but after others are done
- if modelmesh is enabled, or kserve (later) is enabled, modelcontroller should be managed
- update: devFlag for modelcontroller + rolebinding function + watches

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
… not set modelcontroller in installatedcomponents

- do not leave component which is in Unknonw in the cluster, should be treated as Removed
- remove old "init" status updates for "enabled/disable" message
- modelcontroller is hidden component, no need to show in installedcomponents list
- steps:
  1. DSC create components CR
  2. DSc update status if failed to create any non-modelcontroller CR
  3.1 if component is enabled and component CR is created, update status to successful
  3.2 if component is disabled, remove from status if previous exist
- placeholder to update status if component CR status NotReady

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
…oncile

- change in DSC to enabled/disable kserve and modelmesh is enough to trigger reconcile on modelcontroller by DSC CR
- it directly reflect into modelcontroller .spec.kserve / .spec.modelmeshserving fileds
- keep DSC CR ad the controller for modelcontroller CR, but add modelmesh and kserve as ownerreference for now
- no need extra watches from ModelController directly to Kserve or ModelMeshServing

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

openshift-ci bot commented Nov 26, 2024

@zdtsw: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/opendatahub-operator-e2e 1cbbe66 link true /test opendatahub-operator-e2e

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Successfully merging this pull request may close these issues.

4 participants