fix: mlflow plugin model deletion #8283
Open
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.
What does the PR do?
This PR fixes a bug where deleting a deployed model using the mlflow plugin (e.g.,
name
) would also delete other models with similar prefixes (e.g.,name_1
).The fix ensures an exact match by appending a
/
to the folder prefix. It also introduces a paginator to handle folders containing more than 1,000 objects correctly.Checklist
Agreement
<commit_type>: <Title>
pre-commit install, pre-commit run --all
)Commit Type:
Check the conventional commit type
box here and add the label to the GitHub PR.
Where should the reviewer start?
deploy/mlflow-triton-plugin/mlflow_triton/deployments.py
Test plan:
model
andmodel_1
)model
and check whethermodel_1
is still presentCaveats:
This was tested on Minio S3 storage. I've tried to optimize it to work with other S3-compatible storage, but I don't have the means to test it extensively
Background
I was deleting a model from Triton Inference Server using the MLflow plugin, and that led to all the models with the same prefix as the requested model name being deleted...
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)