Skip to content

Commit

Permalink
update health check
Browse files Browse the repository at this point in the history
  • Loading branch information
strangiato committed May 30, 2024
1 parent 44dec87 commit 8c1b056
Showing 1 changed file with 29 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,57 @@
kind: InferenceService
check: |
health_status = {}
health_status.status = "Progressing"
health_status.message = "Waiting for InferenceService to report status..."
if obj.status ~= nil then
progressing = false
if obj.modelStatus ~= nil then
if obj.modelStatus.transitionStatus == "InProgress" then
progressing = true
end
end

Check failure on line 19 in components/operators/openshift-gitops/instance/components/health-check-openshift-ai/patch-inferenceservice-health-check.yaml

View workflow job for this annotation

GitHub Actions / lint-yaml

19:1 [trailing-spaces] trailing spaces
if obj.status.conditions ~= nil then
msg = ""
progressing = false
degraded = false
for i, condition in pairs(obj.status.conditions) do
if condition.message == nil then
message = ""
else
message = condition.message
end
status_false = 0
status_unknown = 0
if condition.reason == nil then
reason = ""
else
message = condition.reason
end
if condition.status == "Unknown" then
progressing = true

Check failure on line 29 in components/operators/openshift-gitops/instance/components/health-check-openshift-ai/patch-inferenceservice-health-check.yaml

View workflow job for this annotation

GitHub Actions / lint-yaml

29:1 [empty-lines] too many blank lines (3 > 2)
msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. " | " .. reason .. " | " .. message .. "\n"
if condition.status == "Unknown" then
status_unknown = status_unknown + 1
elseif condition.status == "False" then
if condition.type == "LatestDeploymentReady" then
progressing = true
else
degraded = true
status_false = status_false + 1
end
if condition.status ~= "True" then
msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status
if condition.reason ~= nil and condition.reason ~= "" then
msg = msg .. " | " condition.reason
end
if condition.message ~= nil and condition.message ~= "" then
msg = msg .. " | " condition.message
end
msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. " | " .. reason .. " | " .. message .. "\n"
msg = msg .. "\n"
end
end
if progressing == false and degraded == false then
if progressing == false and status_unknown == 0 and status_false == 0 then
health_status.status = "Healthy"
elseif progressing == true then
health_status.status = "Progressing"
elseif degraded == true then
else
health_status.status = "Degraded"
end
health_status.message = msg
else
health_status.status = "Progressing"
health_status.message = "InferenceService is creating..."
end
else
health_status.status = "Progressing"
health_status.message = "Waiting for InferenceService to report status..."
end
return health_status

0 comments on commit 8c1b056

Please sign in to comment.