Repository navigation
Description
What is the version of your ORAS CLI
1.0.0
What would you like to be added?
-
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
-
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
-
The statement
Exists {sha}seems odd to me. It might better read{digest} exists -
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.
Activity
qweeah commentedon May 5, 2023
thanks @sajayantony for helping improve the UX, here are some comments
There are two options to solve this:
Agree, we can print full digest for non-verbose mode, and fully qualified name in verbose mode.
Maybe we can select another verb? Changing the order will break alignment in the output
I don't quite get this. Do you mean if the operation of pushing a blob fails, we output information of its closest predecessor manifest?
qweeah commentedon May 5, 2023
The proposed output looks good to me, @sajayantony can you help confirm the UX
suppose we are going the index tagged with
multiin e2e test data:current output
proposed output
qweeah commentedon May 5, 2023
@sajayantony There is a concern from my side: since the underlying oras-go SDK do copying under a bottom-up pattern, although
Copying indexis put in the very beginning, the actual copy process of index won't start until all index's predecessors are copied, which mean the debug logs of resolving and copying the index will not be shown right after theCopying indexlog and it might be difficult to correlate them.sajayantony commentedon May 8, 2023
Overall I like the updated verbose output the best :) and happy if we make the current verbose the default output so that it doesn't look like the tool is hanging.
Personally, I'm not a fan of the short digest and might be worth considering if we just want show full digests. I understand that docker does it but maybe its worth asking what is the value and how can the use use this information.
qweeah commentedon May 8, 2023
I guess they are trying to save horizontal space for the progress bar? I don't know any folk who designs the short digest output, maybe @FeynmanZhou can help ask
sajayantony commentedon May 31, 2023
@shizhMSFT - Any concerns improving the default output and prioritizing this work. Currently
cplooks like it just hangs without any user feedback.shizhMSFT commentedon Jun 2, 2023
@sajayantony Terminal size is the major concern to display lots of content where the terminal size is usually 80x24 (vt100).
The default behavior / design of
oras cpfollows the unix commandcpthat no progress bar is shown and copies silently unless it is in a verbose mode.To improve this, it would be better if we have two sets of UIs for standard output and TTY just like
dockerandbuildkitdo.The current
orasUI is designed for standard output and is friendly to script or logs. For example,oras cp localhost:5000/command/images:multi --to-oci-layout root > oras_cp.logWe need another set of UI for TTY that we can actually show a progress bar to humans. For example,
Currently, @qweeah is playing with TTYs, and we can prioritize the above work.
qweeah commentedon Jun 2, 2023
Like @shizhMSFT mentioned, terminal management is the major concern for shipping progressed copying.
Had an offline discussion with @sajayantony on this before and sharing some sights of upcoming changes:
oras cpis that it may silently work in the background without any output, which confuses our user. So the P0 task is to show human user least progress of undergoing work. This requires introducing a new set of TTY UI targeting terminal output.oras cpmore readable is another todo item but not as urgent as 1. The output should at least--verboseshould be set by default. Considering make--debugoutput to--verbosein 2.0.I am investigating 1, it should also be applicable to other issue like #893. We can continue discussing the output for 2 and 3 in this issue.
shizhMSFT commentedon Nov 22, 2023
Closed by #1138