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

Track object upload status through a progress bar #697

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

priyanshikhetwani
Copy link
Contributor

@priyanshikhetwani priyanshikhetwani commented Nov 11, 2024

What happened:

RFE:
Convert upload size to the nearest KB/MB/GB, rather than bytes.
During image upload, the size is represented in bytes which can be better represented in KB/MB/GB based on the corresponding object that is being uploaded.

pvsadm/pkg/client/s3client.go

Lines 255 to 261 in ee4d801

if _, ok := r.signMap[off]; ok {
r.read += int64(n)
progress := int(float32(r.read*100) / float32(r.size))
fmt.Printf("\rUploading: Total read(bytes):%d progress:%d%%", r.read, progress)
} else {
r.signMap[off] = struct{}{}
}
This can further be improved by introducing a progress bar:
https://github.com/vbauerster/mpb

Test:
Screenshot 2024-11-21 at 2 13 27 AM

@ppc64le-cloud-bot ppc64le-cloud-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 11, 2024
@ppc64le-cloud-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: priyanshikhetwani
Once this PR has been reviewed and has the lgtm label, please assign mkumatag for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ppc64le-cloud-bot ppc64le-cloud-bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 11, 2024
@ppc64le-cloud-bot
Copy link
Contributor

Hi @priyanshikhetwani. Thanks for your PR.

I'm waiting for a ppc64le-cloud member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ppc64le-cloud-bot ppc64le-cloud-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 11, 2024
@ppc64le-cloud-bot ppc64le-cloud-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 19, 2024
@priyanshikhetwani priyanshikhetwani changed the title WIP: enhance progress bar Enhance progress bar Nov 21, 2024
@ppc64le-cloud-bot ppc64le-cloud-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 21, 2024
@kishen-v kishen-v changed the title Enhance progress bar Track object upload status through a progress bar Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants