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.
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: -

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

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.