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

refac: use KServe types for InferenceServices #140

Merged
merged 1 commit into from
Apr 4, 2022

Conversation

pvaneck
Copy link
Member

@pvaneck pvaneck commented Mar 30, 2022

Motivation

With the InferenceService status now supporting the needed ModelMesh status fields, we can now use the type definitions from KServe instead of defining duplicate types here.

Modifications

This commit imports the kserve go package and uses the types defined there for InferenceServices and their related fields.
Old InferenceService type definitions are removed.

Result

InferenceService types are now only defined in one place (i.e. the kserve repo)

Ref: #99

Signed-off-by: Paul Van Eck [email protected]

Copy link
Member

@njhill njhill left a comment

Choose a reason for hiding this comment

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

This looks great, thanks @pvaneck.

We also need to make some changes for the change to use v1.Container, were you thinking to do that in this PR or a different one? I'm happy to add some changes for that too.

sigs.k8s.io/controller-runtime v0.10.2
sigs.k8s.io/yaml v1.2.0
Copy link
Member

Choose a reason for hiding this comment

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

Just FYI I was actually was preparing another PR to refresh dependencies (these and bunch of others). Fine to keep these here though.

TargetModelState: v1beta1.ModelState(predictor.Status.TargetModelState),
}
inferenceService.Status.ModelStatus.ModelCopies = &v1beta1.ModelCopies{
FailedCopies: predictor.Status.FailedCopies,
Copy link
Member

Choose a reason for hiding this comment

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

We should propagate the TotalCopies value now too, can we also add this to Predictor status?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, I planned on doing this in a separate PR since it'd require changes to the PredictorStatus spec (i.e. re-enabling LoadedCopies). Is LoadingCopies something that can just be removed from the code comments?

Copy link
Member

Choose a reason for hiding this comment

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

Well I was still hoping to support LoadingCopies at some point but to implement in a reasonable way requires some nontrivial rework of modelmesh internals, so will stay as a "possible future addition" for now.

inferenceService.Status.SetCondition(v1beta1.IngressReady, &apis.Condition{
Type: v1beta1.IngressReady,
Status: corev1.ConditionTrue,
})
Copy link
Member

Choose a reason for hiding this comment

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

What's the thinking behind this? We don't currently configure an ingress in the MM case right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hah, this tripped me up for a while as I was initially trying to set the Ready condition to True directly. In KServe, the Ready condition for an ISvc is dependent on a list of conditions mentioned here with IngressReady being one of those conditions. So, every time I call InferenceService.Status.SetCondition, if the prerequisite conditions are True, then Ready is set to True.

But I can probably find an alternative way to set the PredictorReady and Ready conditions without going through the SetCondition function. I agree that the IngressReady condition doesn't make much sense in ModelMesh.

@pvaneck
Copy link
Member Author

pvaneck commented Apr 1, 2022

We also need to make some changes for the change to use v1.Container, were you thinking to do that in this PR or a different one? I'm happy to add some changes for that too.

Yea, planned on handling ServingRuntime transitioning into a dedicated PR.

@pvaneck pvaneck marked this pull request as ready for review April 1, 2022 03:16
With the InferenceService status now supporting the needed ModelMesh
status fields, we can now use the type definitions from KServe instead
of defining duplicates here.

This commit imports the kserve go package and uses the types defined
there for InferenceServices and their related fields.

Signed-off-by: Paul Van Eck <[email protected]>
@pvaneck
Copy link
Member Author

pvaneck commented Apr 1, 2022

Had to update the FVT GH Actions workflow to free up disk space since we were running into space issues.

@kserve-oss-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: njhill, pvaneck

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@njhill
Copy link
Member

njhill commented Apr 4, 2022

/lgtm

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

Successfully merging this pull request may close these issues.

3 participants