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

loading progress #792

Closed
wants to merge 16 commits into from
Closed

loading progress #792

wants to merge 16 commits into from

Conversation

dek3rr
Copy link

@dek3rr dek3rr commented Aug 26, 2019

Here's a working version of #768
It's not everything I had envisioned, but unfortunately, my ubuntu hard drive died shortly after.
I still think it's useful in it's current state, so I'm putting up the PR sans progress bar for now.

selfdrive/manager.py Outdated Show resolved Hide resolved

params = Params()
process_cnt = len(managed_processes)
loader_proc = subprocess.Popen(["./spinner"], stdin=subprocess.PIPE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you abstract the spinner generation in a helper function?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better, turn it into a class which which can be used using a context manager, a la tqdm:

with Spinner() as spinner:
  do_stuff()
  spinner.update("some text")

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think context manager sounds good. Need to think about tqdm integration.

Copy link
Contributor

@pd0wm pd0wm Aug 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't mean you should use tqdm, just an example of the API you could expose to our spinner.

int err;

const char* spintext = NULL;
if (argc >= 2) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep it backwards compatible? I'd like to initialize the text from the command line.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can. I'm not sure if it's as simple as adding that code back though. It was a little tricky to get stdin working correctly. I'd like to get ubuntu running again before I start fooling around in C.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be nice. That keeps the spinner versatile and easy to call from a shells script.

@pd0wm
Copy link
Contributor

pd0wm commented Aug 26, 2019

Looks a lot cleaner this way! Added a few small comments

@rbiasini
Copy link
Contributor

@dekerr , we'll be happy to merge this. Are you planning on doing the requested change and solve conflicts?

@dek3rr
Copy link
Author

dek3rr commented Sep 12, 2019

Looks like spinner.h is not open source in latest release. At first glance, it also looks like that makes compatibility changes in spinner.c more convoluted for this PR.

@ErichMoraga
Copy link
Contributor

Forget about the spinner. Text detailing what processes are loading, etc. would be sufficient.

@pd0wm
Copy link
Contributor

pd0wm commented Sep 17, 2019

The spinner was refactored a little bit, so we can also use it in the NEOS installer. Unfortunately we forgot to open source the files after they were moved. I just pushed those files to devel (#812).

@pd0wm
Copy link
Contributor

pd0wm commented Sep 18, 2019

I'll finish the PR and merge it internally! I'll probably add a progress bar too.

@pd0wm pd0wm closed this Sep 18, 2019
@pd0wm
Copy link
Contributor

pd0wm commented Sep 18, 2019

Thanks @dekerr for figuring out the stdin stuff!

ezgif-2-35311e685540

@dek3rr
Copy link
Author

dek3rr commented Sep 18, 2019

Awesome. Thanks, Willem. Looks great.

@dek3rr dek3rr deleted the subprocessing branch October 11, 2019 00:22
rav4kumar pushed a commit to rav4kumar/openpilot that referenced this pull request Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants