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
Improve progress bars, and update mpb #1530
Commits on Apr 26, 2022
-
Improve the documentation of the objects in copy/progress_reader.go a…
… tiny bit Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Commits on Apr 27, 2022
-
Move progress-bar-specific utilities from copy.go to new progress_bar…
…s.go Let's try to make copy.go shorter, and consolidate progress bar code to new copy/progress_bars.go. First, move the code from copy.go. Only moves unchanged code, should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-
Move blobChunkAccessorProxy to copy/progress_bars.go
Second part: Move blobChunkAccessorProxy to the newly established progress_bars.go. Only moves unchanged code, should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-
Rename progress_reader* to progress_channel*
... to cleanly differentiate the code related to chan<- types.ProgressProperties from the code related to progress bars. Only moves unchanged code, should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-
Remove a redundant bar.SetTotal
The same srcInfo.size was passed to createProgressBar, so this does nothing at best if size is known; if it is unknown, it seems to effectively also be a no-op with a recent version of mpb (it sets the total value to 0, the current progress at the time, but it doesn't enable auto-complete, so it doesn't make a difference). Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-
Add more operations within the scope of progress bars
Already draw the progress bar before opening the source's layer or config blob, so that the users can have a visual indication of something related to that blob happening if it takes too long. (For the .ConfigBlob() call, this might not make a difference, because in _some_ cases we trigger reading the config via .OCIConfig in checkImageDestinationForCurrentRuntime(), and the config blob is cached, but it might make a difference in the other cases, and it doesn't hurt in this one.) Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-
Track the original source blob's size in the progress bar
In particular, if the source is compressed, track the full size of the original compressed blob in the progress bar, even if the decompressed version has a different size (e.g. because the encryption adds a header or a MAC). This original size is easy to determine and eaiser to explain to users; so let's do the simple thing. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-
Wrap a *mpb.Bar in a *progressBar
This will allow us to add more state and methods to the bar object, without copy&pasting. For now, this just wraps one pointer in another, and should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-
Add progressBar.mark100PercentComplete, and use it on all progress bars
This correctly handles both the "size known" and the "size unknown" cases, and because we now record the originally-configured progress bar size in the progressBar struct, the caller doesn't need to track it. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-
Don't call bar.SetRefill with negative numbers
If srcInfo.Size == -1, the progress bar is not showing the refill value anyway (customPartialBlobDecorFunc is only used if size is known), so don't bother calling this function with nonsense data, if anything, at least to emphasize that this condition is, in principle, possible. Should not affect behavior, hopefully. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-
Update to github.com/vbauerster/mpb/v7 v7.4.1
... so that we test all of this with the new semantics. Signed-off-by: Miloslav Trmač <mitr@redhat.com>