-
Notifications
You must be signed in to change notification settings - Fork 386
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
Improve logs (introduce a progress-bar for tty devices) #84
Comments
Makes sense, Brandon. We need to improve this. (I believe those specific lines are from the progress of pulling some docker image - this can be made less verbose.) |
Yes that is from pulling the image. My internet connection is slow so I get a higher amount of those lines. |
#143 changes the behaviour to only print out the progress every 5 seconds. I agree that a tty progress bar would be nice to implement one day, so maybe we should leave this issue open? |
Hey @vladaionescu! Can I work on this issue? |
Sounds good @Gituser143. This is where progress is printed BTW: https://github.com/earthly/earthly/blob/master/builder/solver_monitor.go#L178. Keep in mind that there may be multiple progress bars ongoing at a time and that the printing itself is being worked on in parallel: #338. |
Thank you @vladaionescu! I'll get to it... |
@vladaionescu I've implemented a simple progress bar. It's declared here and values are updated like this. Let me know if I can open a PR so that you can see the changes and tell me what changes I'll have to make. My overall implementation looks kind of like this: var on sync.Once
progressBar := pb.New(100)
for _, vs := range ss.Statuses {
.
.
.
progress := int(0)
if vs.Total != 0 {
progress = int(100.0 * float32(vs.Current) / float32(vs.Total))
}
if vs.Completed != nil {
progress = 100
}
if vm.shouldPrintProgress(progress) {
.
.
.
on.Do(func() {
vm.console.Printf("%s\n", vs.ID)
progressBar.Start()
})
progressBar.SetCurrent(int64(progress))
}
}
progressBar.Finish() |
It's a good start, however you probably need a separate progress bar for each of the items in |
This has been implemented and will be in the next release. |
Running the Go example, earth floods the terminal with lines like this:
Though it is a lot more of that than I've included here. I would expect this as a progress bar replacing the line on update rather than drawing a new line.
go build
is silent on success so this is a lot messier.The text was updated successfully, but these errors were encountered: