-
Notifications
You must be signed in to change notification settings - Fork 1k
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 validation for custom storageUri #3134
Fix validation for custom storageUri #3134
Conversation
Signed-off-by: Jin Dong <jdong183@bloomberg.net>
Signed-off-by: Jin Dong <jdong183@bloomberg.net>
func TestAzureBlobNoAccountFails(t *testing.T) { | ||
g := gomega.NewGomegaWithT(t) | ||
isvc := makeTestInferenceService() | ||
isvc.Spec.Predictor.Tensorflow.StorageURI = proto.String("https://blob.core.windows.net/triton/simple_string/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This uri is actually supported in the new CR because "https" is a valid prefix. Just want to note that this is a behavior change.
func TestAzureBlobNoContainerFails(t *testing.T) { | ||
g := gomega.NewGomegaWithT(t) | ||
isvc := makeTestInferenceService() | ||
isvc.Spec.Predictor.Tensorflow.StorageURI = proto.String("https://foo.blob.core.windows.net/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
pkg/controller/v1beta1/inferenceservice/components/explainer.go
Outdated
Show resolved
Hide resolved
if err != nil { | ||
return err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if the storage container CR does not exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments. If no CR exists, it will be exactly the same as the current behavior.
Signed-off-by: Jin Dong <jdong183@bloomberg.net>
Thanks @greenmoon55 ! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: greenmoon55, 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 |
* Move storage uri check from validator to pod mutator Signed-off-by: Jin Dong <jdong183@bloomberg.net> * Move storage uri validation to controller Signed-off-by: Jin Dong <jdong183@bloomberg.net> * Fix test Signed-off-by: Jin Dong <jdong183@bloomberg.net> * Fix tests, add comments, and remove model transition status Signed-off-by: Jin Dong <jdong183@bloomberg.net> --------- Signed-off-by: Jin Dong <jdong183@bloomberg.net> Signed-off-by: iamlovingit <freecode666@gmail.com>
…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)
* '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)
* '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)
What this PR does / why we need it:
We introduced storage container CRD in #3060 which allows users to use any custom storage uri and customize the container spec.
For more information, please take a look at the design doc and the default StorageContainer CR.
However, we reject storage uris which are supported in a storage container CR because we have another validation in the validatingwebhook, which rejects uris not supported by the default storage initializer image.
This PR fixes the validation to allow custom uris that are supported by a storage container CR, and moves the validation logic from validatingwebhook to the controller.
Alternatives considered
Breaking change
Some invalid Azure uris will pass the validation if they have the default StorageContainer CR installed because the last line allows all http(s) uris.
Examples:
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 #3121
Type of changes
Please delete options that are not relevant.
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 1 Custom storage uri + custom StorageContainer CR
Inference service created and no error in the controller
Test 2 Custom storage uri + default StorageContainer CR + custom StorageContainer CR
Same result as above.
Test 3 Custom storage uri + no StorageContainer CR
Test 4 Supported uri + no StorageContainer CR
Test 5 Supported uri + default StorageContainer CR
Same result as above
Special notes for your reviewer:
Checklist:
Release note: