-
Notifications
You must be signed in to change notification settings - Fork 60
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: correct mlserver uri conversion regardless of filenames #43
fix: correct mlserver uri conversion regardless of filenames #43
Conversation
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.
Looks great! Thanks for reporting the bug and providing the fix plus a test case!
You'll need to follow the steps mentioned in the DCO check to sign off on the commits in the branch, but the changes LGTM!
Signed-off-by: xinyitan <[email protected]>
Signed-off-by: xinyitan <[email protected]>
c8b8242
to
1b628a1
Compare
Signed-off-by: xinyitan <[email protected]>
/assign @animeshsingh |
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.
Thanks @xvnyv! Just a nit on the model name used in the test but LGTM otherwise 👍
ModelPath: "data", | ||
InputFiles: []string{ | ||
"data/model-settings.json", | ||
"data/aaaaa.json", |
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.
Nit: use a more descriptive name for the model with alphabetical precedence such as a-model.json
or alpha-model.json
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.
I generally would agree, but here I think the aaaaa
drives home the point of this being a alphabetical sorting related issue
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.
Fair enough! I went back and forth on it myself and figured test case's description above it could be enough. Your call :)
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.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ckadner, tjohnson31415, xvnyv 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 |
… - bug fixes Signed-off-by: jooho <[email protected]>
…ahub-io#43) #### Motivation As documented in [this issue](kserve#40), there is currently a bug in the conversion of the `uri` provided in the MLServer `model-settings.json` file if the model files are symlinked before the uri conversion occurs. This PR is intended to fix the issue by ensuring that `model-settings.json` will always be processed first. #### Modifications The function `adaptModelLayoutForRuntime` in the MLServer adapter `server.go` was modified to ensure that, if present, the `model-settings.json` file will be placed at the head of the list of files to be processed. This makes sure that the config file will always be processed before any symlinks are created for the model files. A unit test was also added to ensure that the bug was fixed. #### Result Incorrect uri conversion bug no longer occurs even when the model files alphabetically precede the filename`model-settings.json`. Signed-off-by: xinyitan <[email protected]> Co-authored-by: xinyitan <[email protected]>
Motivation
As documented in this issue, there is currently a bug in the conversion of the
uri
provided in the MLServermodel-settings.json
file if the model files are symlinked before the uri conversion occurs. This PR is intended to fix the issue by ensuring thatmodel-settings.json
will always be processed first.Modifications
The function
adaptModelLayoutForRuntime
in the MLServer adapterserver.go
was modified to ensure that, if present, themodel-settings.json
file will be placed at the head of the list of files to be processed. This makes sure that the config file will always be processed before any symlinks are created for the model files.A unit test was also added to ensure that the bug was fixed.
Result
Incorrect uri conversion bug no longer occurs even when the model files alphabetically precede the filename
model-settings.json
.Resolves #40