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

Expose execution details from Executor to user level (eg Context) #443

Open
thedrow opened this Issue May 22, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@thedrow
Contributor

thedrow commented May 22, 2017

[Maintainer edit: this ticket is now about all general "what is the overall execution system up to?" functionality - current task, that task's args, results of CLI parsing, etc]


I'd like to print a progress bar that shows how many tasks have completed and how many remain.
The API currently does not expose these statistics as far as I know.
Is there any way I'm not familiar with to count the number of pending and completed tasks?

@bitprophet

This comment has been minimized.

Show comment
Hide comment
@bitprophet

bitprophet May 22, 2017

Member

Nope, that's not implemented, but the statistics themselves would want to live in the Executor class most likely, and it would probably not be hard to just make it generally available to any code that has a handle on that object.

How to use the resulting data is a bit tougher since I assume you want either A) ability to access it within a task, via the context, or B) a general internal/core behavior where e.g. the Executor is itself displaying this progress bar as it goes.


I'm curious about your real-world use case! Most tasks I'm familiar with tend to have some output as they run (even if it's high level log-esque statements and not command stdout) so a progress bar doesn't work too well there, only if there is no other output.

(That said, I've experimented with a hybrid "one output line per task/subtask, and spinners/progress bars for commands that are known to take a long time" approach in some non-public tasks for my job, using libraries like humanfriendly and tdqm. Making those helper/util functions publicly available would be nice.)

Member

bitprophet commented May 22, 2017

Nope, that's not implemented, but the statistics themselves would want to live in the Executor class most likely, and it would probably not be hard to just make it generally available to any code that has a handle on that object.

How to use the resulting data is a bit tougher since I assume you want either A) ability to access it within a task, via the context, or B) a general internal/core behavior where e.g. the Executor is itself displaying this progress bar as it goes.


I'm curious about your real-world use case! Most tasks I'm familiar with tend to have some output as they run (even if it's high level log-esque statements and not command stdout) so a progress bar doesn't work too well there, only if there is no other output.

(That said, I've experimented with a hybrid "one output line per task/subtask, and spinners/progress bars for commands that are known to take a long time" approach in some non-public tasks for my job, using libraries like humanfriendly and tdqm. Making those helper/util functions publicly available would be nice.)

@bitprophet bitprophet changed the title from Execution progress to Expose execution details from Executor to user level (eg Context) Jun 19, 2018

@bitprophet

This comment has been minimized.

Show comment
Hide comment
@bitprophet

bitprophet Jun 19, 2018

Member

Note to self, this may need a little bit of extension for Fabric as well, re: current host in a host list / current role / etc, though if those are couched in general enough terms (re: parameterization of a task) it may end up working 100% through the Invoke side of things.

Member

bitprophet commented Jun 19, 2018

Note to self, this may need a little bit of extension for Fabric as well, re: current host in a host list / current role / etc, though if those are couched in general enough terms (re: parameterization of a task) it may end up working 100% through the Invoke side of things.

@thedrow

This comment has been minimized.

Show comment
Hide comment
@thedrow

thedrow Jun 21, 2018

Contributor

I kinda missed this issue.
My usecase was to create a progress bar and place it somewhere on the screen using ncurses or something.

Contributor

thedrow commented Jun 21, 2018

I kinda missed this issue.
My usecase was to create a progress bar and place it somewhere on the screen using ncurses or something.

@bitprophet bitprophet added this to the 1.4 milestone Jun 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment