-
Notifications
You must be signed in to change notification settings - Fork 143
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
base: feature-operator-refactor
Are you sure you want to change the base?
feat: add support for modelmeshserving as component #1338
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
6694329
to
d862434
Compare
/test opendatahub-operator-e2e |
cb90c62
to
a833dd5
Compare
apis/components/v1/kserve_types.go
Outdated
@@ -21,6 +21,10 @@ import ( | |||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
) | |||
|
|||
const ( | |||
ModelMeshCtrlerComponentName = "odh-model-controller" // shared by kserve and mm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
f2ae263
to
206adab
Compare
2fbf65d
to
f84aa91
Compare
e363f25
to
b828d2a
Compare
} | ||
// Implement devflags support logic | ||
// If dev flags are set, update default manifests path | ||
if len(mc.Spec.DevFlags.Manifests) != 0 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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{ |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
18b90a8
to
70e59a7
Compare
a5bc347
to
d675123
Compare
Codecov ReportAttention: Patch coverage is
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. 🚨 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>
@zdtsw: The following test failed, say
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. |
Description
add modelmeshserving into component
introduce a non-DSC spec visible modelcontroller component.
How Has This Been Tested?
Screenshot or short clip
Merge criteria