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

podman system prune should report the reclaimed space #8658

Closed
bugaevc opened this issue Dec 9, 2020 · 6 comments · Fixed by #8831
Closed

podman system prune should report the reclaimed space #8658

bugaevc opened this issue Dec 9, 2020 · 6 comments · Fixed by #8831
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@bugaevc
Copy link

bugaevc commented Dec 9, 2020

/kind feature

Description

docker system prune reports the reclaimed space at the end:

$ docker system prune
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all dangling images
  - all dangling build cache

Are you sure you want to continue? [y/N] y
Deleted Containers:
8fcb38ea15ef170c327369012e1d4c4d112f5b046f72903a334351a42b869317

Deleted Images:

deleted: sha256:418ac6a457a2544bfb1bbe9046f002fed3ee4bc1adfd1f3c4c8d45ec373fa8ac
deleted: sha256:ea8ef451b04d7a1e0019635b35bddcfe9be370eb92d952ac92a960d53ef746db
deleted: sha256:ef1dfae27b2770b314dea312dd9ed0fcf2e8bd660218c04c20f0461263c51662
deleted: sha256:740ccc93eab3e4cdd9de3eca878800a9e1f0690f2159adb40c68b7dbba5edd2e
deleted: sha256:aba0e78044385bf12a7eea4d5398bc52c1a783cb792807f4fb9dbb56e2617c1d
deleted: sha256:1e9e09fdf99a8eaba56092093bf8966b8cddcbaf8829fae9a219e9a2ff581b24
deleted: sha256:f6149cf35f6e7b18e122595f0d5392d128f92e7a8cfc17bded48126671f1e2c7
deleted: sha256:d7df63b29760f856fa577d5ca79558cce6f073d415524bd3365aedbcb41eb52f
deleted: sha256:4244afa8d27d5c13d14a4db204de8b57c67a865455d231317db67d9945ddf36b
<...snip...>
deleted: sha256:bd9f4f01725d96a1e37beb4cbf21d24c8dc9e0dafb44aac23b8b9895418c6d9a
deleted: sha256:a0ec0d50c85f08dabb61d7e5f0a9e1b0e90418e0483cb2cd90223f44d7430dfb

Total reclaimed space: 1.216GB

But podman system prune doesn't seem output the same info.

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 9, 2020
@bblenard
Copy link

I poked at this for a little bit and got something maybe working (at least for reclaimed space for images) but I'm not sure on all of the specific requirements for this feature / if the maintainers want this.

reclaimed_size_output

I can open a PR after I clean up the code more but I would want to know more of the specific requirements such as:

  • What should the relaimed space metric include exactly? Images, Volumes, etc?
  • How should the data be presented. Currently prune reports seem to have a Size: output but it seems to be unformatted and just a byte count
  • Is it okay for the Podman project to pull in dependencies such as go-units from docker if the maintainers want human readable output.

@rhatdan
Copy link
Member

rhatdan commented Dec 14, 2020

Reclaimed space should be from containers/images and volumes.
It should be displayed in Human sizes. go-units is already imported, so that is not a problem.

Thanks for working on this.

@bblenard
Copy link

@bugaevc I haven't forgotten about this issue. I'm currently trying to wrap up a different PR so I haven't been focusing on this, but I plan to.

bblenard pushed a commit to bblenard/podman that referenced this issue Dec 24, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658
@bblenard
Copy link

Made some decent progress on this. Not exactly sure the best way to test these changes and I might want to cleanup some of the prune helper functions that are no longer very useful.

progress

bblenard pushed a commit to bblenard/podman that referenced this issue Dec 24, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
@rhatdan
Copy link
Member

rhatdan commented Dec 26, 2020

Looks great.

bblenard pushed a commit to bblenard/podman that referenced this issue Dec 26, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
bblenard pushed a commit to bblenard/podman that referenced this issue Dec 26, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
bblenard pushed a commit to bblenard/podman that referenced this issue Dec 26, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
bblenard pushed a commit to bblenard/podman that referenced this issue Dec 26, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
bblenard pushed a commit to bblenard/podman that referenced this issue Dec 26, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
bblenard pushed a commit to bblenard/podman that referenced this issue Dec 26, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
bblenard pushed a commit to bblenard/podman that referenced this issue Dec 26, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
bblenard pushed a commit to bblenard/podman that referenced this issue Dec 26, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
bblenard pushed a commit to bblenard/podman that referenced this issue Dec 26, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
bblenard pushed a commit to bblenard/podman that referenced this issue Dec 26, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
bblenard pushed a commit to bblenard/podman that referenced this issue Dec 26, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
bblenard pushed a commit to bblenard/podman that referenced this issue Dec 31, 2020
This change adds code to report the reclaimed space after a prune.
Reclaimed space from volumes, images, and containers is recorded
during the prune call in a PruneReport struct. These structs are
collected into a slice during a system prune and processed afterwards
to calculate the total reclaimed space.

Closes containers#8658

Signed-off-by: Baron Lenardson <lenardson.baron@gmail.com>
@bblenard
Copy link

@bugaevc PR opened and ready for review from Podman people: #8831

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants