fix: InferenceService healthy condition change (#18340)

* fix: InferenceService healthy condition change

With Kerver upgrade to v12.0, Inference graphs and Inference Services can be deployed in raw mode that reduces overall resources that gets created.
Several knative resource dependency has been reduced. There by reduces the number of conditions in the status field as well.

Signed-off-by: Mopuri, Bharath <bharath_mopuri@intuit.com>

* fix: addressed code review comments

Protected new changes with a specific kserve v12 onwards Rawdeployment mode while keeping the existing resource checks as is.

Signed-off-by: Mopuri, Bharath <bharath_mopuri@intuit.com>

* Update resource_customizations/serving.kserve.io/InferenceService/health.lua

Co-authored-by: Rachit Chauhan <rachitchauhan43@gmail.com>
Signed-off-by: bmopuri <bharath.mopuri@gmail.com>

---------

Signed-off-by: Mopuri, Bharath <bharath_mopuri@intuit.com>
Signed-off-by: bmopuri <bharath.mopuri@gmail.com>
Co-authored-by: Mopuri, Bharath <bharath_mopuri@intuit.com>
Co-authored-by: Rachit Chauhan <rachitchauhan43@gmail.com>
This commit is contained in:
bmopuri 2024-06-10 11:25:44 -07:00 committed by GitHub
parent 2547abc82d
commit 45d68422da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 1 deletions

View file

@ -1,3 +1,13 @@
-- isInferenceServiceInRawDeploymentMode determines if the inference service deployed in RawDeployment mode
-- KServe v12 and above supports Rawdeployment for Inference graphs. For Inference services, KServe has supported RawDeployment model since [v0.7.0](https://github.com/kserve/kserve/releases/tag/v0.7.0).
function isInferenceServiceInRawDeploymentMode(obj)
if obj.metadata.annotations == nil then
return false
end
local deploymentMode = obj.metadata.annotations["serving.kserve.io/deploymentMode"]
return deploymentMode ~= nil and deploymentMode == "RawDeployment"
end
local health_status = {}
health_status.status = "Progressing"
health_status.message = "Waiting for status update."
@ -25,7 +35,7 @@ if obj.status ~= nil and obj.status.conditions ~= nil then
end
end
end
if status_true == 5 and status_false == 0 and status_unknown == 0 then
if ((isInferenceServiceInRawDeploymentMode(obj) and status_true == 3) or status_true == 5) and status_false == 0 and status_unknown == 0 then
health_status.message = "Inference Service is healthy."
health_status.status = "Healthy"
return health_status

View file

@ -11,3 +11,7 @@ tests:
status: Healthy
message: Inference Service is healthy.
inputPath: testdata/healthy.yaml
- healthStatus:
status: Healthy
message: Inference Service is healthy.
inputPath: testdata/healthy_raw.yaml

View file

@ -0,0 +1,19 @@
apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
name: helloworld
namespace: default
annotations:
serving.kserve.io/deploymentMode: RawDeployment
spec: {}
status:
conditions:
- lastTransitionTime: '2024-05-14T03:49:11Z'
status: 'True'
type: IngressReady
- lastTransitionTime: '2024-05-16T18:48:56Z'
status: 'True'
type: PredictorReady
- lastTransitionTime: '2024-05-16T18:48:56Z'
status: 'True'
type: Ready