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

bugfix/model-lifeycle-deletion #108

Conversation

MarkRoss-Eviden
Copy link
Contributor

@MarkRoss-Eviden MarkRoss-Eviden commented Mar 12, 2025

Issue #, if available:
Fixes #107

Description of changes:
Update to the model optimizer code to query the original S3 object's tags and then apply them to the optimized model when it is uploaded back to S3.

This change was made because since model optimization was introduced models are no longer getting deleted from S3 after 15 days. The route cause is that whilst the tags are originally applied to the model, and are respected when they're copied from the upload bucket to the model bucket, they're then lost when the optimization routine runs.

Model in S3 before changes: -
image

Model in S3 after the changes in this PR, the original tag is preserved: -
image

It's coded in such a way that it'll respect future tags if others are added to the original file via the UI upload process.

As a side note I deployed DREM to test this fix into an account where DREM hasn't been installed before. It errors because a service-linked role to deploy CodeStar Notifications does not exist. I've therefore also added a note in the Readme to that affect for now, and will raise a new issue for that topic.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@MarkRoss-Eviden MarkRoss-Eviden marked this pull request as ready for review March 12, 2025 19:45
@StevenAskwith StevenAskwith self-requested a review March 12, 2025 21:01
@StevenAskwith StevenAskwith added the bug Something isn't working label Mar 12, 2025
Copy link
Contributor

@StevenAskwith StevenAskwith left a comment

Choose a reason for hiding this comment

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

Approved

@StevenAskwith StevenAskwith merged commit 4aa28f0 into aws-solutions-library-samples:main Mar 12, 2025
4 checks passed
@StevenAskwith StevenAskwith mentioned this pull request Mar 12, 2025
StevenAskwith added a commit that referenced this pull request Mar 12, 2025
## What's Changed
* bugfix/model-lifeycle-deletion by @MarkRoss-Eviden in #108
* Optimize Status Update Step Function by @larsll in #106

## New Contributors
* @MarkRoss-Eviden made their first contribution in #108

**Full Changelog**: v2.9.1...v2.9.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Models not automatically deleted by DREM after 15 days
2 participants