-
Notifications
You must be signed in to change notification settings - Fork 198
feat: track progress on image pull/push #3904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
✅ Deploy Preview for zarf-docs canceled.
|
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Codecov ReportAttention: Patch coverage is
... and 14 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
src/internal/packager/images/pull.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's easier to review this with whitespace hidden
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love improvements that hits the UX. Minor items that come to mind - also believe some of this could be potentially unit tested in some capacity?
const defaultProgressInterval = 5 * time.Second | ||
|
||
// StartReporting starts the reporting goroutine | ||
func (tt *TrackedTarget) StartReporting() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the push is governed by the caller-supplied context - I wonder if this should accept context and if we could remove more of the bespoke stopReports
in favor of a ctx.Done()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it should definitely accept a context. Though to get rid of the StopReporting
call we'd have to make a separate context for StartReporting
then cancel it. I like the feel of the defer StopReporting
slightly more, but I don't feel too strongly either way
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
@brandtkeller Separated out the Tracker object and created a unit test for it. I wanted to avoid creating a registry or mocking an |
) | ||
|
||
// newTestTracker creates a Tracker instance with a customizable report interval for testing. | ||
func newTestTracker(bytesRead, totalBytes int64, reporter Report, interval time.Duration) *Tracker { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran some tests locally - stepped through a few examples. We can let actual utility drive feedback for any additional guard rails that could exist.
LGTM
Description
This introduces occasional log statements to give progress during OCI pulls and pushes (images and Zarf packages).
Implementation was loosely inspired by the progressbar implementation in the ORAS CLI. Goal was to create simple a simple solution that avoids leaving users without feedback from the system for more than five seconds. UX was designed to be similar to how opentofu gives occasional progress feedback when something takes a while.
Views:




image pull on create:
image push on deploy (lowered interval for screenshot because local pushes are fast):
package pull:
package publish:
Related Issue
Fixes #3633
Checklist before merging