feat: cog weights import/pull download progress - #3087
Conversation
|
LGTM |
cog weights import progress bar
cog weights import progress bar|
LGTM |
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
This PR adds live download progress display during cog weights import by plumbing a progress callback through the weight builder and ingress pipeline, with a focused test verifying progress event generation.
I found one issue with the progress display logic.
|
I'm Bonk, and I've done a quick review of your PR. This PR adds live download progress display during I found one issue with the progress display logic. Posted a batch review with a suggestion to fix intermediate files not being marked as "Download complete" in |
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
This PR adds live download progress display during cog weights import and cog weights pull by plumbing progress callbacks through the weight builder and ingress/pull pipeline, with focused tests verifying progress event generation.
I found two issues with the progress display logic.
|
Posted a batch review on PR #3087 with two suggestions:
|
|
@anish-sahoo Bonk workflow was cancelled. View workflow run · To retry, trigger Bonk again. |
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
This PR adds live download progress display during cog weights import and cog weights pull by plumbing progress callbacks through the weight builder and ingress/pull pipeline, with focused tests verifying progress event generation.
I found one remaining issue with the progress display logic.
|
I'm Bonk, and I've done a quick review of your PR. This PR adds live download progress display during I found one remaining issue with the progress display logic. 1. Posted a batch review on PR #3087 with this suggestion. |
|
I've reviewed the current state of PR #3087. Both previously identified issues have been addressed:
I've also verified the progress event plumbing through LGTM |
|
LGTM |
|
LGTM |
|
LGTM |
There was a problem hiding this comment.
Pull request overview
Adds Docker-style live progress reporting for weight downloads during cog weights import (source ingress into the local store) and cog weights pull (registry/cache fetch), including new event types and focused unit/integration tests to validate progress emission.
Changes:
- Emit per-file download progress events during
weights pull, and render them via Docker’sjsonmessageprogress UI. - Add an
io.Readerwrapper (NewProgressReader) to throttle byte-progress callbacks and wire it into both pull and import/ingress paths. - Extend tests (unit + integration) to validate progress and completion output.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/weights/pull.go | Emits PullEventFileProgress while streaming files from layers into the store. |
| pkg/weights/pull_test.go | Updates event-sequence expectations and asserts monotonic per-file progress. |
| pkg/util/progress_reader.go | Introduces throttled progress-reporting reader wrapper. |
| pkg/util/progress_reader_test.go | Verifies throttling behavior of the progress reader. |
| pkg/model/weight_builder.go | Adds aggregate WeightBuildProgress callback plumbing for imports. |
| pkg/model/packer.go | Adds progress-aware ingress path; de-dupes by digest to avoid duplicate downloads/opens. |
| pkg/model/packer_test.go | Tests aggregate ingress progress and digest de-dupe behavior. |
| pkg/docker/progress.go | Generalizes progress rendering and adds WriteLine for non-progress messages. |
| pkg/docker/progress_test.go | Ensures status updates reuse a single progress line. |
| pkg/cli/weights.go | Renders import download progress and adjusts push-status output to WriteLine. |
| pkg/cli/weights_pull.go | Renders pull progress bars/status via Docker-style progress writer. |
| integration-tests/tests/weights_pull.txtar | Asserts “Download complete” appears for import and pull flows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@anish-sahoo Bonk workflow was cancelled. View workflow run · To retry, trigger Bonk again. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.
Suppressed comments (2)
pkg/util/progress_reader.go:26
- NewProgressReader will panic if called with a nil report function (it unconditionally calls r.report in Read), but the exported API/comment doesn’t document that report must be non-nil. It’s safer for this util to treat a nil report as a no-op and just return the underlying reader.
// NewProgressReader reports throttled intermediate byte counts. It does not
// report EOF; callers should emit their own completion event.
func NewProgressReader(reader io.Reader, report func(int64)) io.Reader {
return &progressReader{
reader: reader,
pkg/weights/pull.go:273
- Per-file progress/status is emitted for every tar entry in a fetched layer, including files that were already present in the local store. This can make user-visible output inconsistent with
MissingFiles(e.g. "Pulling … (1 file(s))" but multiple "Download complete" rows). Consider only emitting progress and FileStored for the files inneeded(the missing files for this layer), and just draining cached entries to keep the tar stream in sync.
reader := util.NewProgressReader(tr, reportProgress)
if err := m.store.PutFile(ctx, file.Digest, file.Size, reader); err != nil {
return fmt.Errorf("store %s (%s): %w", file.Path, file.Digest, err)
}
written[file.Path] = true
|
LGTM |
Summary
cog weights importwarms the local weight storecog weights pullpopulates a cold local cacheTesting
mise run fmt:go:fixgo test ./pkg/cligo test ./pkg/modelgo test ./pkg/weightsmise run lint:go