Skip to content

Commit

Permalink
put back PredictorReady in living condition set (kubeflow#3026)
Browse files Browse the repository at this point in the history
* put back PredictorReady in living condition set

Signed-off-by: Tessa Pham <hpham111@bloomberg.net>

* fix comments

Signed-off-by: Tessa Pham <hpham111@bloomberg.net>

---------

Signed-off-by: Tessa Pham <hpham111@bloomberg.net>
  • Loading branch information
tessapham authored Jul 10, 2023
1 parent e6a1e6f commit 8e51531
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
7 changes: 5 additions & 2 deletions pkg/apis/serving/v1beta1/inference_service_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,18 @@ var conditionsMapIndex = map[apis.ConditionType]map[ComponentType]apis.Condition
}

// InferenceService Ready condition is depending on predictor and route readiness condition
var conditionSet = apis.NewLivingConditionSet(IngressReady)
var conditionSet = apis.NewLivingConditionSet(
PredictorReady,
IngressReady,
)

var _ apis.ConditionsAccessor = (*InferenceServiceStatus)(nil)

func (ss *InferenceServiceStatus) InitializeConditions() {
conditionSet.Manage(ss).InitializeConditions()
}

// IsReady returns the readiness for the latest revision.
// IsReady returns the overall readiness for the inference service.
func (ss *InferenceServiceStatus) IsReady() bool {
return conditionSet.Manage(ss).IsHappy()
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/controller/v1beta1/inferenceservice/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ func (r *InferenceServiceReconciler) updateStatus(desiredService *v1beta1api.Inf
return nil
}

// inferenceServiceReadiness checks for the readiness of the inference
// service's latest revision/deployment.
func inferenceServiceReadiness(status v1beta1api.InferenceServiceStatus) bool {
return status.Conditions != nil &&
status.GetCondition(apis.ConditionReady) != nil &&
Expand Down
10 changes: 4 additions & 6 deletions pkg/controller/v1beta1/inferenceservice/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,8 @@ var _ = Describe("v1beta1 inference service controller", func() {
Status: "True",
},
{
Type: v1beta1.PredictorReady,
Severity: "Info",
Status: "True",
Type: v1beta1.PredictorReady,
Status: "True",
},
{
Type: v1beta1.PredictorRouteReady,
Expand Down Expand Up @@ -926,9 +925,8 @@ var _ = Describe("v1beta1 inference service controller", func() {
Status: "True",
},
{
Type: v1beta1.PredictorReady,
Severity: "Info",
Status: "True",
Type: v1beta1.PredictorReady,
Status: "True",
},
{
Type: v1beta1.PredictorRouteReady,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,8 @@ var _ = Describe("v1beta1 inference service controller", func() {
Status: "True",
},
{
Type: v1beta1.PredictorReady,
Severity: "Info",
Status: "True",
Type: v1beta1.PredictorReady,
Status: "True",
},
{
Type: apis.ConditionReady,
Expand Down Expand Up @@ -821,9 +820,8 @@ var _ = Describe("v1beta1 inference service controller", func() {
Status: "True",
},
{
Type: v1beta1.PredictorReady,
Severity: "Info",
Status: "True",
Type: v1beta1.PredictorReady,
Status: "True",
},
{
Type: apis.ConditionReady,
Expand Down Expand Up @@ -1255,9 +1253,8 @@ var _ = Describe("v1beta1 inference service controller", func() {
Status: "True",
},
{
Type: v1beta1.PredictorReady,
Severity: "Info",
Status: "True",
Type: v1beta1.PredictorReady,
Status: "True",
},
{
Type: apis.ConditionReady,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,6 @@ func createHTTPMatchRequest(prefix, targetHost, internalHost string, isInternal
}

func createIngress(isvc *v1beta1.InferenceService, useDefault bool, config *v1beta1.IngressConfig) *v1alpha3.VirtualService {
serviceHost := getServiceHost(isvc)
if serviceHost == "" {
return nil
}

if !isvc.Status.IsConditionReady(v1beta1.PredictorReady) {
status := corev1.ConditionFalse
if isvc.Status.IsConditionUnknown(v1beta1.PredictorReady) {
Expand Down Expand Up @@ -313,6 +308,7 @@ func createIngress(isvc *v1beta1.InferenceService, useDefault bool, config *v1be
}
}
isInternal := false
serviceHost := getServiceHost(isvc)
//if service is labelled with cluster local or knative domain is configured as internal
if val, ok := isvc.Labels[constants.VisibilityLabel]; ok && val == constants.ClusterLocalVisibility {
isInternal = true
Expand Down

0 comments on commit 8e51531

Please sign in to comment.