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 force-pushed the feature/enhance-progressBar branch from 0759f25 to f4cc742 Compare November 20, 2024 20:41
@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
@kishen-v
Copy link
Contributor

/ok-to-test

@ppc64le-cloud-bot ppc64le-cloud-bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 25, 2024
@kishen-v
Copy link
Contributor

/lgtm
/hold

Thanks for the PR @priyanshikhetwani! :)

@ppc64le-cloud-bot ppc64le-cloud-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 26, 2024
@ppc64le-cloud-bot ppc64le-cloud-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 26, 2024
pkg/client/s3client.go Outdated Show resolved Hide resolved
pkg/client/s3client.go Outdated Show resolved Hide resolved
@priyanshikhetwani priyanshikhetwani force-pushed the feature/enhance-progressBar branch from f4cc742 to e3ed182 Compare November 26, 2024 07:40
@ppc64le-cloud-bot ppc64le-cloud-bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 26, 2024
@priyanshikhetwani priyanshikhetwani force-pushed the feature/enhance-progressBar branch from e3ed182 to b036d19 Compare November 26, 2024 09:31
pkg/client/s3client.go Outdated Show resolved Hide resolved
@priyanshikhetwani priyanshikhetwani force-pushed the feature/enhance-progressBar branch 2 times, most recently from 9c938cd to fe3098e Compare November 27, 2024 06:53
pkg/client/s3client.go Show resolved Hide resolved
pkg/client/s3client.go Outdated Show resolved Hide resolved
pkg/client/s3client.go Outdated Show resolved Hide resolved
pkg/client/s3client.go Outdated Show resolved Hide resolved
@priyanshikhetwani priyanshikhetwani force-pushed the feature/enhance-progressBar branch 5 times, most recently from fb14afc to 40d0bb1 Compare December 2, 2024 04:54
@kishen-v
Copy link
Contributor

kishen-v commented Dec 2, 2024

/lgtm

@ppc64le-cloud-bot ppc64le-cloud-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 2, 2024
go.mod Outdated Show resolved Hide resolved
cmd/image/sync/mock/sync_client_generated.go Outdated Show resolved Hide resolved
@priyanshikhetwani priyanshikhetwani force-pushed the feature/enhance-progressBar branch from 40d0bb1 to 2579a90 Compare December 2, 2024 07:17
@ppc64le-cloud-bot ppc64le-cloud-bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 2, 2024
@ppc64le-cloud-bot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@priyanshikhetwani priyanshikhetwani force-pushed the feature/enhance-progressBar branch from 2579a90 to 04fb640 Compare December 2, 2024 07:43
go.mod Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. ok-to-test Indicates a non-member PR verified by an org member that 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.

4 participants