container icon indicating copy to clipboard operation
container copied to clipboard

Show disk usage in image list

Open amarkdotdev opened this issue 5 months ago • 6 comments

Type of Change

  • [ ] Bug fix
  • [x] New feature
  • [ ] Breaking change
  • [x] Documentation update

Motivation and Context

container image list did not include disk usage in the default table output. This adds a DISK USAGE column using the same per-variant size data already used by verbose image listing, while excluding attestation manifests reported with the unknown/unknown platform.

Fixes #1712

Testing

  • [x] Tested locally
  • [x] Added/updated tests
  • [x] Added/updated docs

Validation run locally:

  • swift test --filter ContainerCommandsTests

amarkdotdev avatar Jun 14 '26 04:06 amarkdotdev

@amarkdotdev thanks for the PR! If this addition reports the same value as that of the FULL SIZE column reported with --verbose, perhaps we should label the columns identically for both non-verbose and verbose usage?

If the value is a reasonable approximation of disk usage, I prefer what you have – DISK USAGE – to FULL SIZE.

jglogan avatar Jun 14 '26 20:06 jglogan

Thanks, that makes sense. This value is not exactly the same shape as the verbose FULL SIZE column: verbose output emits one row per platform variant, while the default table has one row per image reference and aggregates the non-attestation variant sizes for that image. Given that, I think DISK USAGE is the clearer label here.

amarkdotdev avatar Jun 14 '26 20:06 amarkdotdev

@jglogan This PR is related (somewhat) to the changes here and is been ready for a final ✅ . Just wanted to bring it to your inbox, in case there is overlap here.

saehejkang avatar Jun 16 '26 00:06 saehejkang

Thanks for the heads-up @saehejkang. I took a look at #991 — I think the two changes are complementary rather than conflicting:

  • #991 fixes how the size value is calculated for the verbose listing (snapshot/unpacked size with a compressed-blob fallback), mostly in ImageList.swift and the images service.
  • This PR (#1720) adds a DISK USAGE column to the default (non-verbose) table by aggregating the non-attestation variant sizes, in ImageResource+ListDisplayable.swift.

The only file they both touch is docs/command-reference.md, and the edits are in different sections, so whichever lands second is a trivial rebase. If #991 merges first and the team would prefer the default column to reuse its improved size semantics, I'm happy to follow up and align this column with it.

On the naming: per @jglogan's preference above I've kept DISK USAGE (the default-table value aggregates per-image variant sizes, which is a slightly different shape than the verbose per-variant FULL SIZE). Happy to adjust if you'd like them unified. PTAL whenever you have a moment.

amarkdotdev avatar Jun 17 '26 18:06 amarkdotdev

Hi @jglogan — just checking in on this when you have a moment. Happy to rename the column to match verbose output if you prefer; my earlier note was that the default table shows one row per image reference while verbose lists per-platform variants, so the semantics differ slightly. Open to whatever naming keeps the UX clearest.

Also saw @saehejkang's pointer to #991 — still looks complementary from my side (#991 fixes size calculation; this adds a default-column size display). Let me know if you'd like any changes before review. Thanks!

amarkdotdev avatar Jun 23 '26 17:06 amarkdotdev

@jglogan Gentle ping — you commented on the DISK USAGE vs FULL SIZE naming back in June and I think we're aligned, but this hasn't had a formal review yet.

Quick recap: default table shows one row per image reference with aggregated non-attestation variant sizes; verbose still lists per-platform FULL SIZE. Happy to align with #991's improved size semantics if that's landed and you'd prefer consistency.

Also noting CI hasn't run on this fork PR — let me know if you need anything from my side to get workflows going. Thanks!

amarkdotdev avatar Jul 05 '26 19:07 amarkdotdev