Skip to content

copy: add --progress-interval for CI-compatible progress output#2870

Open
IanEff wants to merge 1 commit into
podman-container-tools:mainfrom
IanEff:ci-progress-output
Open

copy: add --progress-interval for CI-compatible progress output#2870
IanEff wants to merge 1 commit into
podman-container-tools:mainfrom
IanEff:ci-progress-output

Conversation

@IanEff
Copy link
Copy Markdown

@IanEff IanEff commented May 6, 2026

In a pipe, skopeo copy was silent until success or failure.

Add --progress-interval to the copy command. When stderr is not a TTY, periodic timestamps are emitted to stderr with current blob's offset, total size, and transfer rate. Defaults to 30s in non-TTY environments, & is disabled when a TTY is detected or when --quiet is passed.

Closes #658

Copy link
Copy Markdown
Contributor

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

Thanks!

Just a very quick look now: I think this is just the wrong place, and the way this needs to completely turn off ReportWriter is an indication of that. If we can make the c/image output better, that improves all callers, including notably Podman, and we can design a reasonable output there; maintaining code that writes progress reports in one repo and code that discards those progress reports in another repo seems rather unnecessary.

Comment thread cmd/skopeo/copy.go

if opts.progressInterval > 0 {
copyOpts.ProgressInterval = opts.progressInterval
copyOpts.ReportWriter = nil // suppress TTY bar when logging to stderr
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.

I don’t see where stderr figures in this logic at all. Is that just due to resolveProgressInterval deciding based on that?


ReportWriter contains quite a bit of other information, not just blob progress, so completely turning it off is not great.

blobs := map[string]*blobState{}

for props := range ch {
dig := props.Artifact.Digest.Encoded()
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.

Encoded does not include the algorithm , that’s inaccurate as a map key.


case types.ProgressEventRead:
b := blobs[dig]
bytesPerSec := float64(props.OffsetUpdate) / interval.Seconds()
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.

??? interval.Seconds is a constant throughout the life of the function.

@TomSweeneyRedHat
Copy link
Copy Markdown
Contributor

TomSweeneyRedHat commented May 7, 2026

Neat concept, thanks @IanEff !

Our CI requires that commits be signed, and it looks like you might need a rebase too. Adjust per @mtrmac 's comments, do a git commit --amend -s for each of your commits, rebase, and push it again.

@IanEff IanEff force-pushed the ci-progress-output branch from 9223af2 to ab233b1 Compare May 10, 2026 15:03
@TomSweeneyRedHat
Copy link
Copy Markdown
Contributor

@IanEff looks like this needs a rebase.

@IanEff IanEff force-pushed the ci-progress-output branch from ab233b1 to 399e79d Compare May 14, 2026 20:53
In a pipe, skopeo copy was completely silent until success or failure.
Wire the progress channel exposed by containers/image to emit
timestamped progress updates to stderr suitable for CI logging.

Auto-detects non-TTY environments.  Suppressed by --quiet.

Closes podman-container-tools#658

Ian Furst <ian.furst@gmail.com>

Signed-off-by: Ian Furst <ian.furst@gmail.com>
@IanEff IanEff force-pushed the ci-progress-output branch from 399e79d to eb926b4 Compare May 14, 2026 21:25
@IanEff
Copy link
Copy Markdown
Author

IanEff commented May 14, 2026

@mtrmac I'm inclined to agree. I'll abandon this and go sniffing upstream in c/image, make the changes there. Thank you for your feedback on my commit!

@TomSweeneyRedHat Thanks!

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.

Please provide a basic progress / transfer speed output ("CI compatible") on copy

3 participants