[openstack-dev] [TripleO] Driving workflows with Mistral

Ryan Brown rybrown at redhat.com
Tue Jan 12 15:31:43 UTC 2016

On 01/12/2016 08:24 AM, Dan Prince wrote:
> On Tue, 2016-01-12 at 12:52 +0100, Jiri Tomasek wrote:
>> On 01/11/2016 04:51 PM, Dan Prince wrote:
>>> Background info:
>>> [snip]
>> In similar manner, is Mistral able to provide a way to get workflow
>> in
>> progress data? E.g. We have a Mistral workflow for nodes
>> introspection.
>> This workflow contains several actions calling to ironic and
>> ironic-inspector apis. GUI calls Mistral API to trigger the workflow
>> and
>> now it needs to have a way to track the progress of that workflow.
>> How
>> would this be achieved?
> I've been running 'mistral execution-list' and then you can watch
> (poll) for the relevant execution items to finish running. Sure,
> polling isn't great but I'd say lets start with this perhaps.
>> I think forcing GUI to poll the APIs that are
>> called in the actions and try to implement logic that estimates what
>> state the workflow is to report about it is not a valid solution. We
>> need the workflow API (Mistral) to provide a lets say web sockets
>> connection and push the status of actions along with relevant data,
>> so
>> GUI can listen to those.
> I don't think Mistral has a websockets implementation. I think Zaqar
> does though, and I think perhaps one way we could go about this sort of
> notification might be to integrate our workflows with a Zaqar queue or
> something. GUI would listen to a Zaqar queue for example... and the
> workflow (as it executes) would post things to a specific queue.
> Perhaps this is opt-in, only if a Zaqar queue is provided to a given
> workflow. FWIW, integrating Mistral w/ Zaqar actions would likely be
> quite easy.

Heat currently has a similar system for stack actions. The user provides 
a zaqar queue in the environment file, and every resource action 
generates a notification on that queue. I think a similar system would 
work for Mistral jobs.

For "domain-specific" notifications like receiving a notification for 
certain discovery stages, the TripleO custom actions could also publish 
messages to a queue so users get something more granular than "this 
Mistral job finished."

> Alternately we could look at what it would take to add websocket
> support to Mistral directly.

I really don't think adding websockets to Mistral would be worth it - 
Zaqar is a much better solution for notifications since it already has 
websocket, webhook, and even email (yes, that's right) notification options.

>> I am about to implement your nodes workflow in the GUI to test how it
>> works.
>> Jirka

Ryan Brown / Senior Software Engineer, Openstack / Red Hat, Inc.

More information about the OpenStack-dev mailing list