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(agent): cleaning up models that fail to load #5857

Merged

Conversation

driev
Copy link

@driev driev commented Aug 30, 2024

If an error occurred whenever a model was loading, the artefacts belonging to the model would remain on disk in the model directory, potentially causing the disk to fill up unnecessarily.

This PR adds a cleanup function, which is executed whenever an error that leads to a LOAD_FAILED event occurs.

@CLAassistant
Copy link

CLAassistant commented Aug 30, 2024

CLA assistant check
All committers have signed the CLA.

@driev driev changed the title cleaning up models that fail to load fix(agent): cleaning up models that fail to load Aug 30, 2024
Copy link
Member

@lc525 lc525 left a comment

Choose a reason for hiding this comment

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

The changes lgtm.

If in the future we end up with more places where we return errors on LoadModel perhaps we'll move to a defer function with a named return value, where we test if the error is not null and do the cleanup (I've seen that in the initial commit you also had a named returned value).

@driev
Copy link
Author

driev commented Sep 2, 2024

The changes lgtm.

If in the future we end up with more places where we return errors on LoadModel perhaps we'll move to a defer function with a named return value, where we test if the error is not null and do the cleanup (I've seen that in the initial commit you also had a named returned value).

Agreeed - a defer function was the inital approach, but this seems tidier for now due to: https://github.com/SeldonIO/seldon-core/pull/5857/files#diff-9b56b9f193a85a84314608136ea3c0f5eb0f64346b70c81ebef3481fccf7ba21R618.

@driev driev merged commit 57f0dcd into SeldonIO:v2 Sep 2, 2024
3 checks passed
@driev driev deleted the INFRA-499-cleanup-artefacts-failing-to-load branch September 2, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants