fix(agent): Use type from storage config and enforce name matches config #4780
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
Motivation
There are two ways of providing storage configs for models to the Core v2 agent:
.spec.storageConfig
field, which creates an ad-hoc config for Rclone.These mechanisms currently behave somewhat differently.
When use pre-configured configs (not specific to a given model), the assumption is that the model uses a
storageUri
with a scheme matching a known config. For example, Rclone might have config for a remote calledgs
and the model might have a storage URI likegs://seldon-models/mlserver/iris
.When using ad-hoc configs, the agent currently assumes the URI scheme (
gs
in this example) is the Rclonetype
of the remote. However, we require storage configs to already have a type and, in fact, a name.This PR brings the ad-hoc behaviour in line with that of the pre-configured configs. The type from the config is used as the Rclone type and the name is expected to match the URI scheme, as Rclone would normally expect. This is simpler, consistent, and avoids confusion about what to call a remote depending on how a config is used.
Issues
N/A
What
Changes
Type
as Rclone type for ad-hoc configs.Testing
I have a simple Core v2 setup with MinIO as an S3 provider. I have set up a storage secret in line with this.
The basic model looks like this:
"name from URI (s3) does not match secret (minio); are you using the right storage config?"
seldon model infer iris '{"id": "test", "inputs": [{"name": "predict", "shape": [1, 4], "datatype": "FP32", "data": [[4, 0.1, 2.4, 3.3]]}]}' --inference-host XXX