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

UI progress bars stepping on each other #11069

Open
aidagha opened this issue Apr 11, 2021 · 12 comments
Open

UI progress bars stepping on each other #11069

aidagha opened this issue Apr 11, 2021 · 12 comments
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@aidagha
Copy link
Contributor

aidagha commented Apr 11, 2021

I noticed that preloaded-images-k8s and index.docker.io/kicbase progress bars step on each other when download is in progress and it is confusing for the user and might be interpreted as a glitch. When the download is finished, they are displayed in separate lines:

minikube start --driver=docker
😄  minikube v1.19.0 on Darwin 10.15.7
✨  Using the docker driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
💾  Downloading Kubernetes v1.20.2 preload ...
    > gcr.io/k8s-minikube/kicbase...: 357.67 MiB / 357.67 MiB  100.00% 396.74 K
    > preloaded-images-k8s-v10-v1...: 491.71 MiB / 491.71 MiB  100.00% 411.47 K
    > index.docker.io/kicbase/sta...: 357.67 MiB / 357.67 MiB  100.00% 417.22 K
@afbjorklund
Copy link
Collaborator

afbjorklund commented Apr 12, 2021

The library itself handles this, so it must be something in how we use it.

https://github.com/cheggaaa/pb/blob/master/example_multiple_test.go

First  98 / 200 [=======================>-----------------------]  49.00% 00m04s
Second  94 / 200 [=====================>------------------------]  47.00% 00m05s
Third  89 / 200 [====================>--------------------------]  44.50% 00m05s

@afbjorklund afbjorklund added the kind/bug Categorizes issue or PR as related to a bug. label Apr 12, 2021
@ilya-zuyev ilya-zuyev added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. sig/ui Categorizes an issue or PR as relevant to SIG UI. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Apr 14, 2021
@sharifelgamal sharifelgamal removed the sig/ui Categorizes an issue or PR as relevant to SIG UI. label Apr 21, 2021
@medyagh
Copy link
Member

medyagh commented Apr 26, 2021

I suspect if we turn on the setting that when the progress bar is 100% to hide itself it will fix this issue

@ilya-zuyev
Copy link
Contributor

Screen Shot 2021-04-26 at 2 14 59 PM

another thing is that we continue to show progress bar even when progress is 100% already

@medyagh
Copy link
Member

medyagh commented Apr 27, 2021

seems like we the source of the problem is we create two independent pb

https://github.com/medyagh/minikube/blob/b45c782df392d90613d6e8bcc94e029cd13128bb/pkg/minikube/image/image.go#L271

	p := pb.Full.Start64(0)

and the other one in

https://github.com/medyagh/minikube/blob/b45c782df392d90613d6e8bcc94e029cd13128bb/pkg/minikube/download/progressbar.go#L49

should be using a Pool like the example in this issue cheggaaa/pb#31 (comment)

  pool := &pb.Pool{}
    first := pb.New(1000).Prefix("First ")
    second := pb.New(1000).Prefix("Second ")
    third := pb.New(1000).Prefix("Third ")
    pool.Add(first, second, third)
    pool.Start()
    wg := new(sync.WaitGroup)
    for _, bar := range []*pb.ProgressBar{first, second, third} {
        wg.Add(1)
        go func(cb *pb.ProgressBar) {
            for n := 0; n < 1000; n++ {
                cb.Increment()
                time.Sleep(time.Millisecond * time.Duration(rand.Intn(100)))
            }
            cb.Finish()
            wg.Done()
        }(bar)
    }
    wg.Wait()

what we could do is adding a Global PB Pool in download package and any new PB be added to the pool

@medyagh
Copy link
Member

medyagh commented Apr 27, 2021

CC @andriyDev

@medyagh
Copy link
Member

medyagh commented Apr 27, 2021

Ah seems like V3 does NOT have pooling feature
cheggaaa/pb#166 (comment)

@medyagh medyagh added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed priority/backlog Higher priority than priority/awaiting-more-evidence. labels May 3, 2021
@sharifelgamal sharifelgamal added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Jun 14, 2021
@sharifelgamal
Copy link
Collaborator

We could look into downgrading to v1 to see what happens.

@sharifelgamal
Copy link
Collaborator

cc @alonyb

@yayaha
Copy link
Contributor

yayaha commented Aug 9, 2021

/assign

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 8, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 8, 2021
@sharifelgamal sharifelgamal added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Dec 15, 2021
@maxb
Copy link

maxb commented Apr 23, 2022

This also affects e.g. the kubelet/kubeadm/kubectl progress bars when using --driver=none, and is quite sad for users with lesser internet connections!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
9 participants