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

Use gcr-cleaner to clean up pushed images to GCR during dev-loop #5620

Open
tejal29 opened this issue Mar 31, 2021 · 3 comments
Open

Use gcr-cleaner to clean up pushed images to GCR during dev-loop #5620

tejal29 opened this issue Mar 31, 2021 · 3 comments
Labels
area/docs area/prune help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/documentation kind/feature-request priority/p2 May take a couple of releases

Comments

@tejal29
Copy link
Contributor

tejal29 commented Mar 31, 2021

Skaffold dev when pushing images could leave behind a lot of clutter costing users money.

Currently our docs, mention user had to perform cleanup on their own for images pushed remotely.

This task involves

  1. documenting use of this new tool https://github.com/sethvargo/gcr-cleaner
  2. hooking it up with skaffold delete so skaffold can clean up remote pushed images,
@tejal29 tejal29 changed the title Use gcr-cleaner to clean up tagged images and untagged images Use gcr-cleaner to clean up pushed images to GCR during dev-loop Mar 31, 2021
@tejal29 tejal29 added priority/p2 May take a couple of releases kind/feature-request labels Mar 31, 2021
@nkubala nkubala added the help wanted We would love to have this done, but don't have the bandwidth, need help from contributors label Apr 1, 2021
@sladyn98
Copy link
Contributor

I can give this a shot, so I was reading the documentation for the gcr-cleaner, in order to hook it up to the skaffold delete, would we be running all the steps as mentioned in the readme or just spin up the image inside, I am not too familiar to the architecture so help would be appreciated
@tejal29

@tejal29
Copy link
Contributor Author

tejal29 commented May 11, 2021

Thanks @sladyn98. I haven't looked much into this. I was hoping, if we could re-use the code/lib to delete images which skaffold should already have knowledge of.

I see there is support for deleteOne https://github.com/sethvargo/gcr-cleaner/blob/main/pkg/gcrcleaner/cleaner.go#L154

It could be great if we can call this function deleteOne in background on all the images that were created in the current skaffold run.

@sladyn98
Copy link
Contributor

@tejal29 Thanks for the input, I was going through the code and found that we have a function that calls and returns the builders for the image https://github.com/GoogleContainerTools/skaffold/blob/master/pkg/skaffold/event/util.go#L93
Would we want to call a skaffold.runBackground and then the run deleteOne inside of it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs area/prune help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/documentation kind/feature-request priority/p2 May take a couple of releases
Projects
None yet
Development

No branches or pull requests

4 participants