-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Implement KFServing v1beta1 controller #1042
Conversation
/retest |
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.
Nice work as always Dan!
hookServer.Register("/validate-inferenceservices", &webhook.Admission{Handler: &inferenceservice.Validator{}}) | ||
hookServer.Register("/mutate-inferenceservices", &webhook.Admission{Handler: &inferenceservice.Defaulter{}}) | ||
|
||
if err = ctrl.NewWebhookManagedBy(mgr). |
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.
If you wanted to be fancy, you could wrap all this initialization logic in a for loop:
for resource, reconciler := range map[interface{}]Reconciler
} {
// register controller
// register webhook
}
logger.Info("Defaulting InferenceService", "namespace", isvc.Namespace, "name", isvc.Name) | ||
client, err := client.New(config.GetConfigOrDie(), client.Options{}) |
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.
It's weird to me that we don't have a way to surface errors from this. How does kubebuilder expect defaulting logic to fail?
@@ -27,7 +27,7 @@ import ( | |||
// +kubebuilder:printcolumn:name="URL",type="string",JSONPath=".status.url" | |||
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" | |||
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" | |||
// +kubebuilder:resource:path=trainedmodel,shortName=tm | |||
// +kubebuilder:resource:path=trainedmodels,shortName=tm |
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.
Reflecting on this, I kind of wish we just used the name "models". Trained or Servable is implied by nature of being part of the serving.kubeflow.org API group.
pkg/controller/v1beta1/inferenceservice/components/predictor.go
Outdated
Show resolved
Hide resolved
pkg/controller/v1beta1/inferenceservice/components/predictor.go
Outdated
Show resolved
Hide resolved
pkg/controller/v1beta1/inferenceservice/components/predictor.go
Outdated
Show resolved
Hide resolved
pkg/controller/v1beta1/inferenceservice/components/predictor.go
Outdated
Show resolved
Hide resolved
status.GetCondition(apis.ConditionReady).Status == v1.ConditionTrue | ||
} | ||
|
||
func (r *InferenceServiceReconciler) SetupWithManager(mgr ctrl.Manager) 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.
Consider moving this logic up to main.go and generalizing for all controllers.
pkg/controller/v1beta1/inferenceservice/reconcilers/knative/ksvc_reconciler.go
Outdated
Show resolved
Hide resolved
/retest |
3 similar comments
/retest |
/retest |
/retest |
/retest |
@ellistarn this is ready for review, sorry for the big PR as need to pass all the CI tests for v1beta1.. |
/retest |
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.
Good stuff!
v1 "k8s.io/api/core/v1" | ||
) | ||
|
||
// PodSpec is a description of a pod. |
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.
Can you write up why we cant use it directly?
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.
And what changes we made.
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.
updated with comments
@@ -58,21 +58,21 @@ func (t *TritonSpec) Default(config *InferenceServicesConfig) { | |||
// GetContainers transforms the resource into a container spec | |||
func (t *TritonSpec) GetContainer(metadata metav1.ObjectMeta, extensions *ComponentExtensionSpec, config *InferenceServicesConfig) *v1.Container { | |||
arguments := []string{ | |||
"trtserver", |
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.
Shouldn't this be cmd?
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.
Can't use cmd here as that will overwrite the triton's entrypoint which does bunch of stuff
https://github.com/triton-inference-server/server/blob/master/nvidia_entrypoint.sh
pkg/controller/v1beta1/inferenceservice/components/explainer.go
Outdated
Show resolved
Hide resolved
&podSpec, isvc.Status.Components[v1beta1.ExplainerComponent]) | ||
|
||
if err := controllerutil.SetControllerReference(isvc, r.Service, p.scheme); err != nil { | ||
return err |
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.
Check out errors.Wrapf()
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.
great! changed all places to use this.
pkg/controller/v1beta1/inferenceservice/components/explainer.go
Outdated
Show resolved
Hide resolved
@@ -4,7 +4,9 @@ metadata: | |||
name: "custom-simple" | |||
spec: | |||
predictor: | |||
minReplicas: 1 | |||
containers: |
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.
from an end-user "spec" perspective, what does "containers" mean? Should it be something like "componens" ...?
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.
@animeshsingh this is for custom spec and If the user is going to the custom route then they should know what "containers" mean, we do not want to reinvent the wheel to come up another similar concept.
containers: | ||
- image: codait/max-object-detector | ||
name: kfserving-container |
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.
follow up from previous one, should tell what "component" is it? predictor/explainer?
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.
this actually is the container name, should be optional.
/retest |
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.
This is a bit of a beast to review. Good starting point as far as I'm concerned
/retest |
1 similar comment
/retest |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ellistarn 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:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
This is a follow up PR for controller implementation to previous v1beta API PR #991
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #904
Special notes for your reviewer:
containers
field optionalRelease note: