I propose to add better progress measurement than the current:
Execution is still running on ...
When you have a big state you just wait not knowing what the salt is doing on this moment. Probably it stuck on system upgrade (and you suddenly understood that you don't need it), or the internet connection is so slow, that git repository is downloading for a 20 minutes.
I think it could like like (inspired by zypper
):
Enforcing state pkg.installed apache2 .................................................................................................[done]
Enforcing state file.managed /etc/apache2/ports.conf .....................................................................[/]
For those who don't know what is zypper
: it's a package manager for openSUSE. It works like this:
We can go further by showing a progress for a functions. In my opinion the best way to return the progress is coroutines. I mean, it's very simple to yield the percentage by using yield
keyword. I would yield float, but yielding the dict {'progress': 0.33, 'stage': 'mounting VirtualBox Guest Additions drive'
is also possible.
@thatch45 can you weigh in here? I know we've had ongoing discussions on interactive progress indicators and I know that RAET will facilitate this greatly.
Sending progress reports in was enabled with state_events in 2014.1, the problem is that state events are somewhat heavy and we never built in the capability for the shell to handle them.
Also, the real question, we would need to display progress events on the shell from many minions at once in a coherent way, sure, a package manager like zypper can display because it is a single stream of actions that are happening in serial, but salt is many streams happening in parallel, a terminal is just not equipped for it.
In RAET we can much more easily send progress events, but we will likely need a curses based console to display them
RAET-based progress events are definitely on the radar for an upcoming release. Progress events for ZMQ do exist in 2014.1 as @thatch45 has already pointed out but are known to cause serious performance issues and are not widely used.
Setting label to 'Feature'.
So we could totally do this now BTW, we just need to listen to state events coming back from the minions and display stuff about them, it would be super cool.
Just FYI:
When running state files or highstate salt-run state.event tagmatch='state' pretty=True
should also selectively print state events if you have state_events: True
in the master config.
Useful information is also provided by tagmatch='prog'
(when state events are switched on).
This would be a Killer Feature. Progess Update helps for Customer wainting in Front of the Monitor. This is really missig compared to Ansible.
This is already implemented. Use the progress
outputter.
progress outputter doesn't solve the problem. You don't now which states failed or whitch target.
salt "*" state.single pkg.installed name=bison --progress
83% |###################################################################################################################################################################################### | Elapsed Time: 0:00:00 Returns: [5/6]
-------------------------------------------
Summary
-------------------------------------------
# of minions targeted: 6
# of minions returned: 5
# of minions that did not return: 1
# of minions with errors: 0
-------------------------------------------
I agree, progress outputter doesn't solve the original issue
Most helpful comment
progress outputter doesn't solve the problem. You don't now which states failed or whitch target.