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 events to do image cleanup correctly #29

Open
bukzor opened this issue May 9, 2016 · 4 comments
Open

use events to do image cleanup correctly #29

bukzor opened this issue May 9, 2016 · 4 comments

Comments

@bukzor
Copy link

bukzor commented May 9, 2016

We attempted this work in #28, but it fell through due to the fact that dockerd only saves the last 64 events, which is wholly insufficient for this purpose.

@dnephin: I think we really need this to get total correctness from dcgc.
The only show-stopper is the persistence of docker events; there (essentially) is none.

Can we agree on a scheme wherein we dump the docker events to disk and have dcgc read it?

I imagine we simply define an init daemon like docker events > /var/log/docker/events.log and add an --events-log option to dcgc.

@dnephin
Copy link
Contributor

dnephin commented May 9, 2016

@bukzor that's what I proposed here: #28 (comment)

dcgc already supports a file based exclude list. Whatever writes the events to disk should be able to write just the image names.

I don't think --events-log makes sense in the context of dcgc. I could see it as a separate binary (in this package) that tails events and writes the file based on a set of rules. dciew (docker custodian image event watcher) ?

@bukzor
Copy link
Author

bukzor commented May 9, 2016

The logic to take an event stream and decide which images to exclude is what we added to dcgc in #28.
I don't think pre-computing it in an external process makes sense.

The raw data is the event stream, and as such should be written to disk.
Once we have this resource we enable other, unforeseen applications to make productive use of docker events, which is a Good Smell.

Also, if we get the list of events after we get the list of images, we eliminate the race wherein we delete a very recently pulled image because we have no events for it.
Depending on an external process to do this computation opens this race back up imo.

@dnephin
Copy link
Contributor

dnephin commented May 10, 2016

I see what you're saying. It still feels a little weird to have dcgc read an event stream from a file, but I guess it's more reliable.

So I guess let's do it.

@bukzor
Copy link
Author

bukzor commented May 13, 2016

The file can be stdin in the case that you want to use docker events directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants