-
Notifications
You must be signed in to change notification settings - Fork 815
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
Copy statistics #1477
Comments
The As far as the Skopeo CLI, the progress bars do contain some size information, but it’s human-focused, not structured for parsing/summarization, and I’m not sure how to combine the two well. Do you have a specific proposal in mind? |
@mtrmac Just some background, I'm using skopeo in k8s-image-swapper and would like to provide statistics via prometheus, e.g. primarily how much data was copied, how many layers, the total size of the image, etc. I would imagine providing an output format parameter similar to |
That could work, though figuring out a long-term stable JSON format might not be quite trivial, especially for in-progress updates where Also perhaps compare #658 . Would you be interested in preparing a PR? |
@mtrmac I'm trying to implement
Snippet: package main
import (
"context"
"os"
"github.com/containers/image/v5/copy"
"github.com/containers/image/v5/signature"
"github.com/containers/image/v5/transports/alltransports"
"github.com/containers/image/v5/types"
"github.com/davecgh/go-spew/spew"
)
func main() {
ctx := context.TODO()
policy := &signature.Policy{Default: []signature.PolicyRequirement{signature.NewPRInsecureAcceptAnything()}}
//policy, err := signature.DefaultPolicy(nil)
policyCtx, _ := signature.NewPolicyContext(policy)
defer policyCtx.Destroy()
srcRef, _ := alltransports.ParseImageName("docker://docker.io/library/busybox:latest")
destRef, _ := alltransports.ParseImageName("dir:/tmp/images")
spew.Dump(srcRef, destRef)
spew.Dump(srcRef.Transport().Name())
spew.Dump(destRef.Transport().Name())
spew.Dump(policyCtx.Policy)
srcCtx := &types.SystemContext{
DockerRegistryUserAgent: "k8s-image-swapper/1.1.0",
}
destCtx := &types.SystemContext{
DockerRegistryUserAgent: "k8s-image-swapper/1.1.0",
}
opts := ©.Options{
ReportWriter: os.Stdout,
SourceCtx: srcCtx,
DestinationCtx: destCtx,
ImageListSelection: copy.CopyAllImages,
}
image, err := copy.Image(ctx, policyCtx, destRef, srcRef, opts)
spew.Dump(image, err)
} |
I’d expect this should end up integrated in
Are you saying A possible crash path is that if
See |
A friendly reminder that this issue had no activity for 30 days. |
Would it be possible to generate and return statistics on how much data was copied?
The text was updated successfully, but these errors were encountered: