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

[ECR] [request]: add "sinceImagePulled" countType to ECR Lifecycle policy #921

Open
mattmessinger opened this issue May 28, 2020 · 34 comments
Labels
ECR Amazon Elastic Container Registry Under consideration

Comments

@mattmessinger
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Tell us about your request
Add a new sinceImagePulled countType to ECR Lifecycle policy.

Which service(s) is this request for?
ECR

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
I would like to create an ECR Lifecycle policy that is based on when an image was last pulled. I can use such policy to infer that if an image has not been pulled in the last N months then it is not being used and I can safely delete it.

Are you currently working around this issue?
Right now we have to carefully track which images are still in use by our various build and deployed systems. This is error prone and leads to accidental deletion of images that are still being used.

@mattmessinger mattmessinger added the Proposed Community submitted issue label May 28, 2020
@rpnguyen rpnguyen added the ECR Amazon Elastic Container Registry label Jun 23, 2020
@git-pchauhan
Copy link

👍 Would love to see this getting prioritized (and am kinda surprised it's not already there!). 👍

@tata9001
Copy link

Waiting for this!!!

@daniel-baptista-travcorp

👍 Yes please

@git-pchauhan
Copy link

Totally ➕ 1️⃣

@azamsiddiqi3791
Copy link

Yes please

@shashankvs01
Copy link

Please prioritize !!

@sbkg0002
Copy link

sbkg0002 commented Mar 7, 2021

Any news on this?

@tata9001
Copy link

Please, our billing is crying!!!

@srrengar srrengar added Work in Progress and removed Proposed Community submitted issue labels Jul 14, 2021
@srrengar srrengar self-assigned this Jul 14, 2021
@srrengar srrengar moved this from Researching to We're Working On It in containers-roadmap Jul 14, 2021
@qihonggang
Copy link

waiting for this! please prioritize!

@sbkg0002
Copy link

Any update on this? We're Working On It since half a year :)

@snay2
Copy link

snay2 commented Dec 17, 2021

I opened a new issue to publish metrics for a similar usecase, in case it's useful to anyone here: #1587

@wayne-folkes
Copy link

Adding my voice to the chorus on this one. My team is pushing multi-arch images. Because of this, images are shown as untagged. Having a policy that simply deletes untagged images would be dangerous as I have no way if it is safe to delete. If I knew the image has not been pulled in the last N days would give us some confidence that we are deleting unused resources.

@arunsollet arunsollet moved this from We're Working On It to Researching in containers-roadmap May 6, 2022
@sbkg0002
Copy link

@arunsollet what happend? The metrics seem to be there now!

@snay2
Copy link

snay2 commented May 31, 2022

@sbkg0002 I see a metric for RepositoryPullCount in the docs for ECR private (released in January 2022), but not one that describes how recently an image was pulled. Can you give more detail of what you're seeing?

@ivan-moto
Copy link

Hey, any updates on this?

@volk1234
Copy link

Anybody looking into this ???

@jdkealy
Copy link

jdkealy commented Dec 9, 2022

Any updates on this ?

@jlbutler
Copy link

Hi all. We are tracking a lastRecordedPullTime but have not yet done work to integrate it into LCP. One concern we have is that while it's one piece of data, it doesn't necessarily indicate an image is safe to expire if it hasn't been pulled in some amount of time.

We were doing some work on a method to track whether or not a particular image is specified in a current deployment specification. As you may suspect that is a large bit of work and will take time to fully understand.

Given the upvotes on this issue and interest, we will pull it into consideration for our current round of planning. Thanks for the continued interest and input!

@ivanychev
Copy link

Any progress on this?

@maherrj
Copy link

maherrj commented Jan 25, 2023

100% second this. We have thousands of images across hundreds of repositories. We provide the service to our production consumers. We need to remove images but careful as to not cause an outage where an image is in use.

We had to develop a custom solution to tag the images based on CloudTrail events. Pretty horrible workaround.

@24601
Copy link

24601 commented Feb 15, 2023

100% second this. We have thousands of images across hundreds of repositories. We provide the service to our production consumers. We need to remove images but careful as to not cause an outage where an image is in use.

We had to develop a custom solution to tag the images based on CloudTrail events. Pretty horrible workaround.

Us, too. But expecting AWS to do anything that saves their customers money is, well, not something I am holding my breath for.

@aviau
Copy link

aviau commented Feb 15, 2023

@jlbutler

One concern we have is that while it's one piece of data, it doesn't necessarily indicate an image is safe to expire if it hasn't been pulled in some amount of time.

For us that wouldn't be an issue as we pull often. It covers many use cases so why not just release it while you build whatever more advanced feature you want to build?

We were doing some work on a method to track whether or not a particular image is specified in a current deployment specification.

That won't work for many use cases because not everyone that uses ECR has deployments inside AWS.

@jlbutler
Copy link

jlbutler commented Mar 2, 2023

Hi @aviau

For us that wouldn't be an issue as we pull often. It covers many use cases so why not just release it while you build whatever more advanced feature you want to build?

For sure. I was just calling out a concern that I continue to have about leveraging this value on its own to indicate that an image is not in use. But as I indicated, we definitely are planning some work to improve the usefulness of the attribute (it currently tracks manifest pulls, which can make things confusing if you really want to know if the image was pulled including its layers), and we're looking at integrating this into LCP. We are still working on our roadmap, but we'll share more when there's something concrete.

That won't work for many use cases because not everyone that uses ECR has deployments inside AWS.

Yep it gets a bit tricky. Like you said, not everyone uses ECR on AWS, and not everyone using ECR deploys on AWS. The work I referred to may not be ECR-specific, potentially working for any image digest. Part of that could be opt-in solutions (e.g. a Kubernetes controller you can install to report image use). I don't think we can serve all use cases, but we're doing some research around that now, and don't have any formal features planned with it yet.

We'll post back here when we have a more concrete timeline for this LCP request, thanks again!

@hsejour hsejour assigned hsejour and unassigned arunsollet Apr 6, 2023
@mgarber-ops
Copy link

I can see this being a nice to have but I'd be careful in situations where underlying EKS nodes are caching container images for respective workloads

@jobimrobinsantos-drizly

This feature would be extremely handy for my organization. In particular, we would like to implement this type of lifecycle on our pull-through-cache repositories.

@prashil-g
Copy link

this is very important feature to have. any update if anyone is looking into it?

@volk1234
Copy link

Well, I wait this for years but I believe that features that really helps to save costs are not in priority at all :)

