Skip to content

feat: resumable chunked pull for remote images - #19

Open
lczyk wants to merge 9 commits into
canonical:mainfrom
lczyk:feat/chunked-download
Open

feat: resumable chunked pull for remote images#19
lczyk wants to merge 9 commits into
canonical:mainfrom
lczyk:feat/chunked-download

Conversation

@lczyk

@lczyk lczyk commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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.

Screenshot 2026-07-15 at 12 48 06

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
lczyk requested review from Copilot and zhijie-yang and removed request for zhijie-yang July 15, 2026 10:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 blobFetcher that persists digest-keyed partial downloads and resumes via Range requests, 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.

Comment thread internal/source/fetch.go Outdated
Comment thread internal/source/fetch.go
Comment thread internal/source/fetch.go
Comment thread internal/source/copy_e2e_test.go Outdated
lczyk and others added 2 commits July 15, 2026 12:57
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Marcin Konowalczyk <marcin.konowalczyk@canonical.com>
@lczyk
lczyk marked this pull request as draft July 15, 2026 11:14
@lczyk
lczyk force-pushed the feat/chunked-download branch from 0efa3d6 to 692b0fd Compare July 15, 2026 11:44
@lczyk
lczyk marked this pull request as ready for review July 15, 2026 12:32
@lczyk
lczyk requested a review from Copilot July 15, 2026 12:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comment thread internal/source/copy_e2e_test.go Outdated
Comment thread internal/source/fetch.go Outdated
Comment thread internal/source/copy.go Outdated
lczyk and others added 3 commits July 15, 2026 15:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Marcin Konowalczyk <marcin.konowalczyk@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants