Skip to content
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

Show progress bar when downloading or pushing content from/to a registry #893

Closed
1 task
FeynmanZhou opened this issue Mar 17, 2023 · 5 comments · Fixed by #1113
Closed
1 task

Show progress bar when downloading or pushing content from/to a registry #893

FeynmanZhou opened this issue Mar 17, 2023 · 5 comments · Fixed by #1113
Assignees
Labels
enhancement New feature or request logging
Milestone

Comments

@FeynmanZhou
Copy link
Member

FeynmanZhou commented Mar 17, 2023

What is the version of your ORAS CLI

v1.0.0-RC.2

What would you like to be added?

Per the discussion at ORAS slack channel, @vsoch suggests design and provide a progress bar when downloading content from the remote registry.

Why is this needed for ORAS?

It would be helpful to show the progress bar in ORAS CLI commands such as oras blob fetch, especially when downloading a big layer or blob. Sometimes, the file transfer might be stuck but users are not aware of the progress. If ORAS output displays no output for a while, it will look broken. A good spinner or progress bar/indicator can make a CLI appear to be easier to use. It’s also good to show the estimated time remaining, or even just have an animated component, to reassure them that you’re still working on it.

Similarly, we could also add a progress bar to the push scenario. This would be a UX improvement.

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

  • Yes, I am willing to implement it.
@FeynmanZhou FeynmanZhou added enhancement New feature or request good first issue Good for newcomers labels Mar 17, 2023
@shizhMSFT shizhMSFT added this to the future milestone Mar 22, 2023
@shizhMSFT shizhMSFT removed the good first issue Good for newcomers label Mar 22, 2023
@shizhMSFT
Copy link
Contributor

shizhMSFT commented Mar 22, 2023

Although we don't have a progress bar implemented for oras yet, it is possible with jq and pv. Here's an example:

$ blob_ref=ghcr.io/oras-project/oras@sha256:74529e03eae02d1fff5c05e9a6ec2089e1f5ae96421169c29a7c165346e042e4
$ size=$(oras blob fetch --descriptor $blob_ref | jq -r .size)
$ oras blob fetch $blob_ref --output - | pv -s $size > layer.bin
1.58MiB 0:00:03 [1.47MiB/s] [================================>                                ] 45% ETA 0:00:03

@qweeah qweeah modified the milestones: future, v2.0.0 Jun 5, 2023
@sbdtu5498
Copy link

sbdtu5498 commented Jun 27, 2023

How about using https://github.com/schollz/progressbar rather than depending on external utility. I have done the basic changes for the issue. Should we also implement the same for blob push as well. I will make the PR, just let me know.

@amands98
Copy link
Contributor

I am interested in working on this. // @sajayantony @FeynmanZhou @qweeah

@qweeah qweeah self-assigned this Jul 23, 2023
@qweeah
Copy link
Contributor

qweeah commented Jul 23, 2023

@amands98 Sorry for not updated the status but I have already worked on this, I have two PoC in my own fork, please check
https://github.com/qweeah/oras/releases/tag/v1.2.0-spinner
https://github.com/qweeah/oras/releases/tag/v1.2.0-bar

@qweeah
Copy link
Contributor

qweeah commented Jul 23, 2023

How about using https://github.com/schollz/progressbar rather than depending on external utility. I have done the basic changes for the issue. Should we also implement the same for blob push as well. I will make the PR, just let me know.

It contains <1.0 dependencies which we want to avoid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request logging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants