Skip to content

Conversation

@agners
Copy link
Member

@agners agners commented Nov 27, 2025

Proposed change

Improves Docker pull progress reporting when using containerd snapshotter and some layers are already locally present (cached).

With containerd snapshotter, some layers skip the "Downloading" phase entirely and go directly from "Pulling fs layer" to "Download complete". These layers only receive a placeholder extra={current: 1, total: 1} instead of actual size information.

The previous fix in #6357 still required ALL layers to have extra before calculating progress, which caused the UI to jump from 0% to 70%+ when the first real layer reported after cached layers completed.

This change improves progress calculation by:

  • Separating "real" layers (with actual size > 1 byte) from "placeholder" layers (cached/small layers with size = 1)
  • Calculating weighted progress only from real layers
  • Not reporting progress until at least one real layer has size info
  • Correctly tracking stage when placeholder layers are still extracting

Before: Progress jumps 0% → 70% → 100%
After: Progress shows smooth 0% → 1% → 2% → ... → 100%

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Ruff (ruff format supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints or add-on configuration are added/changed:

With containerd snapshotter, some layers skip the "Downloading" phase
entirely and go directly from "Pulling fs layer" to "Download complete".
These layers only receive a placeholder extra={current: 1, total: 1}
instead of actual size information.

The previous fix in #6357 still required ALL layers to have extra before
calculating progress, which caused the UI to jump from 0% to 70%+ when
the first real layer reported after cached layers completed.

This change improves progress calculation by:
- Separating "real" layers (with actual size > 1 byte) from "placeholder"
  layers (cached/small layers with size = 1)
- Calculating weighted progress only from real layers
- Not reporting progress until at least one real layer has size info
- Correctly tracking stage when placeholder layers are still extracting

Tested with real-world pull events from a Home Assistant Core update
that had 12 layers where 5 skipped downloading entirely.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@agners agners added the bugfix A bug fix label Nov 27, 2025
@agners agners marked this pull request as draft November 27, 2025 16:38
When pulling Docker images with many layers, tiny layers that complete
immediately would show inflated progress (e.g., 70%) even when most
layers haven't started reporting yet. This made the UI jump to 70%
quickly, then appear stuck during actual download.

The fix scales progress by the fraction of layers that have reported:
- If 2/25 layers report at 70%, progress shows ~5.6% instead of 70%
- As more layers report, progress increases proportionally
- When all layers have reported, no scaling is applied

This ensures progress accurately reflects overall download status rather
than being dominated by a few tiny layers that complete first.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@agners
Copy link
Member Author

agners commented Dec 2, 2025

Closing, in testing progress was still not quite satisfactory. PR #6371 replaces this with a simpler approach.

@agners agners closed this Dec 2, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants