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

Fix: error response handling for splitter and switch nodes #3116

Merged
merged 5 commits into from
Sep 20, 2023

Conversation

rachitchauhan43
Copy link
Contributor

@rachitchauhan43 rachitchauhan43 commented Sep 11, 2023

What this PR does / why we need it:
A bit of refactoring to keep router's code simple.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes: Does a refactoring to add uniformity to Splitter node handling. Also, added e2e tests for splitter node.

Type of changes
Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Feature/Issue validation/testing:

Please describe the tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.

  • Test A

  • Test B

  • Logs

Special notes for your reviewer:

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Checklist:

  • Have you added unit/e2e tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

Release note:


Signed-off-by: Rachit Chauhan <rachitchauhan43@gmail.com>
Signed-off-by: Rachit Chauhan <rachitchauhan43@gmail.com>
@rachitchauhan43
Copy link
Contributor Author

/cc @yuzisun

Signed-off-by: Rachit Chauhan <rachitchauhan43@gmail.com>
Signed-off-by: Rachit Chauhan <rachitchauhan43@gmail.com>
@@ -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) {
Copy link
Member

Choose a reason for hiding this comment

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

Why it is only applying to splitter or switch node ? The picked route can be any node type imo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the confusing name of the function. The intent here was ti pull out the common code that was repeating in Splitter and Switch if sections.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you look at if-else branches for Sequence and Ensemble, they already have the handling there. I can refactor more in future PRs.

@yuzisun yuzisun changed the title Refactoring Fix: error response handling for splitter and switch nodes Sep 20, 2023
@yuzisun
Copy link
Member

yuzisun commented Sep 20, 2023

Thanks @rachitchauhan43 !

Nice tests!

/lgtm
/approve

@kserve-oss-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rachitchauhan43, yuzisun

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

@kserve-oss-bot kserve-oss-bot merged commit 8231072 into kserve:master Sep 20, 2023
58 checks passed
Iamlovingit pushed a commit to Iamlovingit/kserve that referenced this pull request Oct 1, 2023
* Refactoring common code to a function

Signed-off-by: Rachit Chauhan <rachitchauhan43@gmail.com>

* Added e2e test cases for splitter nodes

Signed-off-by: Rachit Chauhan <rachitchauhan43@gmail.com>

* Fixed linting errors

Signed-off-by: Rachit Chauhan <rachitchauhan43@gmail.com>

* Minor refactoring for error message

Signed-off-by: Rachit Chauhan <rachitchauhan43@gmail.com>

---------

Signed-off-by: Rachit Chauhan <rachitchauhan43@gmail.com>
Signed-off-by: iamlovingit <freecode666@gmail.com>
ddelange added a commit to ddelange/kserve that referenced this pull request Oct 2, 2023
…mp-ray

* 'bump-ray' of https://github.com/ddelange/kserve:
  Bumping version for 0.11.1 (kserve#3141)
  Fix validation for custom storageUri (kserve#3134)
  Fix: error response handling for splitter and switch nodes (kserve#3116)
ddelange added a commit to ddelange/kserve that referenced this pull request Oct 2, 2023
* 'master' of https://github.com/kserve/kserve:
  Unpack archive files for hdfs (kserve#3093)
  Upgrade istio Api and migrate to v1beta1 Api version (kserve#3150)
  Increase pytest workers for kourier e2e test (kserve#3151)
  chore: Add design doc template links to feature request template (kserve#3155)
  Make storage initializer image configurable (kserve#3145)
  Bumping version for 0.11.1 (kserve#3141)
  Fix validation for custom storageUri (kserve#3134)
  Fix: error response handling for splitter and switch nodes (kserve#3116)
ddelange added a commit to ddelange/kserve that referenced this pull request Oct 2, 2023
* 'master' of https://github.com/kserve/kserve:
  Unpack archive files for hdfs (kserve#3093)
  Upgrade istio Api and migrate to v1beta1 Api version (kserve#3150)
  Increase pytest workers for kourier e2e test (kserve#3151)
  chore: Add design doc template links to feature request template (kserve#3155)
  Make storage initializer image configurable (kserve#3145)
  Bumping version for 0.11.1 (kserve#3141)
  Fix validation for custom storageUri (kserve#3134)
  Fix: error response handling for splitter and switch nodes (kserve#3116)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants