Skip to content

Add progress output to oras copy #940

@sajayantony

Description

@sajayantony

What is the version of your ORAS CLI

1.0.0

What would you like to be added?

  1. Currently when executing copy there is no output for quite some time.

    For e.g. when copying a manifest list it would be good to indicate progress that a manifest list has been found and the copy start

  2. Verbose gives much more information but these are short hashes and it would good to show fully qualified names so that the user can copy the output and maybe try copying just one manifest incase of failure

  3. The statement Exists {sha} seems odd to me. It might better read {digest} exists

  4. Before the error the manifest that caused the error for the blob should be shown.

oras copy docker.io/library/hello-world:latest ttl.sh/$IMAGE:2h --verbose
Exists  40d0cfd08617 application/vnd.docker.distribution.manifest.v2+json
Exists  f54a58bc1aac application/vnd.docker.distribution.manifest.v2+json
...
Exists  c4a09ae78232 application/vnd.docker.container.image.v1+json
Error: PUT "https://ttl.sh/v2/745b7f5d-0b42-42fd-878f-61e7900ac774/blobs/uploads/3dbbf735-6a7b-415a-9ace-22224a3b3312?_state=7lO8m8I-zjp5SiHaMB8vsGqVeyDGo7E94XjuaiVO6SZ7Ik5hbWUiOiI3NDViN2Y1ZC0wYjQyLTQyZmQtODc4Zi02MWU3OTAwYWM3NzQiLCJVVUlEIjoiM2RiYmY3MzUtNmE3Yi00MTVhLTlhY2UtMjIyMjRhM2IzMzEyIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA1LTAzVDIwOjIxOjE1Ljc2Mjc0NDUzNVoifQ%3D%3D&digest=sha256%3Ae06b772d586b58466a653b72002aee7c59496110e9ae402ff58f026e44452506": response status code 413: Request Entity Too Large

For e.g in the last line it makes it hard to try copying just the last manifest. Ideally this output should come out in copy without verbose as well and should show what the last manifest is..

❯ oras copy docker.io/library/hello-world:latest ttl.sh/$IMAGE:2h
Error: PUT "https://ttl.sh/v2/745b7f5d-0b42-42fd-878f-61e7900ac774/blobs/uploads/51c4a02e-da0c-4153-ba9f-a29e42c7191d?_state=eXbH9Stpob5J5RFBg4BP56bcq-k_ivc_qcHYMVfXezl7Ik5hbWUiOiI3NDViN2Y1ZC0wYjQyLTQyZmQtODc4Zi02MWU3OTAwYWM3NzQiLCJVVUlEIjoiNTFjNGEwMmUtZGEwYy00MTUzLWJhOWYtYTI5ZTQyYzcxOTFkIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA1LTAzVDIwOjE5OjA4LjU2ODk5OTQyNFoifQ%3D%3D&digest=sha256%3Ae06b772d586b58466a653b72002aee7c59496110e9ae402ff58f026e44452506": response status code 413: Request Entity Too Large

Proposed output

The output below shows a possible idea on how the user can see what is being copied with the type, digest and mediaType

$ oras copy docker.io/library/hello-world:latest ttl.sh/$IMAGE:2h
Copying index docker.io/library/hello-world:latest sha256:4e83453afed1b4fa1a3500525091dbfca6ce1e66903fd4c01ff015dbcb1ba33e  application/vnd.docker.distribution.manifest.list.v2+json
Copying manifest sha256:eb11b1a194ff8e236a01eff392c4e1296a53b0fb4780d8b0382f7996a15d5392 
 application\/vnd.docker.distribution.manifest.v2+json
Copying layer ...

Why is this needed for ORAS?

Improve use diagnostics and better UX for a tool that is used to interact with the registry.

Are you willing to submit PRs to contribute to this feature?

  • Yes, I am willing to implement it.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions