feat: resumable chunked pull for remote images - #19
Open
lczyk wants to merge 9 commits into
Open
Conversation
Layer blobs download through ranged requests with digest-named partials in the cache tmp area, so an interrupted pull resumes from the last received byte instead of restarting. Blobs verify against manifest digests before landing in the layout; progress renders from real byte counts. Replaces the layer-stream progress wrappers, which could not survive process death.
lczyk
requested review from
Copilot and
zhijie-yang
and removed request for
zhijie-yang
July 15, 2026 10:48
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reworks remote image pulling to download layer (and other large) blobs via resumable HTTP range requests with digest-named partials, replacing the prior progress-wrapper approach so pulls can resume after process death while still verifying blob content against manifest digests.
Changes:
- Introduces a
blobFetcherthat persists digest-keyed partial downloads and resumes viaRangerequests, verifying final bytes before linking into the OCI layout. - Refactors remote layout writing to build a pull plan (raw manifest/config blobs vs fetched blobs) and writes blobs directly into the layout blob store.
- Replaces the old progress-reader wrappers and adds unit + e2e coverage for fetch/retry/resume behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/source/progress.go | Removed previous stream-wrapping progress implementation. |
| internal/source/progress_test.go | Removed tests tied to the old progress-wrapper approach. |
| internal/source/fetch.go | Added resumable ranged-blob fetcher, digest verification, progress counter, and pull planning. |
| internal/source/fetch_test.go | Added unit tests for ranged fetching, resume, restart-on-ignored-range, retries, and digest mismatch handling. |
| internal/source/copy.go | Refactored remote layout writer to plan blobs, write raw blobs, fetch large blobs with resume, and append the root descriptor. |
| internal/source/copy_e2e_test.go | Added e2e tests covering full remote pull, cache hit behavior, platform=all index pulls, and resume from pre-seeded partials. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Marcin Konowalczyk <marcin.konowalczyk@canonical.com>
lczyk
marked this pull request as draft
July 15, 2026 11:14
lczyk
force-pushed
the
feat/chunked-download
branch
from
July 15, 2026 11:44
0efa3d6 to
692b0fd
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Marcin Konowalczyk <marcin.konowalczyk@canonical.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
layer blobs download through ranged requests with digest-named partials in the cache tmp area, so an interrupted pull resumes from the last received byte instead of restarting. blobs verify against manifest digests before landing in the layout; progress renders from real byte counts.
replaces the layer-stream progress wrappers, which could not survive process death.