Skip to content

Add final report to sytem prune command #2307

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GustavoKatel
Copy link

Signed-off-by: Gustavo Sampaio gbritosampaio@gmail.com

This closes #2306
This is also my first PR, so let me know if I missed anything from the guidelines. Also let me know if I missed any test case. Thanks :D

- What I did

Added a final report into the system prune command

- How I did it

Refactored the prune function of each resource to return the number of deleted objects in the process.

- How to verify it

Run the following command: ./build/docker-linux-amd64 system prune -a --volumes -f with some dangling resources.

- Description for the changelog

Refactored the prune function of each resource to return the number of deleted objects in the process. Aggregated the results in a final report to be presented after the system prune command.

- A picture of a cute animal (not mandatory but encouraged)

Here is my dorky cat Penumbra.
image

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "2306-system-prune-final-report" git@github.com:GustavoKatel/cli.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842354555496
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

Signed-off-by: Gustavo Sampaio <gbritosampaio@gmail.com>
@GustavoKatel GustavoKatel force-pushed the 2306-system-prune-final-report branch from 6205d15 to 65b660c Compare February 23, 2020 13:29
@thaJeztah
Copy link
Member

Sorry for the long delay; we are evaluating the UX for these commands, and looking if we can improve the output overall.

That said, we're wondering if this additional information adds much value; do you have a specific example how you use this information? (and what you use it for?)

@GustavoKatel
Copy link
Author

Sorry for the long delay; we are evaluating the UX for these commands, and looking if we can improve the output overall.

That said, we're wondering if this additional information adds much value; do you have a specific example how you use this information? (and what you use it for?)

to be honest, the current output shows too much info and at the same not that much. It's mostly a huge waterfall of hashes and object ids, see:

# docker system prune --all --volumes -f
Deleted Networks:

---- Several lines of names omitted ----

Deleted Images:

---- Several lines of hashes omitted ----

Deleted build cache objects:

---- Several lines of object ids omitted ----

Total reclaimed space: 17.38GB

At the end the only thing I can managed to clearly identify is the total reclaimed space. To take a sense of anything else we need to scroll back and find a way to count/visually parse then. This is not critical ofc, but I think it's a nice addition to the output and helps you to keep an eye what's been filling up. Specially for resource constrained devices.

That said and considering this was a long time ago, maybe a better way to get that info has emerged?

Anyway, happy to work on the conflicts if you all consider this has value.

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

Successfully merging this pull request may close these issues.

Feature: final report with total objects deleted per resource type in system prune
4 participants