Skip to content

Commit

Permalink
Merge pull request #108 from israel-hdez/o-upsync-v0111
Browse files Browse the repository at this point in the history
Code sync up to upstream commit for v0.11.1
  • Loading branch information
openshift-ci[bot] authored Oct 19, 2023
2 parents 799e121 + 56d1f13 commit 8ecdb2d
Show file tree
Hide file tree
Showing 73 changed files with 43,882 additions and 554 deletions.
2 changes: 1 addition & 1 deletion charts/kserve-crd/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: kserve-crd
version: v0.11.0
version: v0.11.1
description: Helm chart for deploying kserve crds
keywords:
- kserve
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@ spec:
type: string
data:
type: string
dependency:
enum:
- Soft
- Hard
type: string
name:
type: string
nodeName:
Expand Down
2 changes: 1 addition & 1 deletion charts/kserve-resources/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: kserve
version: v0.11.0
version: v0.11.1
description: Helm chart for deploying kserve resources
keywords:
- kserve
Expand Down
4 changes: 2 additions & 2 deletions charts/kserve-resources/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kserve:
version: &defaultVersion v0.11.0
version: &defaultVersion v0.11.1
modelmeshVersion: &defaultModelMeshVersion v0.11.0
agent:
image: kserve/agent
Expand Down Expand Up @@ -109,7 +109,7 @@ kserve:
tag: *defaultVersion
torchserve:
image: pytorch/torchserve-kfs
tag: 0.8.0
tag: 0.8.2
serviceEnvelopePlaceholder: "{{.Labels.serviceEnvelope}}"
alibi:
image: kserve/alibi-explainer
Expand Down
50 changes: 27 additions & 23 deletions cmd/router/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,40 +104,44 @@ type EnsembleStepOutput struct {
StepStatusCode int
}

// See if reviewer suggests a better name for this function
func handleSplitterORSwitchNode(route *v1alpha1.InferenceStep, graph v1alpha1.InferenceGraphSpec, input []byte, headers http.Header) ([]byte, int, error) {
var statusCode int
var responseBytes []byte
var err error
stepType := "serviceUrl"
if route.NodeName != "" {
stepType = "node"
}
log.Info("Starting execution of step", "type", stepType, "stepName", route.StepName)
if responseBytes, statusCode, err = executeStep(route, graph, input, headers); err != nil {
return nil, 500, err
}

if route.Dependency == v1alpha1.Hard && !isSuccessFul(statusCode) {
log.Info("This step is a hard dependency and it is unsuccessful", "stepName", route.StepName, "statusCode", statusCode)
}
return responseBytes, statusCode, nil
}

func routeStep(nodeName string, graph v1alpha1.InferenceGraphSpec, input []byte, headers http.Header) ([]byte, int, error) {
defer timeTrack(time.Now(), "node", nodeName)
currentNode := graph.Nodes[nodeName]

if currentNode.RouterType == v1alpha1.Splitter {
return executeStep(pickupRoute(currentNode.Steps), graph, input, headers)
route := pickupRoute(currentNode.Steps)
return handleSplitterORSwitchNode(route, graph, input, headers)
}
if currentNode.RouterType == v1alpha1.Switch {
var statusCode int
var responseBytes []byte
var err error
route := pickupRouteByCondition(input, currentNode.Steps)
if route == nil {
errorMessage := "None of the routes matched with the switch condition"
err = errors.New(errorMessage)
log.Error(err, errorMessage)
return nil, 404, errors.New(errorMessage)
}
stepType := "serviceUrl"
if route.NodeName != "" {
stepType = "node"
return nil, 404, err
}
log.Info("Starting execution of step", "type", stepType, "stepName", route.StepName)
if responseBytes, statusCode, err = executeStep(route, graph, input, headers); err != nil {
return nil, 500, err
}

if route.Dependency == v1alpha1.Hard {
if !isSuccessFul(statusCode) {
log.Info("This step is a hard dependency and it is unsuccessful", "stepName", route.StepName, "statusCode", statusCode)
// Stop the execution right away if step is hard dep and is unsuccessful
return responseBytes, statusCode, nil
}
}
return responseBytes, statusCode, nil
return handleSplitterORSwitchNode(route, graph, input, headers)
}
if currentNode.RouterType == v1alpha1.Ensemble {
ensembleRes := make([]chan EnsembleStepOutput, len(currentNode.Steps))
Expand Down Expand Up @@ -221,12 +225,12 @@ func routeStep(nodeName string, graph v1alpha1.InferenceGraphSpec, input []byte,
return nil, 500, err
}
/*
Only if a step is a hard dependency, we will check for its success.
Only if a step is a hard dependency, we will check for its success.
*/
if step.Dependency == v1alpha1.Hard {
if !isSuccessFul(statusCode) {
log.Info("This step is a hard dependency and it is unsuccessful", "stepName", step.StepName, "statusCode", statusCode)
// Stop the execution right away if step is hard dep and is unsuccessful
// Stop the execution of sequence right away if step is a hard dependency and is unsuccessful
return responseBytes, statusCode, nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/runtimes/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ images:

- name: kserve-torchserve
newName: pytorch/torchserve-kfs
newTag: 0.8.0
newTag: 0.8.2
1 change: 1 addition & 0 deletions hack/generate-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ RELEASES=(
"v0.11.0-rc0"
"v0.11.0-rc1"
"v0.11.0"
"v0.11.1"
)

TAG=$1
Expand Down
2 changes: 1 addition & 1 deletion hack/quick_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ done
export ISTIO_VERSION=1.17.2
export KNATIVE_SERVING_VERSION=knative-v1.10.1
export KNATIVE_ISTIO_VERSION=knative-v1.10.0
export KSERVE_VERSION=v0.11.0
export KSERVE_VERSION=v0.11.1
export CERT_MANAGER_VERSION=v1.3.0
export SCRIPT_DIR="$( dirname -- "${BASH_SOURCE[0]}" )"

Expand Down
Loading

0 comments on commit 8ecdb2d

Please sign in to comment.