@volk1234
Copy link

volk1234 commented Sep 2, 2023

@jlbutler
Any updates about research you'd mentioned?

@hsejour hsejour removed their assignment Sep 20, 2023
@seabyrn
Copy link

seabyrn commented Oct 19, 2023

Hi all. We are tracking a lastRecordedPullTime but have not yet done work to integrate it into LCP. One concern we have is that while it's one piece of data, it doesn't necessarily indicate an image is safe to expire if it hasn't been pulled in some amount of time.

Doesn't "sinceImagePushed" (which is available in LCPs) suffer from the same shortcoming?

@abhishekkundalia
Copy link

Any plans to push this or any alternative hacks to achieve this?

@blowfishpro
Copy link

any alternative hacks to achieve this?

It's possible to get the last pull time via API calls and then explicitly delete those images. This could be done e.g. by a lambda that runs periodically.

@nicc777
Copy link

nicc777 commented May 4, 2024

Almost 4 years, for what I would have thought must be an obvious option to have. Can we perhaps get some kind of an update on this? @jlbutler ?

Also, the comment "One concern we have is that while it's one piece of data, it doesn't necessarily indicate an image is safe to expire if it hasn't been pulled in some amount of time." does not make sense, since I would argue sinceImagePushed leaves you with the same issue, if not even worse.

I am busy now implementing this on our side with a whole lot of logic just to refresh an image before it expires with the standard sinceImagePushed option. Having this option will hugely simplify our container management.

@sammcj
Copy link

sammcj commented May 16, 2024

I'm seeing clients getting impacted by not being able to check if an image is in use by ECS, came looking to see how to do this and found this issue. It is badly needed.

@sbkg0002
Copy link

Until someone writes a blogpost that goes viral, which describes the costs involved, nothing will happen apparently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ECR Amazon Elastic Container Registry Under consideration
Projects
containers-roadmap
  
Researching
Development

No branches or pull requests