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

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

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

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

thedrow opened this issue May 22, 2017 · 3 comments
Milestone

Comments

@thedrow
Copy link
Contributor

@thedrow 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
Copy link
Member

@bitprophet 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 Execution progress Expose execution details from Executor to user level (eg Context) Jun 19, 2018
@bitprophet
Copy link
Member

@bitprophet 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
Copy link
Contributor Author

@thedrow 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.