Giter VIP home page Giter VIP logo

Comments (9)

brandonkal avatar brandonkal commented on May 18, 2024 1

Yes that is from pulling the image. My internet connection is slow so I get a higher amount of those lines.
With a tty, a simple wget-like progress bar would be better.
Without a tty, one solution is to filter out duplicate lines (that at least reduces it down to 100 lines for each pull).

from earthly.

vladaionescu avatar vladaionescu commented on May 18, 2024 1

It's a good start, however you probably need a separate progress bar for each of the items in ss.Statuses. These are multiple activities taking place in parallel and the relevant progress bars need to be updated in parallel. Feel free to open a PR even if it's WIP.

from earthly.

vladaionescu avatar vladaionescu commented on May 18, 2024

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.)

from earthly.

alexcb avatar alexcb commented on May 18, 2024

#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?

from earthly.

Gituser143 avatar Gituser143 commented on May 18, 2024

Hey @vladaionescu! Can I work on this issue?

from earthly.

vladaionescu avatar vladaionescu commented on May 18, 2024

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.

CC @MadhavJivrajani

from earthly.

Gituser143 avatar Gituser143 commented on May 18, 2024

Thank you @vladaionescu! I'll get to it...

from earthly.

Gituser143 avatar Gituser143 commented on May 18, 2024

@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()

from earthly.

vladaionescu avatar vladaionescu commented on May 18, 2024

This has been implemented and will be in the next release.

from earthly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.