Re: [openstack-dev] [Mistral] Mistral test infrastructure proposal

2014-06-26 Thread Renat Akhmerov
Anastasia,

Thanks a lot for this etherpad. I’ve read it and left my comments. Overall I 
agree with the suggested plan.

Additionally, I would suggest we picture the overall package structure with a 
sub-project breakdown. E.g.:

mistral:
functionaltests/
  openstack/
  standalone/

python-mistralclient:
...

etc.

Renat Akhmerov
@ Mirantis Inc.



On 24 Jun 2014, at 14:39, Anastasia Kuznetsova akuznets...@mirantis.com wrote:

 (reposting due to lack of subject)
 
 Hello, everyone!
 
 I am happy to announce that Mistral team started working on test 
 infrastructure. Due to this fact I prepared etherpad 
 https://etherpad.openstack.org/p/MistralTests where I analysed what we have 
 and what we need to do. 
 
 I would like to get your feedback to start creating appropriate blueprints 
 and implement them.
 
 Regards,
 Anastasia Kuznetsova
 QA Engineer at Mirantis
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Small questions re executor

2014-06-26 Thread Renat Akhmerov

On 25 Jun 2014, at 07:27, Dmitri Zimine dzim...@stackstorm.com wrote:

 * We must convey the action ERROR details back to the engine, and to the end 
 user. Log is not sufficient. How exactly? Via context? Via extra parameters 
 to convey_execution_results? Need a field in the model.
 https://github.com/stackforge/mistral/blob/master/mistral/engine/drivers/default/executor.py#L46-L59

This is a subject for upcoming refactoring. IMO task error should generally be 
a special case of result. Most likely, we’ll need to have a class Result 
encapsulating all needed information rather than just always thinking of result 
as of JSON.

 * What is the reason to update status on task failure in handle_task_error 
 via direct DB access, not via convey_task_results? 
 https://github.com/stackforge/mistral/blob/master/mistral/engine/drivers/default/executor.py#L61
  Bypassing convey_task_results can cause grief from missing TRACE statements 
 to more serious stuff… And looks like we are failing the whole execution 
 there? Just because one action had failed? Please clarify the intend here. 
 Note: details may all go away while doing Refine Engine - Executor protocol 
 blueprint 
 https://blueprints.launchpad.net/mistral/+spec/mistral-engine-executor-protocol,
  we just need to clarify the intent

That was an initial design (that didn’t take lots of things into account). I 
agree this is all bad. Particularly, we can’t fail the whole execution at once.

Renat Akhmerov
@ Mirantis Inc.


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Mistral test infrastructure proposal

2014-06-24 Thread Anastasia Kuznetsova
(reposting due to lack of subject)

Hello, everyone!

I am happy to announce that Mistral team started working on test
infrastructure. Due to this fact I prepared etherpad
https://etherpad.openstack.org/p/MistralTests where I analysed what we have
and what we need to do.

I would like to get your feedback to start creating appropriate blueprints
and implement them.

Regards,
Anastasia Kuznetsova
QA Engineer at Mirantis
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Mistral 0.0.4 released

2014-06-24 Thread Renat Akhmerov
Hi,

Mistral version 0.0.4* has just been released! This is an intermediate release 
however it contains a series of important changes/fixes.

Here’s the list of the most noticeable changes:
Speeded up tests using Testr
Modified launch script to start any combination of Mistral components (engine, 
api, executor)
OpenStack related data is always accessible in actions (currently auth_token, 
project_id) without having to pass it from tasks
Modified standard http action to support all http protocol parameters (e.g. 
timeout)
Implemented pluggable task actions
Cleaned up configuration settings
Refactored engine to use plugins
Improved integration tests
A series of improvements in Mistral Dashboard
15 bugs fixed (http error codes, pypi upload for client, bugs with data flow 
context)

Links:
https://launchpad.net/mistral/juno/0.0.4 - Release page at Launchpad (release 
notes, includes download files, list of implemented blueprints and fixed bugs)
https://wiki.openstack.org/wiki/Mistral/Releases/0.0.4 - Release page at wiki 
(link to a screencast, links to examples, release notes)

Thanks to all the contributors!

*(Please note that version 0.0.3 was corrupted during the release process and 
had to be abandoned.)

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Small questions re executor

2014-06-24 Thread Dmitri Zimine
Got some questions while fixing a bug https://review.openstack.org/#/c/102391/: 

* We must convey the action ERROR details back to the engine, and to the end 
user. Log is not sufficient. How exactly? Via context? Via extra parameters to 
convey_execution_results? Need a field in the model.
https://github.com/stackforge/mistral/blob/master/mistral/engine/drivers/default/executor.py#L46-L59


* What is the reason to update status on task failure in handle_task_error via 
direct DB access, not via convey_task_results? 
https://github.com/stackforge/mistral/blob/master/mistral/engine/drivers/default/executor.py#L61
 Bypassing convey_task_results can cause grief from missing TRACE statements to 
more serious stuff… And looks like we are failing the whole execution there? 
Just because one action had failed? Please clarify the intend here. Note: 
details may all go away while doing Refine Engine - Executor protocol 
blueprint 
https://blueprints.launchpad.net/mistral/+spec/mistral-engine-executor-protocol,
 we just need to clarify the intent

DZ ___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Cancelling today's community meeting - 06/23/2014

2014-06-23 Thread Renat Akhmerov
Folks,

We’re cancelling today’s community meeting for a number of reasons 
(intermediate release activities, not all important members will be available).

Let’s meet next Monday on 06/30/2014.

Renat Akhmerov
@ Mirantis Inc.




___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] Cancelling today's community meeting - 06/23/2014

2014-06-23 Thread Renat Akhmerov
In case you have urgent questions please ping me personally.

Renat Akhmerov
@ Mirantis Inc.



On 23 Jun 2014, at 18:17, Renat Akhmerov rakhme...@mirantis.com wrote:

 Folks,
 
 We’re cancelling today’s community meeting for a number of reasons 
 (intermediate release activities, not all important members will be 
 available).
 
 Let’s meet next Monday on 06/30/2014.
 
 Renat Akhmerov
 @ Mirantis Inc.
 
 
 


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral]

2014-06-23 Thread Anastasia Kuznetsova
Hello, everyone!

I am happy to announce that Mistral team started working on test
infrastructure. Due to this fact I prepared etherpad
https://etherpad.openstack.org/p/MistralTests where I analysed what we have
and what we need to do.

I would like to get your feedback to start creating appropriate blueprints
and implement them.

Regards,
Anastasia Kuznetsova
QA Engineer at Mirantis
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Start task, and support for 'requires' / reverse workflow.

2014-06-20 Thread Renat Akhmerov
Just a clarification: “reverse” flow is what I usually call “dependency based 
flow” when we specify dependencies between tasks rather then direct transitions 
(do this then on success do that).

 * Put it off till the engine refactoring, factor the requirement of 
 supporting two modes into the refactoring. It will be easy to do, but takes 
 the longest. 


I personally would prefer this latest option since I don’t see any rush with 
refactoring the current API/impl to have two separate workflow types right now.

Renat Akhmerov
@ Mirantis Inc.



On 20 Jun 2014, at 12:33, Dmitri Zimine dzim...@stackstorm.com wrote:

 https://review.openstack.org/#/c/100390/
 
 Angus asked: 
 Why do we even need start: start-task?
 Can't we parse the workbook and figure out what to run? Tasks at the bottom 
 of the tree have no on-{fail,success} and then 
 follow upwards until you find a task that is not referenced by anything.
 
 Yes we can do this (patch almost ready). And It makes a perfect behavior for 
 a direct flow [1]: all the top-level tasks begin to execute in parallel, and 
 dependent tasks scheduled as dependencies resolve. No need to specify . 
 Parallel execution is a default, unless explicitly constrained by 
 on-success/on-error/on-finish. 
 
 But for Reversed flow [2] it’s a BIG change of behavior. Instead of running 
 only a subflow to satisfy a target task, it will run all the tasks 
 (respecting dependencies). This is not practical. 
 
 Eventually we want to support both direct and reverse as two types of 
 workflow, without mixing the two syntaxes within the same workflow. This will 
 require big refactoring (already planned). On the Atlanta summit we agreed to 
 temporarily drop reversed workflow and re-introduce it later. [3] The start 
 task in the API is a big pain for a direct flow. 
 
 How should we proceed? Options I can think of: 
 
 * Drop ‘reverse flow’ right now, stabilize ‘direct flow', reintroduce 
 ‘reverse flow’ later (next cycle).
 This will give us a clean final API on a good set of functionality, [almost] 
 immediately. 
 
 * Introduce two workflow types and correspondent API changes/additions on the 
 current code base, before refactoring. 
 
 * Put it off till the engine refactoring, factor the requirement of 
 supporting two modes into the refactoring. It will be easy to do, but takes 
 the longest. 
 
 Other options? Opinions? Requests?
 
 DZ  
 
 
 [1] Direct flow has dependencies expressed by on-success/on-error/on-finish 
 keyword on an upstream task
 [2] Reverse flow is where dependencies are expressed by requires keyword on a 
 downstream, dependent task
 [3] https://etherpad.openstack.org/p/mistral-post-POC-questions
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Start task, and support for 'requires' / reverse workflow.

2014-06-19 Thread Dmitri Zimine
https://review.openstack.org/#/c/100390/

Angus asked: 
Why do we even need start: start-task?
Can't we parse the workbook and figure out what to run? Tasks at the bottom of 
the tree have no on-{fail,success} and then 
follow upwards until you find a task that is not referenced by anything.

Yes we can do this (patch almost ready). And It makes a perfect behavior for a 
direct flow [1]: all the top-level tasks begin to execute in parallel, and 
dependent tasks scheduled as dependencies resolve. No need to specify . 
Parallel execution is a default, unless explicitly constrained by 
on-success/on-error/on-finish. 

But for Reversed flow [2] it’s a BIG change of behavior. Instead of running 
only a subflow to satisfy a target task, it will run all the tasks (respecting 
dependencies). This is not practical. 

Eventually we want to support both direct and reverse as two types of workflow, 
without mixing the two syntaxes within the same workflow. This will require big 
refactoring (already planned). On the Atlanta summit we agreed to temporarily 
drop reversed workflow and re-introduce it later. [3] The start task in the API 
is a big pain for a direct flow. 

How should we proceed? Options I can think of: 

* Drop ‘reverse flow’ right now, stabilize ‘direct flow', reintroduce ‘reverse 
flow’ later (next cycle).
This will give us a clean final API on a good set of functionality, [almost] 
immediately. 

* Introduce two workflow types and correspondent API changes/additions on the 
current code base, before refactoring. 

* Put it off till the engine refactoring, factor the requirement of supporting 
two modes into the refactoring. It will be easy to do, but takes the longest. 

Other options? Opinions? Requests?

DZ  


[1] Direct flow has dependencies expressed by on-success/on-error/on-finish 
keyword on an upstream task
[2] Reverse flow is where dependencies are expressed by requires keyword on a 
downstream, dependent task
[3] https://etherpad.openstack.org/p/mistral-post-POC-questions

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Refine engine - executor protocol

2014-06-18 Thread Renat Akhmerov
On 13 Jun 2014, at 07:03, W Chan m4d.co...@gmail.com wrote:

 Design proposal for blueprint 
 https://blueprints.launchpad.net/mistral/+spec/mistral-engine-executor-protocol
 Rename Executor to Worker.
I’d be ok with Worker but would prefer ActionRunner since it reflects the 
purpose a little better although being more verbose.
 Continue to use RPC server-client model in oslo.messaging for Engine and 
 Worker protocol.
Sure.
 Use asynchronous call (cast) between Worker and Engine where appropriate.
I would even emphasize: only async calls make sense.
 Remove any DB access from Worker.  DB IO will only be done by Engine.
I still have doubts it’s actually possible. This is a part of the issue I 
mentioned in the previous email. I’ll post more detailed email on that 
separately.
 Worker updates Engine that it's going to start running action now.  If 
 execution is not RUNNING and task is not IDLE, Engine tells Worker to halt at 
 this point.  Worker cannot assume execution state is RUNNING and task state 
 is IDLE because the handle_task message could have been sitting in the 
 message queue for awhile.  This call between Worker and Engine is 
 synchronous, meaning Worker will wait for a response from the Engine.  
 Currently, Executor checks state and updates task state directly to the DB 
 before running the action.
Yes, that’s how it works now. First of all, like I said before we can’t afford 
making any sync calls between engine and executor because it’ll lead to 
problems with scalability and fault tolerance. So for that reason we make DB 
calls directly to make sure that execution and the task itself are in the 
suitable state. This would only work reliably for READ_COMMITTED transactions 
used in both engine and executor which I believe currently isn’t true since we 
use sqlite (it doesn’t seem to support them, right?). With mysql it should be 
fine.

So the whole initial idea was to use DB whenever we need to make sure that 
something is in a right state. That’s why all the reads should see only 
committed data. And we use queue just to notify executors about new tasks. 
Basically we could have even not used a queue and instead used db poll but with 
queue it looked more elegant.

It’s all part of one problem. Let’s try to figure out options to simplify the 
protocol and make it more reliable.
 Worker communicates result (success or failure) to Engine.  Currently, 
 Executor is inconsistent and calls Engine.convey_task_result on success and 
 write directly to DB on failure.
Yes, that probably needs to be fixed.

 Sequence
 Engine - Worker.handle_task
 Worker converts action spec to Action instance
Yes, it uses action spec in case if it’s ad-hoc action. If not, it just gets 
action class from the factory and instantiate it.
 Worker - Engine.confirm_task_execution. Engine returns an exception if 
 execution state is not RUNNING or task state is not IDLE.
Maybe I don’t entirely follow your thought but I think it’s not going to work. 
After engine confirms everything’s OK we’ll have a concurrency window again 
after that we’ll have to confirm the states again. That’s why I was talking 
about READ_COMMITTED DB transactions: we need to eliminate concurrency windows.
 Worker runs action
 Worker - Engine.convey_task_result
That looks fine (it’s as it is now). Maybe the only thing we need to pay 
attention to is to how we communicate errors back to engine. It seems logical 
that “convey_task_result()” can also be used to pass information about errors 
that that error is considered a special case of a regular result. Need to think 
it over though...


Renat Akhmerov
@ Mirantis Inc.

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Integration tests discussion

2014-06-18 Thread Renat Akhmerov
Thanks Timur, that’s a good doc.

Anastasia and Sergey were supposed to start working on a proposal devoted to 
our approaches to integration testing. I hope we’ll see them soon.

Renat Akhmerov
@ Mirantis Inc.



On 11 Jun 2014, at 13:55, Timur Nurlygayanov tnurlygaya...@mirantis.com wrote:

 Hi team,
 
 Tomorrow we discussed integration tests for Mistral and looks like we have 
 many ideas how we can improve them and what we also want to test.
 
 The ideas were described in this etherpad:
 https://etherpad.openstack.org/p/MistralNewTestsDesign
 
 Please, fill free to add your ideas about our integration tests (which will 
 be submitted to tempest when Mistral will be 'incubated' project).
 We will discuss this etherpad on the next weekly Mistral meeting in 
 #openstack-meeting IRC chanel (next Monday).
 
 
 Thank you!
 
 -- 
 
 Timur,
 QA Engineer
 OpenStack Projects
 Mirantis Inc
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Cleaning up configuration settings

2014-06-17 Thread W Chan
I figured.  I implemented it in https://review.openstack.org/#/c/97684/.


On Mon, Jun 16, 2014 at 9:35 PM, Renat Akhmerov rakhme...@mirantis.com
wrote:

 I don’t think we have them. You can write them I think as a part of what
 you’re doing.

 Renat Akhmerov
 @ Mirantis Inc.



 On 31 May 2014, at 04:26, W Chan m4d.co...@gmail.com wrote:

 Is there an existing unit test for testing enabling keystone middleware in
 pecan (setting cfg.CONF.pecan.auth_enable = True)?  I don't seem to find
 one.  If there's one, it's not obvious.  Can someone kindly point me to it?


 On Wed, May 28, 2014 at 9:53 AM, W Chan m4d.co...@gmail.com wrote:

 Thanks for following up.  I will publish this change as a separate patch
 from my current config cleanup.


 On Wed, May 28, 2014 at 2:38 AM, Renat Akhmerov rakhme...@mirantis.com
 wrote:


 On 28 May 2014, at 13:51, Angus Salkeld angus.salk...@rackspace.com
 wrote:

  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  On 17/05/14 02:48, W Chan wrote:
  Regarding config opts for keystone, the keystoneclient middleware
 already
  registers the opts at
 
 https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/middleware/auth_token.py#L325
  under a keystone_authtoken group in the config file.  Currently,
 Mistral
  registers the opts again at
 
 https://github.com/stackforge/mistral/blob/master/mistral/config.py#L108
 under a
  different configuration group.  Should we remove the duplicate from
 Mistral and
  refactor the reference to keystone configurations to the
 keystone_authtoken
  group?  This seems more consistent.
 
  I think that is the only thing that makes sense. Seems like a bug
  waiting to happen having the same options registered twice.
 
  If some user used to other projects comes and configures
  keystone_authtoken then will their config take effect?
  (how much confusion will that generate)..
 
  I'd suggest just using the one that is registered keystoneclient.

 Ok, I had a feeling it was needed for some reason. But after having
 another look at this I think this is really a bug. Let’s do it.

 Thanks guys
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Cleaning up configuration settings

2014-06-17 Thread Renat Akhmerov
Ooh, alright :) It passed by me why I was off.

Renat Akhmerov
@ Mirantis Inc.



On 18 Jun 2014, at 01:20, W Chan m4d.co...@gmail.com wrote:

 I figured.  I implemented it in https://review.openstack.org/#/c/97684/.
 
 
 On Mon, Jun 16, 2014 at 9:35 PM, Renat Akhmerov rakhme...@mirantis.com 
 wrote:
 I don’t think we have them. You can write them I think as a part of what 
 you’re doing.
 
 Renat Akhmerov
 @ Mirantis Inc.
 
 
 
 On 31 May 2014, at 04:26, W Chan m4d.co...@gmail.com wrote:
 
 Is there an existing unit test for testing enabling keystone middleware in 
 pecan (setting cfg.CONF.pecan.auth_enable = True)?  I don't seem to find 
 one.  If there's one, it's not obvious.  Can someone kindly point me to it?
 
 
 On Wed, May 28, 2014 at 9:53 AM, W Chan m4d.co...@gmail.com wrote:
 Thanks for following up.  I will publish this change as a separate patch 
 from my current config cleanup.
 
 
 On Wed, May 28, 2014 at 2:38 AM, Renat Akhmerov rakhme...@mirantis.com 
 wrote:
 
 On 28 May 2014, at 13:51, Angus Salkeld angus.salk...@rackspace.com wrote:
 
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  On 17/05/14 02:48, W Chan wrote:
  Regarding config opts for keystone, the keystoneclient middleware already
  registers the opts at
  https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/middleware/auth_token.py#L325
  under a keystone_authtoken group in the config file.  Currently, Mistral
  registers the opts again at
  https://github.com/stackforge/mistral/blob/master/mistral/config.py#L108 
  under a
  different configuration group.  Should we remove the duplicate from 
  Mistral and
  refactor the reference to keystone configurations to the 
  keystone_authtoken
  group?  This seems more consistent.
 
  I think that is the only thing that makes sense. Seems like a bug
  waiting to happen having the same options registered twice.
 
  If some user used to other projects comes and configures
  keystone_authtoken then will their config take effect?
  (how much confusion will that generate)..
 
  I'd suggest just using the one that is registered keystoneclient.
 
 Ok, I had a feeling it was needed for some reason. But after having another 
 look at this I think this is really a bug. Let’s do it.
 
 Thanks guys
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
 
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
 
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
 
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Refine engine - executor protocol

2014-06-17 Thread Renat Akhmerov
Hi Winson,

Sorry, I haven’t responded so far for I was on vacation. So getting back to you 
now..

It’s my fault that the notes in the BP are not fairly clear.

1. By “worker parallelism” we meant that one worker (which is called “executor 
now) can poll and handle more than one task from the task queue (it’s not 
abstracted out from the notion of queue but anyway). It would be a nice feature 
because it would allow to tune the system performance much more accurately.

2. What “engine-executor parallelism” means I honestly don’t remember :) I 
guess this is a note made by Dmitri so he may be better aware. Dmitri? As far 
as engine-executor interaction we now have an issue with it that we need to 
fix but it’s not related with parallelism. The protocol itself is not 100% 
complete in terms of reliability.

Thanks

Renat Akhmerov
@ Mirantis Inc.


On 06 Jun 2014, at 23:12, W Chan m4d.co...@gmail.com wrote:

 Regarding blueprint 
 https://blueprints.launchpad.net/mistral/+spec/mistral-engine-executor-protocol,
  can you clarify what it means by worker parallelism and engine-executor 
 parallelism?  Currently, the engine and executor are launched with the 
 eventlet driver in oslo.messaging.  Once a message arrives over transport, a 
 new green thread is spawned and passed to the dispatcher.  In the case of 
 executor, the function being dispatched to is handle_task.  I'm unclear what 
 additional parallelism this blueprint is referring to.  The context isn't 
 clear from the summit notes.
 

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Weekly community meeting - 06/16/2014

2014-06-16 Thread Renat Akhmerov
Hi,

This is a reminder about another community IRC meeting at #openstack-meeting 
today at 16.00 UTC.

The agenda is usual:
Review action items
Current status (quickly by team members)
Further plans
Open discussion

Looking forward to see you there.

[0] https://wiki.openstack.org/wiki/Meetings/MistralAgenda

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Cleaning up configuration settings

2014-06-16 Thread Renat Akhmerov
I don’t think we have them. You can write them I think as a part of what you’re 
doing.

Renat Akhmerov
@ Mirantis Inc.



On 31 May 2014, at 04:26, W Chan m4d.co...@gmail.com wrote:

 Is there an existing unit test for testing enabling keystone middleware in 
 pecan (setting cfg.CONF.pecan.auth_enable = True)?  I don't seem to find one. 
  If there's one, it's not obvious.  Can someone kindly point me to it?
 
 
 On Wed, May 28, 2014 at 9:53 AM, W Chan m4d.co...@gmail.com wrote:
 Thanks for following up.  I will publish this change as a separate patch from 
 my current config cleanup.
 
 
 On Wed, May 28, 2014 at 2:38 AM, Renat Akhmerov rakhme...@mirantis.com 
 wrote:
 
 On 28 May 2014, at 13:51, Angus Salkeld angus.salk...@rackspace.com wrote:
 
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  On 17/05/14 02:48, W Chan wrote:
  Regarding config opts for keystone, the keystoneclient middleware already
  registers the opts at
  https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/middleware/auth_token.py#L325
  under a keystone_authtoken group in the config file.  Currently, Mistral
  registers the opts again at
  https://github.com/stackforge/mistral/blob/master/mistral/config.py#L108 
  under a
  different configuration group.  Should we remove the duplicate from 
  Mistral and
  refactor the reference to keystone configurations to the keystone_authtoken
  group?  This seems more consistent.
 
  I think that is the only thing that makes sense. Seems like a bug
  waiting to happen having the same options registered twice.
 
  If some user used to other projects comes and configures
  keystone_authtoken then will their config take effect?
  (how much confusion will that generate)..
 
  I'd suggest just using the one that is registered keystoneclient.
 
 Ok, I had a feeling it was needed for some reason. But after having another 
 look at this I think this is really a bug. Let’s do it.
 
 Thanks guys
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
 
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Refine engine - executor protocol

2014-06-12 Thread W Chan
Design proposal for blueprint
https://blueprints.launchpad.net/mistral/+spec/mistral-engine-executor-protocol


   - Rename Executor to Worker.
   - Continue to use RPC server-client model in oslo.messaging for Engine
   and Worker protocol.
   - Use asynchronous call (cast) between Worker and Engine where
   appropriate.
   - Remove any DB access from Worker.  DB IO will only be done by Engine.
   - Worker updates Engine that it's going to start running action now.  If
   execution is not RUNNING and task is not IDLE, Engine tells Worker to halt
   at this point.  Worker cannot assume execution state is RUNNING and task
   state is IDLE because the handle_task message could have been sitting in
   the message queue for awhile.  This call between Worker and Engine is
   synchronous, meaning Worker will wait for a response from the
Engine.  Currently,
   Executor checks state and updates task state directly to the DB before
   running the action.
   - Worker communicates result (success or failure) to Engine.  Currently,
   Executor is inconsistent and calls Engine.convey_task_result on success and
   write directly to DB on failure.

Sequence


   1. Engine - Worker.handle_task
   2. Worker converts action spec to Action instance
   3. Worker - Engine.confirm_task_execution. Engine returns an exception
   if execution state is not RUNNING or task state is not IDLE.
   4. Worker runs action
   5. Worker - Engine.convey_task_result

Please provide feedback.

Thanks.
Winson




On Fri, Jun 6, 2014 at 9:12 AM, W Chan m4d.co...@gmail.com wrote:

 Renat,

 Regarding blueprint
 https://blueprints.launchpad.net/mistral/+spec/mistral-engine-executor-protocol,
 can you clarify what it means by worker parallelism and engine-executor 
 parallelism?
  Currently, the engine and executor are launched with the eventlet driver
 in oslo.messaging.  Once a message arrives over transport, a new green
 thread is spawned and passed to the dispatcher.  In the case of executor,
 the function being dispatched to is handle_task.  I'm unclear what
 additional parallelism this blueprint is referring to.  The context isn't
 clear from the summit notes.

 Thanks.
 Winson

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Integration tests discussion

2014-06-11 Thread Timur Nurlygayanov
Hi team,

Tomorrow we discussed integration tests for Mistral and looks like we have
many ideas how we can improve them and what we also want to test.

The ideas were described in this etherpad:
https://etherpad.openstack.org/p/MistralNewTestsDesign

Please, fill free to add your ideas about our integration tests (which will
be submitted to tempest when Mistral will be 'incubated' project).
We will discuss this etherpad on the next weekly Mistral meeting in
#openstack-meeting IRC chanel (next Monday).


Thank you!

-- 

Timur,
QA Engineer
OpenStack Projects
Mirantis Inc
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Multi-tenancy and ceilometer triggers

2014-06-10 Thread Angus Salkeld
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi

I was looking at 
https://blueprints.launchpad.net/mistral/+spec/mistral-ceilometer-integration
and trying to figure out how to implement that.

I can see some problems:
- - at the moment the trust is created when you PUT the workbook definition
  this means that if a totally different user executes the workbook, it will be 
run as the user that
created the workbook :-O
 
https://github.com/stackforge/mistral/blob/master/mistral/services/workbooks.py#L27
 
https://github.com/stackforge/mistral/blob/master/mistral/engine/data_flow.py#L92
- - Workbooks can't be sharable if the trust is created at workbook create time.
- - If the trust is not created at workbook create time, how do you use 
triggers?

It seems to me that it is a mistake putting the triggers in the workbook
because there are three entities here:
1) the shareable workbook with tasks (a template really that could be stored in 
glance)
2) the execution entity (keeps track of the running tasks)
3) the person / trigger that initiates the execution
   - execution context
   - authenticated token

if we put 3) into 1) we are going to have authentication issues and
potentially give up the idea of sharing workbooks.

I'd suggest we have a new entity (and endpoint) for triggers.
- - This would associate 3 things: trust_id, workbook and trigger rule
- - This could also be then used to generate a URL for ceilometer or solum to 
call
  in an autonomous way.
- - One issue is if your workflow takes a *really* long time and you don't use 
the
  trigger then you won't have a trust, but a normal user token. But maybe if
  the manually initiates the execution, we can create a manual trigger in the
  background?

I can also help out with: 
https://blueprints.launchpad.net/mistral/+spec/mistral-multitenancy
I believe all that needs to be done is to filter the db items by project_id 
that is
in the user context.

Any thoughts on the above (or better ways of moving forward)?

- -Angus

-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTlp7HAAoJEFrDYBLxZjWoqtAH/3Un3miZmcPjXCO/klU7jsXw
nEYQhWBI+IJuZ5W9MgSHkLg2PwfL6nFxhzyFjG5GloH7QQjO+jGIeE+sBSwPPF/K
kTkllROUhzOO+VFMTIA3y+c173oklmmUtznbuUvDLgLtxNEgtxOWyvZMF3vHO5sS
VkzfSXhg+VbZdg7lVqkaPOtRY/tJ7uVvtskeGZJRIVbE1iINGtqW0aC0WMXXLb7c
7ek8H9lYuxiQ10++7lU+0g6Yn6Momtcmh5j+dTZvJsZw/XEPCc+aDYsE+Yz9tqwb
blh2tWAqNri+xWtumyIAnfv2teJtiDUkzRqRTwxycBOdrkhQ6Nq0RpTCg15jNsA=
=TXJE
-END PGP SIGNATURE-

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Mistral weekly meeting - meeting minutes

2014-06-09 Thread Timur Nurlygayanov
Hi team,

Thank you all for participating in Mistral weekly meeting today,

meeting minutes are available by the following links:
Minutes:
http://eavesdrop.openstack.org/meetings/mistral_weekly_meeting/2014/mistral_weekly_meeting.2014-06-09-15.59.html
Minutes (text):
http://eavesdrop.openstack.org/meetings/mistral_weekly_meeting/2014/mistral_weekly_meeting.2014-06-09-15.59.txt
Log:
http://eavesdrop.openstack.org/meetings/mistral_weekly_meeting/2014/mistral_weekly_meeting.2014-06-09-15.59.log.html


-- 

Timur,
QA Engineer
OpenStack Projects
Mirantis Inc
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Refine engine - executor protocol

2014-06-06 Thread W Chan
Renat,

Regarding blueprint
https://blueprints.launchpad.net/mistral/+spec/mistral-engine-executor-protocol,
can you clarify what it means by worker parallelism and
engine-executor parallelism?
 Currently, the engine and executor are launched with the eventlet driver
in oslo.messaging.  Once a message arrives over transport, a new green
thread is spawned and passed to the dispatcher.  In the case of executor,
the function being dispatched to is handle_task.  I'm unclear what
additional parallelism this blueprint is referring to.  The context isn't
clear from the summit notes.

Thanks.
Winson
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Community meeting reminder - 06/02/2014

2014-06-02 Thread Dmitri Zimine
Hi,

This is a reminder about the community meeting in IRC June 02 at 16.00 UTC at 
#openstack-meeting.

Agenda:
Review action items
Current status (quickly by team members)
Further plans
Open discussion

You can also find it at https://wiki.openstack.org/wiki/Meetings/MistralAgenda 
as well as links to the previous meeting minutes and logs.

- Dmitri Zimine___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Meeting minutes

2014-06-02 Thread Timur Nurlygayanov
Hi all,

Thanks to all participants for visiting the Mistral meeting in
#openstack-meeting today!

The meeting minutes can be found by the following links:

Minutes:
http://eavesdrop.openstack.org/meetings/mistral_meeting/2014/mistral_meeting.2014-06-02-16.00.html
Minutes (text):
http://eavesdrop.openstack.org/meetings/mistral_meeting/2014/mistral_meeting.2014-06-02-16.00.txt
Log:
http://eavesdrop.openstack.org/meetings/mistral_meeting/2014/mistral_meeting.2014-06-02-16.00.log.html


*Renat,* we discussed some questions on this meeting, let's review open
ideas after your holiday.


-- 

Timur,
QA Engineer
OpenStack Projects
Mirantis Inc
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Cleaning up configuration settings

2014-05-30 Thread W Chan
Is there an existing unit test for testing enabling keystone middleware in
pecan (setting cfg.CONF.pecan.auth_enable = True)?  I don't seem to find
one.  If there's one, it's not obvious.  Can someone kindly point me to it?


On Wed, May 28, 2014 at 9:53 AM, W Chan m4d.co...@gmail.com wrote:

 Thanks for following up.  I will publish this change as a separate patch
 from my current config cleanup.


 On Wed, May 28, 2014 at 2:38 AM, Renat Akhmerov rakhme...@mirantis.com
 wrote:


 On 28 May 2014, at 13:51, Angus Salkeld angus.salk...@rackspace.com
 wrote:

  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  On 17/05/14 02:48, W Chan wrote:
  Regarding config opts for keystone, the keystoneclient middleware
 already
  registers the opts at
 
 https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/middleware/auth_token.py#L325
  under a keystone_authtoken group in the config file.  Currently,
 Mistral
  registers the opts again at
 
 https://github.com/stackforge/mistral/blob/master/mistral/config.py#L108
 under a
  different configuration group.  Should we remove the duplicate from
 Mistral and
  refactor the reference to keystone configurations to the
 keystone_authtoken
  group?  This seems more consistent.
 
  I think that is the only thing that makes sense. Seems like a bug
  waiting to happen having the same options registered twice.
 
  If some user used to other projects comes and configures
  keystone_authtoken then will their config take effect?
  (how much confusion will that generate)..
 
  I'd suggest just using the one that is registered keystoneclient.

 Ok, I had a feeling it was needed for some reason. But after having
 another look at this I think this is really a bug. Let’s do it.

 Thanks guys
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Mistral Juno Roadmap

2014-05-29 Thread Renat Akhmerov
Hi,

We’ve prepared the first version of roadmap for Juno release cycle and you can 
find it:
https://etherpad.openstack.org/p/mistral-juno-roadmap (here you can leave your 
suggestions and comments)
https://wiki.openstack.org/wiki/Mistral/Roadmap (wiki)

You can also find more detailed list of blueprints currently accepted for Juno:
https://blueprints.launchpad.net/mistral/juno

Thanks!

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Cleaning up configuration settings

2014-05-28 Thread Angus Salkeld
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 17/05/14 02:48, W Chan wrote:
 Regarding config opts for keystone, the keystoneclient middleware already 
 registers the opts at 
 https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/middleware/auth_token.py#L325
  
 under a keystone_authtoken group in the config file.  Currently, Mistral 
 registers the opts again at 
 https://github.com/stackforge/mistral/blob/master/mistral/config.py#L108 
 under a 
 different configuration group.  Should we remove the duplicate from Mistral 
 and 
 refactor the reference to keystone configurations to the keystone_authtoken 
 group?  This seems more consistent.

I think that is the only thing that makes sense. Seems like a bug
waiting to happen having the same options registered twice.

If some user used to other projects comes and configures
keystone_authtoken then will their config take effect?
(how much confusion will that generate)..

I'd suggest just using the one that is registered keystoneclient.

- -Angus

 
 
 On Thu, May 15, 2014 at 1:13 PM, W Chan m4d.co...@gmail.com 
 mailto:m4d.co...@gmail.com wrote:
 
 Currently, the various configurations are registered in 
 ./mistral/config.py.
   The configurations are registered when mistral.config is referenced.
   Given the way the code is written, PEP8 throws referenced but not used
 error if mistral.config is referenced but not called in the module.  In
 various use cases, this is avoided by using importutils to import
 mistral.config (i.e.
 
 https://github.com/stackforge/mistral/blob/master/mistral/tests/unit/engine/test_transport.py#L34).
   I want to break down registration code in ./mistral/config.py into
 separate functions for api, engine, db, etc and move the registration 
 closer
 to the module where the configuration is needed.  Any objections?
 
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJThYdUAAoJEFrDYBLxZjWoxQgH/3K9Kqe9oKyMBl2lTbGbQTGp
j3hJu5EKkG+2nUxW6m7yE5uZmNyauG2IrtU5xW5eOM+TvovyB23fRbyB7YCl57Y3
if1lXpn1pmv/+ELcPqHxpRyHTvj4eevU3zVb7tNhIHCrBq1jpGXoIzOg/9uWCrx8
SxgJzwD7lV+KAc4s3JAXTuRfmVXx4SJ0abSHXspqPhAD7Cio9McjK1xDex3j/SXc
Z1JnYSrVTcs0/ynSc1z+CWB3N6F1fTX8Vltv7pjsKcTSPSuBLGNPRqftXgBSLeJ5
16clgrxOVJf1e8pfSva+feJ6Q49Rltw33nXjXha/cV5WIbb3umIDrK0xpRlJW0I=
=O+uP
-END PGP SIGNATURE-

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Cleaning up configuration settings

2014-05-28 Thread Renat Akhmerov

On 28 May 2014, at 13:51, Angus Salkeld angus.salk...@rackspace.com wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 On 17/05/14 02:48, W Chan wrote:
 Regarding config opts for keystone, the keystoneclient middleware already 
 registers the opts at 
 https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/middleware/auth_token.py#L325
  
 under a keystone_authtoken group in the config file.  Currently, Mistral 
 registers the opts again at 
 https://github.com/stackforge/mistral/blob/master/mistral/config.py#L108 
 under a 
 different configuration group.  Should we remove the duplicate from Mistral 
 and 
 refactor the reference to keystone configurations to the keystone_authtoken 
 group?  This seems more consistent.
 
 I think that is the only thing that makes sense. Seems like a bug
 waiting to happen having the same options registered twice.
 
 If some user used to other projects comes and configures
 keystone_authtoken then will their config take effect?
 (how much confusion will that generate)..
 
 I'd suggest just using the one that is registered keystoneclient.

Ok, I had a feeling it was needed for some reason. But after having another 
look at this I think this is really a bug. Let’s do it.

Thanks guys
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Cleaning up configuration settings

2014-05-28 Thread W Chan
Thanks for following up.  I will publish this change as a separate patch
from my current config cleanup.


On Wed, May 28, 2014 at 2:38 AM, Renat Akhmerov rakhme...@mirantis.comwrote:


 On 28 May 2014, at 13:51, Angus Salkeld angus.salk...@rackspace.com
 wrote:

  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  On 17/05/14 02:48, W Chan wrote:
  Regarding config opts for keystone, the keystoneclient middleware
 already
  registers the opts at
 
 https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/middleware/auth_token.py#L325
  under a keystone_authtoken group in the config file.  Currently, Mistral
  registers the opts again at
 
 https://github.com/stackforge/mistral/blob/master/mistral/config.py#L108under 
 a
  different configuration group.  Should we remove the duplicate from
 Mistral and
  refactor the reference to keystone configurations to the
 keystone_authtoken
  group?  This seems more consistent.
 
  I think that is the only thing that makes sense. Seems like a bug
  waiting to happen having the same options registered twice.
 
  If some user used to other projects comes and configures
  keystone_authtoken then will their config take effect?
  (how much confusion will that generate)..
 
  I'd suggest just using the one that is registered keystoneclient.

 Ok, I had a feeling it was needed for some reason. But after having
 another look at this I think this is really a bug. Let’s do it.

 Thanks guys
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Community meeting reminder - 05/26/2014

2014-05-26 Thread Renat Akhmerov
Hi,

This is a reminder about the community meeting in IRC today at 16.00 UTC at 
#openstack-meeting.

Agenda:
Review action items
Current status (quickly by team members)
Summit results
Further plans
Open discussion

You can also find it at https://wiki.openstack.org/wiki/Meetings/MistralAgenda 
as well as links to the previous meeting minutes and logs.

Looking forward to see you all there!

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Cleaning up configuration settings

2014-05-22 Thread Renat Akhmerov
I tend to disagree with the whole idea. Not sure 100% though yet. Could you 
please explain the point of scattering configuration all over the code? In my 
opinion, we’re mixing different application concerns. With the current approach 
I always know where to look at in order to find all my configuration option 
definitions (types, descriptions etc.) but with this refactoring it seems to be 
a tricky task.

Thoughts? What benefits of doing that?

Renat Akhmerov
@ Mirantis Inc.



On 16 May 2014, at 21:32, Dmitri Zimine d...@stackstorm.com wrote:

 +1 for breaking down the configuration by modules. 
 
 Not sure about names for configuration group. Do you mean just using the same 
 group name? or more? 
 
 IMO groups are project specific; it doesn’t always make sense to use the same 
 group name in the context of different projects. Our requirement is 1) 
 auto-generate mistral.conf.example from the config.py and 2) sections make 
 sense in the product context.
 
 For example: how do we deal with rpc_backend and transport_url for oslo 
 messaging? Should we do something like CONF.import(_transport_opts, 
 “oslo.messaging.transport”, “transport”)? And use it by passing the group, 
 not entire contfig, like:
 
   transport = messaging.get_transport(cfg.messaging.CONF)
 instead of
   transport = messaging.get_transport(cfg.CONF)
 
 DZ 
 
 
 On May 16, 2014, at 12:46 PM, W Chan m4d.co...@gmail.com wrote:
 
 Regarding config opts for keystone, the keystoneclient middleware already 
 registers the opts at 
 https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/middleware/auth_token.py#L325
  under a keystone_authtoken group in the config file.  Currently, Mistral 
 registers the opts again at 
 https://github.com/stackforge/mistral/blob/master/mistral/config.py#L108 
 under a different configuration group.  Should we remove the duplicate from 
 Mistral and refactor the reference to keystone configurations to the 
 keystone_authtoken group?  This seems more consistent.
 
 
 On Thu, May 15, 2014 at 1:13 PM, W Chan m4d.co...@gmail.com wrote:
 Currently, the various configurations are registered in ./mistral/config.py. 
  The configurations are registered when mistral.config is referenced.  Given 
 the way the code is written, PEP8 throws referenced but not used error if 
 mistral.config is referenced but not called in the module.  In various use 
 cases, this is avoided by using importutils to import mistral.config (i.e. 
 https://github.com/stackforge/mistral/blob/master/mistral/tests/unit/engine/test_transport.py#L34).
   I want to break down registration code in ./mistral/config.py into 
 separate functions for api, engine, db, etc and move the registration closer 
 to the module where the configuration is needed.  Any objections?
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Cleaning up configuration settings

2014-05-22 Thread Angus Salkeld
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 23/05/14 05:00, W Chan wrote:
 Renat,
 
 I want to avoid having to explicitly import the mistral.config module in 
 order 
 to have configuration loaded properly.  The problem with the way 
 mistral.config 
 is coded is that we have to use importutils otherwise we get pep8 error if we 
 simply insert from mistral import config.  An example at 
 https://github.com/stackforge/mistral/blob/master/mistral/engine/__init__.py#L29.
   This 
 seems to be a chore when it comes down to writing tests where the 
 mistral.config 
 is not necessary loaded (whereas the launch script registers the 
 configuration 
 because the parse_args function in mistral.config is called and the problem 
 isn't as apparent).  So we see the 
 importutils.import_module('mistral.config') 
 scattered in multiple tests.

That is why this exists:

cfg.CONF.import_opt('debug', 'mistral.openstack.common.log')

- -Angus

 
 My initial patchset has all the configurations under mistral.config but I 
 have 
 them separated into different methods.  The tools/config/generate_sample.sh 
 expects the options to be at top level in the module.  I also looked at a few 
 other OpenStack projects for reference (i.e. nova, ceilometer, 
 oslo.messaging) 
 and then in the latest patchset moved them closer to the modules where they 
 are 
 needed thinking this may be more consistent with other projects.
 
 I can certainly revisit this and explore an alternate way to keep these 
 config 
 together and avoid the importutils problem.  This may be minor but I want to 
 take care of this clean up before we hit the ground running with juno related 
 bps.
 
 Winson
 
 
 
 On Thu, May 22, 2014 at 8:29 AM, Renat Akhmerov rakhme...@mirantis.com 
 mailto:rakhme...@mirantis.com wrote:
 
 I tend to disagree with the whole idea. Not sure 100% though yet. Could 
 you
 please explain the point of scattering configuration all over the code? In
 my opinion, we’re mixing different application concerns. With the current
 approach I always know where to look at in order to find all my
 configuration option definitions (types, descriptions etc.) but with this
 refactoring it seems to be a tricky task.
 
 Thoughts? What benefits of doing that?
 
 Renat Akhmerov
 @ Mirantis Inc.
 
 
 
 On 16 May 2014, at 21:32, Dmitri Zimine d...@stackstorm.com
 mailto:d...@stackstorm.com wrote:
 
 +1 for breaking down the configuration by modules.

 Not sure about names for configuration group. Do you mean just using the
 same group name? or more?

 IMO groups are project specific; it doesn’t always make sense to use the
 same group name in the context of different projects. Our requirement is
 1) auto-generate mistral.conf.example from the config.py and 2) sections
 make sense in the product context.

 For example: how do we deal with rpc_backend and transport_url for oslo
 messaging? Should we do something like CONF.import(_transport_opts,
 “oslo.messaging.transport”, “transport”)? And use it by passing the 
 group,
 not entire contfig, like:

 transport = messaging.get_transport(cfg.messaging.CONF)
 instead of
 transport = messaging.get_transport(cfg.CONF)

 DZ


 On May 16, 2014, at 12:46 PM, W Chan m4d.co...@gmail.com
 mailto:m4d.co...@gmail.com wrote:

 Regarding config opts for keystone, the keystoneclient middleware 
 already
 registers the opts at
 
 https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/middleware/auth_token.py#L325
 under a keystone_authtoken group in the config file.  Currently, Mistral
 registers the opts again at
 https://github.com/stackforge/mistral/blob/master/mistral/config.py#L108
 under a different configuration group.  Should we remove the duplicate
 from Mistral and refactor the reference to keystone configurations to 
 the
 keystone_authtoken group?  This seems more consistent.


 On Thu, May 15, 2014 at 1:13 PM, W Chan m4d.co...@gmail.com
 mailto:m4d.co...@gmail.com wrote:

 Currently, the various configurations are registered in
 ./mistral/config.py.  The configurations are registered when
 mistral.config is referenced.  Given the way the code is written,
 PEP8 throws referenced but not used error if mistral.config is
 referenced but not called in the module.  In various use cases, this
 is avoided by using importutils to import mistral.config (i.e.
 
 https://github.com/stackforge/mistral/blob/master/mistral/tests/unit/engine/test_transport.py#L34).
  I want to break down registration code in ./mistral/config.py into
 separate functions for api, engine, db, etc and move the 
 registration
 closer to the module where the configuration is needed.  Any 
 objections?


 ___
 OpenStack-dev mailing list
 

[openstack-dev] [Mistral] Mistral roadmap notes, from Atlanta summit (rough)

2014-05-20 Thread Dmitri Zimine
We shared and discussed the directions on Mistral development session,
and work through the list of smaller post POC steps, placing them on the 
roadmap.

The notes are here: https://etherpad.openstack.org/p/juno-summit-mistral.
Renat and I developed shared understanding on most of them. 

Next steps: create the blueprints, prioritize, implement. 

DZ.


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Why keystone token validation fails in PyCharm, and how to fix it

2014-05-19 Thread Adam Young

On 05/12/2014 10:25 PM, Dmitri Zimine wrote:
The problem: Keystone authentication on MAC works from command line, 
but fails when run from PyCharm. And I want to run PyCharm to debug!


The root cause: Keystone uses openssl cms which is only available in 
new openssl.  I installed openssl via brew, and got it in 
/usr/local/bin. Terminal works just fine because I have paths properly 
setup in /etc/paths file. But PyCharm and other non-terminal 
applications dont use it!

The right solution:
 create a file /etc/launchd.conf with the following line:
setenv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
**
The hack solution is:
 sudo mv /usr/bin/openssl /usr/bin/openssl_bak
 sudo ln -s /usr/bin/local/openssl /usr/bin/openssl

DZ




___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

This is a general problem, and solution, for Keystone on Mac.
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Cleaning up configuration settings

2014-05-16 Thread W Chan
Regarding config opts for keystone, the keystoneclient middleware already
registers the opts at
https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/middleware/auth_token.py#L325under
a keystone_authtoken group in the config file.  Currently, Mistral
registers the opts again at
https://github.com/stackforge/mistral/blob/master/mistral/config.py#L108under
a different configuration group.  Should we remove the duplicate from
Mistral and refactor the reference to keystone configurations to the
keystone_authtoken group?  This seems more consistent.


On Thu, May 15, 2014 at 1:13 PM, W Chan m4d.co...@gmail.com wrote:

 Currently, the various configurations are registered in
 ./mistral/config.py.  The configurations are registered when mistral.config
 is referenced.  Given the way the code is written, PEP8 throws referenced
 but not used error if mistral.config is referenced but not called in the
 module.  In various use cases, this is avoided by using importutils to
 import mistral.config (i.e.
 https://github.com/stackforge/mistral/blob/master/mistral/tests/unit/engine/test_transport.py#L34).
  I want to break down registration code in ./mistral/config.py into
 separate functions for api, engine, db, etc and move the registration
 closer to the module where the configuration is needed.  Any objections?

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Cleaning up configuration settings

2014-05-16 Thread Dmitri Zimine
+1 for breaking down the configuration by modules. 

Not sure about names for configuration group. Do you mean just using the same 
group name? or more? 

IMO groups are project specific; it doesn’t always make sense to use the same 
group name in the context of different projects. Our requirement is 1) 
auto-generate mistral.conf.example from the config.py and 2) sections make 
sense in the product context.

For example: how do we deal with rpc_backend and transport_url for oslo 
messaging? Should we do something like CONF.import(_transport_opts, 
“oslo.messaging.transport”, “transport”)? And use it by passing the group, not 
entire contfig, like:

transport = messaging.get_transport(cfg.messaging.CONF)
instead of
transport = messaging.get_transport(cfg.CONF)

DZ 


On May 16, 2014, at 12:46 PM, W Chan m4d.co...@gmail.com wrote:

 Regarding config opts for keystone, the keystoneclient middleware already 
 registers the opts at 
 https://github.com/openstack/python-keystoneclient/blob/master/keystoneclient/middleware/auth_token.py#L325
  under a keystone_authtoken group in the config file.  Currently, Mistral 
 registers the opts again at 
 https://github.com/stackforge/mistral/blob/master/mistral/config.py#L108 
 under a different configuration group.  Should we remove the duplicate from 
 Mistral and refactor the reference to keystone configurations to the 
 keystone_authtoken group?  This seems more consistent.
 
 
 On Thu, May 15, 2014 at 1:13 PM, W Chan m4d.co...@gmail.com wrote:
 Currently, the various configurations are registered in ./mistral/config.py.  
 The configurations are registered when mistral.config is referenced.  Given 
 the way the code is written, PEP8 throws referenced but not used error if 
 mistral.config is referenced but not called in the module.  In various use 
 cases, this is avoided by using importutils to import mistral.config (i.e. 
 https://github.com/stackforge/mistral/blob/master/mistral/tests/unit/engine/test_transport.py#L34).
   I want to break down registration code in ./mistral/config.py into separate 
 functions for api, engine, db, etc and move the registration closer to the 
 module where the configuration is needed.  Any objections?
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral][TaskFlow] Integration plan

2014-05-16 Thread Renat Akhmerov
Hey Josh, I’d like to thank you for a very productive discussion that we had at 
the summit, seems to be a great achievement for us in terms our collaboration 
and collective vision of both technologies. This was the first time I was able 
to clearly see how to align our capabilities better and hence provide 
tremendous usability benefits for the community.

Totally support bi-weekly meetings, let me take this part and figure out the 
schedule that would work for everyone of us.

Thanks
 
Renat Akhmerov
@ Mirantis Inc.



On 15 May 2014, at 22:30, Joshua Harlow harlo...@yahoo-inc.com wrote:

 Looks good to me,
 
 We had a good 'meetup' in one of the breakout rooms on the second floor
 (those rooms are pretty useful!)
 
 This does seem like a good step toward making both groups successful and
 from the discussion I think we have a decent vision of how this can/could
 work out in the future and moving forward (and even some other neat ideas
 on related areas were also discovered/discussed, which is pretty cool).
 
 I'll writeup some more these as TF blueprints next week and we can
 continue there (iterating on them and getting some code
 produced/adjusted/refactored). The timeline maybe we should continue
 thinking about as I'm still sure on the 'final' date but I agree with the
 get started now and we can start to 'approximate' what the date would be
 as we get a better 'feeling' for it (K seems like a good estimate).
 
 Another idea:
 
 The bi-weekly meetings between teams/individuals/other on IRC seemed like
 a good idea (to at least sync and discuss ideas and such), maybe we should
 continue those. What do u guys think?
 
 -Original Message-
 From: Dmitri Zimine d...@stackstorm.com
 Reply-To: OpenStack Development Mailing List (not for usage questions)
 openstack-dev@lists.openstack.org
 Date: Thursday, May 15, 2014 at 1:06 PM
 To: OpenStack Development Mailing List (not for usage questions)
 openstack-dev@lists.openstack.org
 Subject: [openstack-dev] [Mistral][TaskFlow] Integration plan
 
 Renat, Joshua, Dmitri and Timur discussed the integration path for
 Mistral and TaskFlow.
 Quick summary - guys please correct any mistakes or omissions:
 
 Taskflow - Mistral integration plan
 1) Mistral: define the set of workflow primitives, define correspondent
 DSL
  - Driven by user requirements. Keep to minimal. Implement in Mistral.
 2) Taskflow: break out flow scheduler (decision maker) and persistence
  - it'll be a low level library interference, Joshua has details
  - once done, ready to re-prototype integration, iterate until happy
 3) Move the primitives to TaskFlow (both teams)
 
 4) Integrate TaskFlow into Mistral (replace Mistral workflow engine with
 TaskFlow engine)
 
 Once integration complete, Mistral DSL will continue to work, all
 TaskFlow and Mistral workflows will be interchangeable, the code reused.
 
 DZ. 
 
 PS. When do we do it? We didn't commit to a date,
 but IMO (DZ) we start now, and with some luck get integrated in K cycle.
 
 
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
 
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral][TaskFlow] Integration plan

2014-05-15 Thread Dmitri Zimine
Renat, Joshua, Dmitri and Timur discussed the integration path for Mistral and 
TaskFlow. 
Quick summary - guys please correct any mistakes or omissions:

Taskflow - Mistral integration plan
1) Mistral: define the set of workflow primitives, define correspondent DSL
- Driven by user requirements. Keep to minimal. Implement in Mistral.
2) Taskflow: break out flow scheduler (decision maker) and persistence
- it'll be a low level library interference, Joshua has details
- once done, ready to re-prototype integration, iterate until happy
3) Move the primitives to TaskFlow (both teams)

4) Integrate TaskFlow into Mistral (replace Mistral workflow engine with 
TaskFlow engine)

Once integration complete, Mistral DSL will continue to work, all TaskFlow and 
Mistral workflows will be interchangeable, the code reused.

DZ. 

PS. When do we do it? We didn't commit to a date, 
but IMO (DZ) we start now, and with some luck get integrated in K cycle. 



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Cleaning up configuration settings

2014-05-15 Thread W Chan
Currently, the various configurations are registered in
./mistral/config.py.  The configurations are registered when mistral.config
is referenced.  Given the way the code is written, PEP8 throws referenced
but not used error if mistral.config is referenced but not called in the
module.  In various use cases, this is avoided by using importutils to
import mistral.config (i.e.
https://github.com/stackforge/mistral/blob/master/mistral/tests/unit/engine/test_transport.py#L34).
 I want to break down registration code in ./mistral/config.py into
separate functions for api, engine, db, etc and move the registration
closer to the module where the configuration is needed.  Any objections?
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral][TaskFlow] Integration plan

2014-05-15 Thread Joshua Harlow
Looks good to me,

We had a good 'meetup' in one of the breakout rooms on the second floor
(those rooms are pretty useful!)

This does seem like a good step toward making both groups successful and
from the discussion I think we have a decent vision of how this can/could
work out in the future and moving forward (and even some other neat ideas
on related areas were also discovered/discussed, which is pretty cool).

I'll writeup some more these as TF blueprints next week and we can
continue there (iterating on them and getting some code
produced/adjusted/refactored). The timeline maybe we should continue
thinking about as I'm still sure on the 'final' date but I agree with the
get started now and we can start to 'approximate' what the date would be
as we get a better 'feeling' for it (K seems like a good estimate).

Another idea:

The bi-weekly meetings between teams/individuals/other on IRC seemed like
a good idea (to at least sync and discuss ideas and such), maybe we should
continue those. What do u guys think?

-Original Message-
From: Dmitri Zimine d...@stackstorm.com
Reply-To: OpenStack Development Mailing List (not for usage questions)
openstack-dev@lists.openstack.org
Date: Thursday, May 15, 2014 at 1:06 PM
To: OpenStack Development Mailing List (not for usage questions)
openstack-dev@lists.openstack.org
Subject: [openstack-dev] [Mistral][TaskFlow] Integration plan

Renat, Joshua, Dmitri and Timur discussed the integration path for
Mistral and TaskFlow.
Quick summary - guys please correct any mistakes or omissions:

Taskflow - Mistral integration plan
1) Mistral: define the set of workflow primitives, define correspondent
DSL
   - Driven by user requirements. Keep to minimal. Implement in Mistral.
2) Taskflow: break out flow scheduler (decision maker) and persistence
   - it'll be a low level library interference, Joshua has details
   - once done, ready to re-prototype integration, iterate until happy
3) Move the primitives to TaskFlow (both teams)

4) Integrate TaskFlow into Mistral (replace Mistral workflow engine with
TaskFlow engine)

Once integration complete, Mistral DSL will continue to work, all
TaskFlow and Mistral workflows will be interchangeable, the code reused.

DZ. 

PS. When do we do it? We didn't commit to a date,
but IMO (DZ) we start now, and with some luck get integrated in K cycle.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Inviting everyone to design session at 2pm (B306)

2014-05-13 Thread Renat Akhmerov
I’m inviting everyone interested in Mistral (Workflow Service for OpenStack) to 
a design session today at 2pm (room B306). We’ll be talking about further 
Mistral development direction and it’s very important to gather as much 
feedback as possible.

Session: 
http://junodesignsummit.sched.org/event/4fb1a7be3d4cb74df9bdd3d4e9a60508#.U3IdsF5RE04
Etherpad: https://etherpad.openstack.org/p/juno-summit-mistral

I would really recommend to watch a 15 min screencast to have a background for 
a productive discussion.

Screencast: https://www.youtube.com/watch?v=x-zqz1CRVkI

Thanks, looking forward to see you there!

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Inviting everyone to design session at 2pm (B306)

2014-05-13 Thread Renat Akhmerov
I’m inviting everyone interested in Mistral (Workflow Service for OpenStack) to 
a design session today at 2pm (room B306). We’ll be talking about further 
Mistral development direction and it’s very important to gather as much 
feedback as possible.

Session: 
http://junodesignsummit.sched.org/event/4fb1a7be3d4cb74df9bdd3d4e9a60508#.U3IdsF5RE04
Etherpad: https://etherpad.openstack.org/p/juno-summit-mistral

I would really recommend to watch a 15 min screencast to have a background for 
a productive discussion.

Screencast: https://www.youtube.com/watch?v=x-zqz1CRVkI

Thanks, looking forward to see you there!

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral][atlanta] Follow-up on Mistral design session

2014-05-13 Thread Renat Akhmerov
Thanks for joining Mistral design session today!

I’m really glad to realize that so many people are interested in the project 
and it was so cool to answer your questions. We’re open to further discussions 
during the summit and afterwards. Please find us anytime in ML and IRC to ask 
addition questions and discuss the things that you think are important.

We’ve discussed only a part of a solid list of questions that we prepared in 
the etherpad (see the link below) so I hope we’ll find other communication 
formats to keep discussing them.

Slide deck: 
http://www.slideshare.net/RenatAkhmerov/mistral-atlantadev-session-34640055
Etherpad: https://etherpad.openstack.org/p/juno-summit-mistral
Screencast: https://www.youtube.com/watch?v=x-zqz1CRVkI

And just in case (sorry that I keep repeating it over and over again):
Launchpad: https://launchpad.net/mistral
Wiki: https://wiki.openstack.org/wiki/Mistral


Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Why keystone token validation fails in PyCharm, and how to fix it

2014-05-12 Thread Dmitri Zimine
The problem: Keystone authentication on MAC works from command line, but fails 
when run from PyCharm. And I want to run PyCharm to debug! 

The root cause: Keystone uses openssl cms which is only available in new 
openssl.  I installed openssl via brew, and got it in /usr/local/bin. Terminal 
works just fine because I have paths properly setup in /etc/paths file. But 
PyCharm and other non-terminal applications dont use it! 
 
The right solution: 
 create a file /etc/launchd.conf with the following line:
 setenv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
   
The hack solution is:
 sudo mv /usr/bin/openssl /usr/bin/openssl_bak
 sudo ln -s /usr/bin/local/openssl /usr/bin/openssl

DZ 


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral][Heat] Feedback on the Mistral DSL

2014-05-07 Thread Zane Bitter

Hi Mistral folks,
Congrats on getting the 0.0.2 release out. I had a look at Renat's 
screencast and the examples, and I wanted to share some feedback based 
on my experience with Heat. Y'all will have to judge for yourselves to 
what extent this experience is applicable to Mistral. (Assume that 
everything I know about it was covered in the screencast and you won't 
be far wrong.)


The first thing that struck me looking at 
https://github.com/stackforge/mistral-extra/tree/master/examples/create_vm 
is that I have to teach Mistral how to talk to Nova. I can't overstate 
how surprising this is as a user, because Mistral is supposed to want to 
become a part of OpenStack. It should know how to talk to Nova! There is 
actually an existing DSL for interacting with OpenStack[1], and here's 
what the equivalent operation looks like:


os server create $server_name --image $image_id --flavor $flavor_id 
--nic net-id=$network_id


Note that this is approximately exactly 96.875% shorter (or 3200% 
shorter, if you're in advertising).


This approach reminds me a bit of TOSCA, in the way that it requires you 
to define every node type before you use it. (Even TOSCA is moving away 
from this by developing a Simple Profile that includes the most common 
ones in the box - an approach I assume/hope you're considering also.) 
The stated reason for this is that they want TOSCA templates to run on 
any cloud regardless of its underlying features (rather than take a 
lowest-common-denominator approach, as other attempts at hybrid clouds 
have done). Contrast that with Heat, which is unapologetically an 
orchestration system *for OpenStack*.


I note from the screencast that Mistral's stated mission is to:

  Provide a mechanism to define and execute
  tasks and workflows *in OpenStack clouds*

(My emphasis.) IMO the design doesn't reflect the mission. You need to 
decide whether you are trying to build the OpenStack workflow DSL or the 
workflow DSL to end all workflow DSLs.



That problem could be solved by including built-in definitions for core 
OpenStack service in a similar way to std.* (i.e. take the TOSCA Simple 
Profile approach), but I'm actually not sure that goes far enough. The 
lesson of Heat is that we do best when we orchestrate *only* OpenStack APIs.


For example, when we started working on Heat, there was no autoscaling 
in OpenStack so we implemented it ourselves inside Heat. Two years 
later, there's still no autoscaling in OpenStack other than what we 
implemented, and we've been struggling for a year to try to split Heat's 
implementation out into a separate API so that everyone can use it.


Looking at things like std.email, I feel a similar way about them. 
OpenStack is missing something equivalent to SNS, where a message on a 
queue can trigger an email or another type of notification, and a lot of 
projects are going to eventually need something like that. It would be 
really unfortunate if all of them went out and invented it 
independently. It's much better to implement such things as their own 
building blocks that can be combined together in complex ways rather 
than adding that complexity to a bunch of services.


Such a notification service could even be extended to do std.http-like 
ReST calls, although personally the whole idea of OpenStack services 
calling out to arbitrary HTTP APIs makes me extremely uncomfortable. 
Much better IMO to just post messages to queues and let the receiver 
(long) poll for it.


So I would favour a DSL that is *much* simpler, and replaces all of 
std.* with functions that call OpenStack APIs, and only OpenStack APIs, 
including the API for posting messages to Marconi queues, which would be 
the method of communication to the outside world. (If the latter part 
sounds a bit like SWF, it's for a good reason, but the fact that it 
would allow access directly to all of the OpenStack APIs before 
resorting to an SDK makes it much more powerful, as well as providing a 
solid justification for why this should be part of OpenStack.)


The ideal way to get support for all of the possible OpenStack APIs 
would be to do it by introspection on python-openstackclient. That means 
you'd only have to do the work once and it will stay up to date. This 
would avoid the problem we have in Heat, where we have to implement each 
resource type separately. (This is the source of a great deal of Heat's 
value to users - the existence of tested resource plugins - but also the 
thing that stops us from iterating the code quicker.)



I'm also unsure that it's a good idea for things like timers to be set 
up inside the DSL. I would prefer that the DSL just define workflows and 
export entry points to them. Then have various ways to trigger them: 
from the API manually, from a message to a Marconi queue, from a timer, 
c. The latter two you'd set up through the Mistral API. If a user 
wanted a single document that set up one or more workflows and their 
triggers, a Heat template 

Re: [openstack-dev] [Mistral][Heat] Feedback on the Mistral DSL

2014-05-07 Thread Renat Akhmerov
Hi Zane,

Great feedback! My comments below...

On 07 May 2014, at 22:29, Zane Bitter zbit...@redhat.com wrote:

 The first thing that struck me looking at 
 https://github.com/stackforge/mistral-extra/tree/master/examples/create_vm is 
 that I have to teach Mistral how to talk to Nova. I can't overstate how 
 surprising this is as a user, because Mistral is supposed to want to become a 
 part of OpenStack. It should know how to talk to Nova! There is actually an 
 existing DSL for interacting with OpenStack[1], and here's what the 
 equivalent operation looks like:
 
 os server create $server_name --image $image_id --flavor $flavor_id --nic 
 net-id=$network_id
 
 Note that this is approximately exactly 96.875% shorter (or 3200% shorter, if 
 you're in advertising).
 
 This approach reminds me a bit of TOSCA, in the way that it requires you to 
 define every node type before you use it. (Even TOSCA is moving away from 
 this by developing a Simple Profile that includes the most common ones in the 
 box - an approach I assume/hope you're considering also.) The stated reason 
 for this is that they want TOSCA templates to run on any cloud regardless of 
 its underlying features (rather than take a lowest-common-denominator 
 approach, as other attempts at hybrid clouds have done). Contrast that with 
 Heat, which is unapologetically an orchestration system *for OpenStack*.

Fully understandable. Originally we did want to build a really generic service 
with minimal knowledge about an infrastructure in which it would work. And we 
wanted to build something really simple and were afraid of blowing the 
framework with too many features related to OpenStack services. Because if we 
had started adding, for example, Nova actions then we would have probably had 
to include others like Cinder, Neutron etc. etc. and the question was “Where 
should we stop? Where is the line that we shouldn’t cross?”.

However, since then our opinion (at least my personal) has changed regarding 
this question and that’s we we’ve designed our action subsystem easy to enable 
plugins. So along with “std” namespace that is given out of the box there will 
be others like “nova”, may be implemented as a separate additional project for 
better arch decomposition but that’s a different question.. This work is not 
finished yet, one of the things we wanted to do is to gather as much feedback 
as possible before the summit and at the summit itself but, I’m now 99% sure we 
need to move forward to having all the action packs to enable users to natively 
use all core OpenStack services.

So basically I agree with you on that one. What you saw in the demo was mostly 
intended to demonstrate how you can extend existing actions by describing 
adapters to them right in DSL. But I guess it’s my fault that I didn’t deliver 
that message.


 I note from the screencast that Mistral's stated mission is to:
 
  Provide a mechanism to define and execute
  tasks and workflows *in OpenStack clouds*
 
 (My emphasis.) IMO the design doesn't reflect the mission. You need to decide 
 whether you are trying to build the OpenStack workflow DSL or the workflow 
 DSL to end all workflow DSLs.
 
 
 That problem could be solved by including built-in definitions for core 
 OpenStack service in a similar way to std.* (i.e. take the TOSCA Simple 
 Profile approach), but I'm actually not sure that goes far enough. The lesson 
 of Heat is that we do best when we orchestrate *only* OpenStack APIs.

Yes, it is related with my previous comment. I really do believe we shouldn’t 
be trying to build a OpenStack agnostic workflow DSL (and service). Excessive 
generalization is evil as well as excessive specialization so we need to find a 
good balance. But we’re definitely building a workflow service for OpenStack 
and are intended to moving to making OpenStack services to easy and natively 
use in Mistral.

And please note that this part just wasn’t the main focus of the first phase of 
development. We rather wanted to try out the approach itself and show the 
community what we got as a result of our research. Even though the release 
version is 0.0.2 (for purely technical reasons) we still consider it sort of a 
PoC in a sense that we may want to change DSL and design pretty significantly.

 For example, when we started working on Heat, there was no autoscaling in 
 OpenStack so we implemented it ourselves inside Heat. Two years later, 
 there's still no autoscaling in OpenStack other than what we implemented, and 
 we've been struggling for a year to try to split Heat's implementation out 
 into a separate API so that everyone can use it.
 
 Looking at things like std.email, I feel a similar way about them. OpenStack 
 is missing something equivalent to SNS, where a message on a queue can 
 trigger an email or another type of notification, and a lot of projects are 
 going to eventually need something like that. It would be really unfortunate 
 if all of them went out and 

[openstack-dev] [mistral] Community meeting reminder - 05/05/2014

2014-05-05 Thread Renat Akhmerov
Hi,

This is a reminder about the community meeting we’ll have today at 16.00 UTC at 
#openstack-meeting.

Agenda:
Review action items
Current status (quickly by team members)
Summit preparations
Further plans
Open discussion

It can also be found at https://wiki.openstack.org/wiki/Meetings/MistralAgenda 
as well as the links to the previous meeting minutes and logs.

Thanks!

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Community meeting minutes/log - 05/05/2014

2014-05-05 Thread Renat Akhmerov
Thanks for joining us today.

Meeting minutes: 
http://eavesdrop.openstack.org/meetings/mistral/2014/mistral.2014-05-05-16.00.html
Full log: 
http://eavesdrop.openstack.org/meetings/mistral/2014/mistral.2014-05-05-16.00.log.html

My suggestion would be to skip the next two meetings due to Summit activities 
and have the next meeting on May 26th. Thoughts?

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Mistral 0.0.2 is released!

2014-04-30 Thread Renat Akhmerov
I’m glad to announce release 0.0.2 of Mistral, Workflow Service for OpenStack, 
which delivers all the functionality that we planned to deliver in PoC 
development phase.

Below are all the most important links related to this release that will help 
you understand Mistral ideas. It is recommended to start with a 15 min 
screencast (the first link) and then explore other links.

Screencast - http://www.youtube.com/watch?v=x-zqz1CRVkI
Tarballs can be found at https://launchpad.net/mistral/icehouse/0.0.2
Release description on wiki - 
https://wiki.openstack.org/wiki/Mistral/Releases/0.0.2
Workflow examples:
Create VM - 
https://github.com/stackforge/mistral-extra/tree/master/examples/create_vm
Webhooks scheduling - 
https://github.com/stackforge/mistral-extra/tree/master/examples/webhooks
Running a job on VM - 
https://github.com/stackforge/mistral-extra/tree/master/examples/vm_job
Wiki - https://wiki.openstack.org/wiki/Mistral
Launchpad (blueprints, bugs, downloads) - https://launchpad.net/mistral
Git repositories:
Mistral Core - https://github.com/stackforge/mistral
Mistral Extras (examples) - https://github.com/stackforge/mistral-extra
Mistral Client - https://github.com/stackforge/python-mistralclient

Thanks!

Renat Akhmerov
@ Mirantis Inc.

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Community meeting reminder - 04/28/2014

2014-04-28 Thread Renat Akhmerov
Hi,

This is a reminder about another community meeting that we’ll be having today 
at 16.00 UTC (#openstack-meeting).

The agenda:
Review action items
Current status (quickly by team members)
POC readiness and steps that left to finalise it
Open discussion

You can also find it at https://wiki.openstack.org/wiki/Meetings/MistralAgenda 
as well as the links the previous meeting minutes and logs.

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Community meeting minutes/logs - 02/28/2014

2014-04-28 Thread Renat Akhmerov
Thanks for joining today’s community meeting.

Minutes: 
http://eavesdrop.openstack.org/meetings/mistral/2014/mistral.2014-04-28-16.00.html
Full log: 
http://eavesdrop.openstack.org/meetings/mistral/2014/mistral.2014-04-28-16.00.log.html

The next meeting is scheduled for May 5.

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow integration summary

2014-04-24 Thread Dmitri Zimine
Ivan, 

any update/progress on this? 

Thanks, DZ.


On Apr 15, 2014, at 10:21 AM, Joshua Harlow harlo...@yahoo-inc.com wrote:

 Well Ivan afaik is thinking through it, but being a community project its not 
 exactly easy to put estimations or timelines on things (I don't control Ivan, 
 or others).
 
 Likely faster if u guys want to get involved.
 
 -Josh
 
 From: Renat Akhmerov rakhme...@mirantis.com
 Reply-To: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org
 Date: Tuesday, April 15, 2014 at 12:35 AM
 To: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org
 Subject: Re: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow 
 integration summary
 
 
 On 15 Apr 2014, at 11:13, Joshua Harlow harlo...@yahoo-inc.com wrote:
 
 Sure, its not the fully complete lazy_engine, but piece by piece we can get 
 there.
 
 Did you make any estimations when it could happen? :)
 
 Of course code/contributions are welcome, as such things will benefit more 
 than just mistral, but openstack as a whole :-)
 
 OK.
 
 From: Kirill Izotov enyk...@stackstorm.com
 The whole idea of sub-flows within the scope of direct conditional 
 transitions is a bit unclear to me (and probably us all) at the moment, 
 though I'm trying to rely on them only as a means to lesser the complexity.
 
 Yes, eventually it’s for reducing complexity. I would just add that it opens 
 wide range of opportunities like:
 ability to combine multiple physically independent workflows
 reusability (using one workflow as a part of another)
 isolation (different namespaces for data flow contexts etc)
 
 Renat Akhmerov
 @ Mirantis Inc.
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

2014-04-16 Thread Renat Akhmerov
Ok, no problem :)

Renat Akhmerov
@ Mirantis Inc.



On 16 Apr 2014, at 12:43, Joshua Harlow harlo...@yahoo-inc.com wrote:

 I have stricken the word micro and language from my vocabulary. Begone 
 evil demons!! Haha :)
 
 Sent from my really tiny device...
 
 On Apr 15, 2014, at 10:35 PM, Renat Akhmerov rakhme...@mirantis.com wrote:
 
 On 16 Apr 2014, at 00:18, Joshua Harlow harlo...@yahoo-inc.com wrote:
 
 Decider sounds like it could work also as a name, although it seems from 
 dataflow like work its called a switch or gate, either or I guess.
 
 That’s fine. It doesn’t matter too much to me personally.
 
 As far as the micro-language:
 
 So there are typically 2 types of DSL's that occur, internal and external.
 
 An internal DSL is like 
 http://martinfowler.com/bliki/InternalDslStyle.html, taskflow is already a 
 micro-DSL internal to python (mistral is an external DSL[1]). To me there 
 is a drawback of becoming to much of a DSL (internal or external) in that 
 it requires a lot of new learning (imho internal DSLs are easier to pick-up 
 since they take advantage of the surrounding languages capabilities, in 
 this case python). So that’s what I just want to keep in our minds that we 
 need to make it simple *enough*, or we will die a nasty death of complexity 
 :-P
 
 [1] http://martinfowler.com/bliki/DomainSpecificLanguage.html
 
 Ok, got it. Thanks. I’m just still not sure why you emphasize on that 
 micro-language thing. IMO terms like that can scary people :) In fact, this 
 ‘switch’ (or decider, or whatever) is just an additional API which can be 
 used to alter flow behavior. 
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

2014-04-15 Thread Renat Akhmerov
Some notes:
Even though we use YAQL now our design is flexible enough to plug other ELs in.
If it tells you something in Amazon SWF a component that makes a decision about 
a further route is called Decider. 
This discussion about conditionals is surely important but it doesn’t matter 
too much if we don’t agree on that lazy execution model.

 Of course I'm trying to make the above not be its own micro-language as much 
 as possible (a switch object starts to act like one, sadly).

Why do you think it’s going to be a micro-language?

 [1] http://www.cs.cmu.edu/~aldrich/papers/onward2009-concurrency.pdf
 [2] 
 http://www.cs.ucf.edu/~dcm/Teaching/COT4810-Spring2011/Literature/DataFlowProgrammingLanguages.pdf

Cool, thanks!

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow integration summary

2014-04-15 Thread Kirill Izotov
Since you have mentioned that, I'm kind of interested, who else is going to 
benefit from this transition?  

I'm asking because everyone tells me that it's essential for us to work 
together, though my senses tells me that we are starting from different 
prerequisites, targeting different use cases and taking the entirely different 
approaches to solve the problem. Actually, I'd say we have more differences 
than the things we have in common.

Did you hear the same requests from anyone of your current users? May be we 
should invite them for discussion, just to make sure we would not have to redo 
it again.  

--  
Kirill Izotov


вторник, 15 апреля 2014 г. в 11:13, Joshua Harlow написал:

 Sure, its not the fully complete lazy_engine, but piece by piece we can get 
 there.
  
 Of course code/contributions are welcome, as such things will benefit more 
 than just mistral, but openstack as a whole :-)  
  
 -Josh  
  
 From: Kirill Izotov enyk...@stackstorm.com (mailto:enyk...@stackstorm.com)
 Date: Monday, April 14, 2014 at 9:02 PM
 To: Joshua Harlow harlo...@yahoo-inc.com (mailto:harlo...@yahoo-inc.com)
 Cc: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org (mailto:openstack-dev@lists.openstack.org)
 Subject: Re: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow 
 integration summary
  
  Thank for pointing that out, Joshua.  
   
  I had a look on [1] and it seems to me that it might actually do the trick 
  to some degree, though I'm afraid this is still not what we are looking 
  for. While Mistral is asynchronous and event-driven, this particular design 
  is not and would still force us to store the engine in memory and therefore 
  limit our means of scalability. The lazy engine (or better controller) I 
  have proposed is asynchronous at its core and would fit the needs for both 
  of us (since it's much easier to make sync from async, rather than 
  backwards).  
   
  Regarding the retries, while it might work with the current flow design, I 
  doubt it would work with conditional transitions. The attempt to build a 
  repeater by incapsulating the tasks into sub-flow will basically means that 
  every transition they produce will be in that flow and you can't leave it 
  until they are all finished. The whole idea of sub-flows within the scope 
  of direct conditional transitions is a bit unclear to me (and probably us 
  all) at the moment, though I'm trying to rely on them only as a means to 
  lesser the complexity.  
   
  [1] https://review.openstack.org/#/c/86470  
   
  --   
  Kirill Izotov
   
   
  пятница, 11 апреля 2014 г. в 23:47, Joshua Harlow написал:
   
   Thanks for the write-up krill.

   Also some adjustments,  

   Both points are good, and putting some of this on @ 
   https://etherpad.openstack.org/p/taskflow-mistral-details so that we can 
   have it actively noted (feel free to adjust it).  

   I think ivan is working on some docs/code/… for the lazy engine idea, so 
   hopefully we can get back soon with that. Lets see what comes out of that 
   effort and iterate on that.  

   For (2), our are mostly correct about unconditional execution although 
   [1] does now change this, and there are a few active reviews that are 
   being worked [3] on to fit this mistral use-case better. I believe [2] 
   can help move in this direction, ivans ideas I think will also push it a 
   little farther to. Of course lets work together to make sure they fit the 
   best so that taskflow  mistral  openstack can be the best it can be 
   (pigeons not included).  

   Can we also make sure the small issues are noted somewhere (maybe in the 
   above etherpad??). Thanks!  

   [1] https://wiki.openstack.org/wiki/TaskFlow#Retries  
   [2] https://review.openstack.org/#/c/86470
   [3] 
   https://review.openstack.org/#/q/status:open+project:openstack/taskflow,n,z
 

   From: Kirill Izotov enyk...@stackstorm.com 
   (mailto:enyk...@stackstorm.com)
   Reply-To: OpenStack Development Mailing List (not for usage questions) 
   openstack-dev@lists.openstack.org 
   (mailto:openstack-dev@lists.openstack.org)
   Date: Thursday, April 10, 2014 at 9:20 PM
   To: OpenStack-dev@lists.openstack.org 
   (mailto:OpenStack-dev@lists.openstack.org) 
   OpenStack-dev@lists.openstack.org 
   (mailto:OpenStack-dev@lists.openstack.org)
   Subject: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow 
   integration summary

Hi everyone,  
 
This is a summary to the prototype integration we did not too long ago: 
http://github.com/enykeev/mistral/pull/1. Hope it would shed some light 
on the aspects of the integration we are struggling with.  
 
There is a possibility to build Mistral on top of TaskFlow as a 
library, but in order to meet the requirements dictated by Mistral 
users and use cases, both Mistral and TaskFlow should change.  
 
There are two main sides of the story

Re: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow integration summary

2014-04-15 Thread Renat Akhmerov

On 15 Apr 2014, at 11:13, Joshua Harlow harlo...@yahoo-inc.com wrote:

 Sure, its not the fully complete lazy_engine, but piece by piece we can get 
 there.

Did you make any estimations when it could happen? :)

 Of course code/contributions are welcome, as such things will benefit more 
 than just mistral, but openstack as a whole :-)

OK.

 From: Kirill Izotov enyk...@stackstorm.com
 The whole idea of sub-flows within the scope of direct conditional 
 transitions is a bit unclear to me (and probably us all) at the moment, 
 though I'm trying to rely on them only as a means to lesser the complexity.

Yes, eventually it’s for reducing complexity. I would just add that it opens 
wide range of opportunities like:
ability to combine multiple physically independent workflows
reusability (using one workflow as a part of another)
isolation (different namespaces for data flow contexts etc)

Renat Akhmerov
@ Mirantis Inc.

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Tracking PoC readiness etherpad

2014-04-15 Thread Renat Akhmerov
Team,

Following up on the yesterday’s community meeting I created an etherpad and 
captured all the formal steps we need to make in order to consider Mistral PoC 
ready [0]. Please take a look and comment and/or add other items that you think 
I missed.

My expectation is to get all the items going before “Release under ‘poc’ tag in 
git knocked out this week. The rest is on the next week.

[0] https://etherpad.openstack.org/p/mistral-poc-readiness

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

2014-04-15 Thread Joshua Harlow
I think we agree on the lazy execution model. At least at a high-level, I'd 
rather not agree on the API's that are exactly exposed until there is an 
implementation since I've found that agreeing to any type of API's before there 
is the needed groundwork to make it happen is pretty useless and a waste of 
energy on everyones part.

Decider sounds like it could work also as a name, although it seems from 
dataflow like work its called a switch or gate, either or I guess.

As far as the micro-language:

So there are typically 2 types of DSL's that occur, internal and external.

An internal DSL is like http://martinfowler.com/bliki/InternalDslStyle.html, 
taskflow is already a micro-DSL internal to python (mistral is an external 
DSL[1]). To me there is a drawback of becoming to much of a DSL (internal or 
external) in that it requires a lot of new learning (imho internal DSLs are 
easier to pick-up since they take advantage of the surrounding languages 
capabilities, in this case python). So that’s what I just want to keep in our 
minds that we need to make it simple *enough*, or we will die a nasty death of 
complexity :-P

[1] http://martinfowler.com/bliki/DomainSpecificLanguage.html

From: Renat Akhmerov rakhme...@mirantis.commailto:rakhme...@mirantis.com
Reply-To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Date: Tuesday, April 15, 2014 at 12:19 AM
To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

Some notes:

  *   Even though we use YAQL now our design is flexible enough to plug other 
ELs in.
  *   If it tells you something in Amazon SWF a component that makes a decision 
about a further route is called Decider.
  *   This discussion about conditionals is surely important but it doesn’t 
matter too much if we don’t agree on that lazy execution model.

Of course I'm trying to make the above not be its own micro-language as much as 
possible (a switch object starts to act like one, sadly).

Why do you think it’s going to be a micro-language?

[1] http://www.cs.cmu.edu/~aldrich/papers/onward2009-concurrency.pdf
[2] 
http://www.cs.ucf.edu/~dcm/Teaching/COT4810-Spring2011/Literature/DataFlowProgrammingLanguages.pdf

Cool, thanks!

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow integration summary

2014-04-15 Thread Joshua Harlow
Well Ivan afaik is thinking through it, but being a community project its not 
exactly easy to put estimations or timelines on things (I don't control Ivan, 
or others).

Likely faster if u guys want to get involved.

-Josh

From: Renat Akhmerov rakhme...@mirantis.commailto:rakhme...@mirantis.com
Reply-To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Date: Tuesday, April 15, 2014 at 12:35 AM
To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow integration 
summary


On 15 Apr 2014, at 11:13, Joshua Harlow 
harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com wrote:

Sure, its not the fully complete lazy_engine, but piece by piece we can get 
there.

Did you make any estimations when it could happen? :)

Of course code/contributions are welcome, as such things will benefit more than 
just mistral, but openstack as a whole :-)

OK.

From: Kirill Izotov enyk...@stackstorm.commailto:enyk...@stackstorm.com
The whole idea of sub-flows within the scope of direct conditional transitions 
is a bit unclear to me (and probably us all) at the moment, though I'm trying 
to rely on them only as a means to lesser the complexity.

Yes, eventually it’s for reducing complexity. I would just add that it opens 
wide range of opportunities like:

  *   ability to combine multiple physically independent workflows
  *   reusability (using one workflow as a part of another)
  *   isolation (different namespaces for data flow contexts etc)

Renat Akhmerov
@ Mirantis Inc.

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

2014-04-15 Thread Renat Akhmerov
On 16 Apr 2014, at 00:18, Joshua Harlow harlo...@yahoo-inc.com wrote:

 Decider sounds like it could work also as a name, although it seems from 
 dataflow like work its called a switch or gate, either or I guess.

That’s fine. It doesn’t matter too much to me personally.

 As far as the micro-language:
 
 So there are typically 2 types of DSL's that occur, internal and external.
 
 An internal DSL is like http://martinfowler.com/bliki/InternalDslStyle.html, 
 taskflow is already a micro-DSL internal to python (mistral is an external 
 DSL[1]). To me there is a drawback of becoming to much of a DSL (internal or 
 external) in that it requires a lot of new learning (imho internal DSLs are 
 easier to pick-up since they take advantage of the surrounding languages 
 capabilities, in this case python). So that’s what I just want to keep in our 
 minds that we need to make it simple *enough*, or we will die a nasty death 
 of complexity :-P
 
 [1] http://martinfowler.com/bliki/DomainSpecificLanguage.html

Ok, got it. Thanks. I’m just still not sure why you emphasize on that 
micro-language thing. IMO terms like that can scary people :) In fact, this 
‘switch’ (or decider, or whatever) is just an additional API which can be used 
to alter flow behavior. 

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

2014-04-15 Thread Joshua Harlow
I have stricken the word micro and language from my vocabulary. Begone evil 
demons!! Haha :)

Sent from my really tiny device...

On Apr 15, 2014, at 10:35 PM, Renat Akhmerov 
rakhme...@mirantis.commailto:rakhme...@mirantis.com wrote:

On 16 Apr 2014, at 00:18, Joshua Harlow 
harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com wrote:

Decider sounds like it could work also as a name, although it seems from 
dataflow like work its called a switch or gate, either or I guess.

That’s fine. It doesn’t matter too much to me personally.

As far as the micro-language:

So there are typically 2 types of DSL's that occur, internal and external.

An internal DSL is like http://martinfowler.com/bliki/InternalDslStyle.html, 
taskflow is already a micro-DSL internal to python (mistral is an external 
DSL[1]). To me there is a drawback of becoming to much of a DSL (internal or 
external) in that it requires a lot of new learning (imho internal DSLs are 
easier to pick-up since they take advantage of the surrounding languages 
capabilities, in this case python). So that’s what I just want to keep in our 
minds that we need to make it simple *enough*, or we will die a nasty death of 
complexity :-P

[1] http://martinfowler.com/bliki/DomainSpecificLanguage.html

Ok, got it. Thanks. I’m just still not sure why you emphasize on that 
micro-language thing. IMO terms like that can scary people :) In fact, this 
‘switch’ (or decider, or whatever) is just an additional API which can be used 
to alter flow behavior.

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.orgmailto:OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Community meeting reminder - 04/14/2014

2014-04-14 Thread Renat Akhmerov
Hi,

This a reminder about the community meeting in IRC (#openstack-meeting) that 
we’ll have today at 16.00 UTC.

Agenda:
Review action items
Current status (quickly by team members)
POC demo scenario readiness and ways to improve it
TaskFlow integration status
Open discussion

It could also be seen at https://wiki.openstack.org/wiki/Meetings/MistralAgenda 
as well as the links to the previous meeting minutes and logs.

See you there!

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

2014-04-14 Thread Renat Akhmerov
The more the better :)

If seriously, this one is less detailed and rather focuses on high-level things 
so that everyone can have a high-level understanding of what’s been going on on 
Mistral/TaskFlow integration. In other words, this email raises question “What” 
and doesn’t raise “Why?” while [0] goes deeper into details.

[0] http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html

Renat Akhmerov
@ Mirantis Inc.



On 12 Apr 2014, at 00:59, Joshua Harlow harlo...@yahoo-inc.com wrote:

 I'm confused, why is this 2 emails??
 
 http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html
 
 Seems better to just have 1 chain, not 2.
 
 From: Dmitri Zimine d...@stackstorm.com
 Reply-To: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org
 Date: Friday, April 11, 2014 at 9:55 AM
 To: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org
 Subject: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary
 
 We prototyped Mistral / TaskFlow integration and have a follow-up 
 discussions. 
 
 SUMMARY: Mistral (Workflow Service) can embed TaskFlow as a workflow 
 library, with some required modifications to function resliently as a 
 service, and for smooth integration. However, the TaskFlow flow controls are 
 insufficient for Mistral use cases. 
 
 Details discussed on other thirds. 
 The prototype scope - [0]; code and discussion - [1] and techical highlights 
 - [2].
 
 DETAILS: 
 
 1) Embedding TaskFlow inside Mistral:
 * Required: make the engine lazy [3], [4].This is required to support 
 long-running delegates and not loose tasks when engine manager process 
 restarts.
 
 * Persistence: need clarity how to replace or mix-in TaskFlow persistence 
 with Mistral persistence. Renat is taking a look.
 
 * Declaring Flows in YAML DSL: done for simplest flow. Need to prototype for 
 data flow. Rich flow controls are missing in TaskFlow for a representative 
 prototype.
 
 * ActionRunners vs Taskflow Workers - not prototyped. Not a risk: both 
 Mistral and TaskFlow implementations work. But we shall resolve the overlap. 
 
 * Ignored for now - unlikely any risks: Keystone integration, Mistral event 
 scheduler, Mistral declarative services and action definition.
 
 2) TaskFlow library features
 * Must: flow control - conditional transitions, references, expression 
 evaluation, to express real-life workflows [5]. The required flow control 
 primitives are 1) repeater 2) flow in flow 3) direct transition 4) 
 conditional transition 5) multiple data. TaskFlow has 1) and 2), need to add 
 3/4/5. 
 
 * Other details and smaller requests are in the discussion [1]
 
 3) Next Steps proposed:
 * Mistal team: summarize the requirements discussed and agreed on [2] and [3]
 * Mistral team: code sample (tests?) on how Mistral would like to consume 
 TaskFlow lazy engine 
 * Taskflow team: Provide a design for alternative TaskExecutor approach 
 (prototypes, boxes, arrows, crayons :)) 
 * Decide on lazy engine
 * Move the discussion on other elements on integration.
 
 References:
 [0] The scope of the prototype: 
 https://etherpad.openstack.org/p/mistral-taskflow-prototype
 [1] Prototype code and discussion https://github.com/enykeev/mistral/pull/1
 [2] Techical summary 
 http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html
 [3] Email discussion on TaskFlow lazy eninge 
 http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html
 [4] IRC discussion Mistral/Taskflow http://paste.openstack.org/show/75389/
 [5] Use cases https://github.com/dzimine/mistral-workflows/tree/add-usecases
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Community meeting minutes - 04/14/2014

2014-04-14 Thread Renat Akhmerov
Thanks for joining today’s community meeting.

Meeting minutes: 
http://eavesdrop.openstack.org/meetings/mistral/2014/mistral.2014-04-14-15.59.html
Full log: 
http://eavesdrop.openstack.org/meetings/mistral/2014/mistral.2014-04-14-15.59.log.html

Please join us next monday on Apr 21st.

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

2014-04-14 Thread Joshua Harlow
Gotcha, thanks :)

From: Renat Akhmerov rakhme...@mirantis.commailto:rakhme...@mirantis.com
Reply-To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Date: Monday, April 14, 2014 at 5:11 AM
To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

The more the better :)

If seriously, this one is less detailed and rather focuses on high-level things 
so that everyone can have a high-level understanding of what’s been going on on 
Mistral/TaskFlow integration. In other words, this email raises question “What” 
and doesn’t raise “Why?” while [0] goes deeper into details.

[0] http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html

Renat Akhmerov
@ Mirantis Inc.



On 12 Apr 2014, at 00:59, Joshua Harlow 
harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com wrote:

I'm confused, why is this 2 emails??

http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html

Seems better to just have 1 chain, not 2.

From: Dmitri Zimine d...@stackstorm.commailto:d...@stackstorm.com
Reply-To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Date: Friday, April 11, 2014 at 9:55 AM
To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

We prototyped Mistral / TaskFlow integration and have a follow-up discussions.

SUMMARY: Mistral (Workflow Service) can embed TaskFlow as a workflow library, 
with some required modifications to function resliently as a service, and for 
smooth integration. However, the TaskFlow flow controls are insufficient for 
Mistral use cases.

Details discussed on other thirds.
The prototype scope - 
[0https://etherpad.openstack.org/p/mistral-taskflow-prototype]; code and 
discussion - [1https://github.com/enykeev/mistral/pull/1] and techical 
highlights - 
[2http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html].

DETAILS:

1) Embedding TaskFlow inside Mistral:
* Required: make the engine lazy 
[3http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html], 
[4http://paste.openstack.org/show/75389/].This is required to support 
long-running delegates and not loose tasks when engine manager process restarts.

* Persistence: need clarity how to replace or mix-in TaskFlow persistence with 
Mistral persistence. Renat is taking a look.

* Declaring Flows in YAML DSL: done for simplest flow. Need to prototype for 
data flow. Rich flow controls are missing in TaskFlow for a representative 
prototype.

* ActionRunners vs Taskflow Workers - not prototyped. Not a risk: both Mistral 
and TaskFlow implementations work. But we shall resolve the overlap.

* Ignored for now - unlikely any risks: Keystone integration, Mistral event 
scheduler, Mistral declarative services and action definition.

2) TaskFlow library features
* Must: flow control - conditional transitions, references, expression 
evaluation, to express real-life workflows 
[5https://github.com/dzimine/mistral-workflows/tree/add-usecases]. The 
required flow control primitives are 1) repeater 2) flow in flow 3) direct 
transition 4) conditional transition 5) multiple data. TaskFlow has 1) and 2), 
need to add 3/4/5.

* Other details and smaller requests are in the discussion 
[1https://github.com/enykeev/mistral/pull/1]

3) Next Steps proposed:
* Mistal team: summarize the requirements discussed and agreed on 
[2http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html] 
and 
[3http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html]
* Mistral team: code sample (tests?) on how Mistral would like to consume 
TaskFlow lazy engine
* Taskflow team: Provide a design for alternative TaskExecutor approach 
(prototypes, boxes, arrows, crayons :))
* Decide on lazy engine
* Move the discussion on other elements on integration.

References:
[0] The scope of the prototype: 
https://etherpad.openstack.org/p/mistral-taskflow-prototype
[1] Prototype code and discussion https://github.com/enykeev/mistral/pull/1
[2] Techical summary 
http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html
[3] Email discussion on TaskFlow lazy eninge 
http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html
[4] IRC discussion Mistral/Taskflow http://paste.openstack.org/show/75389/
[5] Use cases https://github.com/dzimine/mistral-workflows/tree/add-usecases
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.orgmailto:OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

2014-04-14 Thread Joshua Harlow
Can we describe exactly what references, direct transition, expression 
evaluation are doing in #2.

Expression evaluation especially seems to be an odd one, what's wrong with 
pythons expression evaluation? I can't quite see why that would/should exist in 
taskflow.

I can see it being implemented in mistral, where mistral converts whatever DSL 
it wants into taskflow primitives and then taskflow runs the code; this 
decoupling ensures that taskflow does not force a DSL on people that want to 
use taskflow as a python library (this kind of restriction imho isn't 
acceptable for a library to do,  and limits taskflows own usage and 
integration).

Thanks,

Josh

From: Dmitri Zimine d...@stackstorm.commailto:d...@stackstorm.com
Reply-To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Date: Friday, April 11, 2014 at 9:55 AM
To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

We prototyped Mistral / TaskFlow integration and have a follow-up discussions.

SUMMARY: Mistral (Workflow Service) can embed TaskFlow as a workflow library, 
with some required modifications to function resliently as a service, and for 
smooth integration. However, the TaskFlow flow controls are insufficient for 
Mistral use cases.

Details discussed on other thirds.
The prototype scope - 
[0https://etherpad.openstack.org/p/mistral-taskflow-prototype]; code and 
discussion - [1https://github.com/enykeev/mistral/pull/1] and techical 
highlights - 
[2http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html].

DETAILS:

1) Embedding TaskFlow inside Mistral:
* Required: make the engine lazy 
[3http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html], 
[4http://paste.openstack.org/show/75389/].This is required to support 
long-running delegates and not loose tasks when engine manager process restarts.

* Persistence: need clarity how to replace or mix-in TaskFlow persistence with 
Mistral persistence. Renat is taking a look.

* Declaring Flows in YAML DSL: done for simplest flow. Need to prototype for 
data flow. Rich flow controls are missing in TaskFlow for a representative 
prototype.

* ActionRunners vs Taskflow Workers - not prototyped. Not a risk: both Mistral 
and TaskFlow implementations work. But we shall resolve the overlap.

* Ignored for now - unlikely any risks: Keystone integration, Mistral event 
scheduler, Mistral declarative services and action definition.

2) TaskFlow library features
* Must: flow control - conditional transitions, references, expression 
evaluation, to express real-life workflows 
[5https://github.com/dzimine/mistral-workflows/tree/add-usecases]. The 
required flow control primitives are 1) repeater 2) flow in flow 3) direct 
transition 4) conditional transition 5) multiple data. TaskFlow has 1) and 2), 
need to add 3/4/5.

* Other details and smaller requests are in the discussion 
[1https://github.com/enykeev/mistral/pull/1]

3) Next Steps proposed:
* Mistal team: summarize the requirements discussed and agreed on 
[2http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html] 
and 
[3http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html]
* Mistral team: code sample (tests?) on how Mistral would like to consume 
TaskFlow lazy engine
* Taskflow team: Provide a design for alternative TaskExecutor approach 
(prototypes, boxes, arrows, crayons :))
* Decide on lazy engine
* Move the discussion on other elements on integration.

References:
[0] The scope of the prototype: 
https://etherpad.openstack.org/p/mistral-taskflow-prototype
[1] Prototype code and discussion https://github.com/enykeev/mistral/pull/1
[2] Techical summary 
http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html
[3] Email discussion on TaskFlow lazy eninge 
http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html
[4] IRC discussion Mistral/Taskflow http://paste.openstack.org/show/75389/
[5] Use cases https://github.com/dzimine/mistral-workflows/tree/add-usecases
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

2014-04-14 Thread Kirill Izotov
They are all parts of conditional transitions: every task should have a number 
of possible transitions; each transition consist of a reference to the task we 
want to transit to and the condition that should evaluate to true for 
transition to start.  

At that point, I'd say that it perfectly fine for TaskFlow to evaluate python 
conditions rather than implementing YAQL, though there should be a place for us 
to pass the condition evaluation logic we are using.  

--  
Kirill Izotov


вторник, 15 апреля 2014 г. в 8:02, Joshua Harlow написал:

 Can we describe exactly what references, direct transition, expression 
 evaluation are doing in #2.
  
 Expression evaluation especially seems to be an odd one, what's wrong with 
 pythons expression evaluation? I can't quite see why that would/should exist 
 in taskflow.  
  
 I can see it being implemented in mistral, where mistral converts whatever 
 DSL it wants into taskflow primitives and then taskflow runs the code; this 
 decoupling ensures that taskflow does not force a DSL on people that want to 
 use taskflow as a python library (this kind of restriction imho isn't 
 acceptable for a library to do,  and limits taskflows own usage and 
 integration).  
  
 Thanks,  
  
 Josh  
  
 From: Dmitri Zimine d...@stackstorm.com (mailto:d...@stackstorm.com)
 Reply-To: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org (mailto:openstack-dev@lists.openstack.org)
 Date: Friday, April 11, 2014 at 9:55 AM
 To: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org (mailto:openstack-dev@lists.openstack.org)
 Subject: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary
  
  We prototyped Mistral / TaskFlow integration and have a follow-up 
  discussions.   
   
  SUMMARY: Mistral (Workflow Service) can embed TaskFlow as a workflow 
  library, with some required modifications to function resliently as a 
  service, and for smooth integration. However, the TaskFlow flow controls 
  are insufficient for Mistral use cases.   
   
  Details discussed on other thirds.   
  The prototype scope - [0 
  (https://etherpad.openstack.org/p/mistral-taskflow-prototype)]; code and 
  discussion - [1 (https://github.com/enykeev/mistral/pull/1)] and techical 
  highlights - [2 
  (http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html)].
   
  DETAILS:   
   
  1) Embedding TaskFlow inside Mistral:  
  * Required: make the engine lazy [3 
  (http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html)],
   [4 (http://paste.openstack.org/show/75389/)].This is required to support 
  long-running delegates and not loose tasks when engine manager process 
  restarts.
   
  * Persistence: need clarity how to replace or mix-in TaskFlow persistence 
  with Mistral persistence. Renat is taking a look.  
   
  * Declaring Flows in YAML DSL: done for simplest flow. Need to prototype 
  for data flow. Rich flow controls are missing in TaskFlow for a 
  representative prototype.  
   
  * ActionRunners vs Taskflow Workers - not prototyped. Not a risk: both 
  Mistral and TaskFlow implementations work. But we shall resolve the 
  overlap.   
   
  * Ignored for now - unlikely any risks: Keystone integration, Mistral event 
  scheduler, Mistral declarative services and action definition.  
   
  2) TaskFlow library features  
  * Must: flow control - conditional transitions, references, expression 
  evaluation, to express real-life workflows [5 
  (https://github.com/dzimine/mistral-workflows/tree/add-usecases)]. The 
  required flow control primitives are 1) repeater 2) flow in flow 3) direct 
  transition 4) conditional transition 5) multiple data. TaskFlow has 1) and 
  2), need to add 3/4/5.  
   
  * Other details and smaller requests are in the discussion [1 
  (https://github.com/enykeev/mistral/pull/1)]  
   
  3) Next Steps proposed:  
  * Mistal team: summarize the requirements discussed and agreed on [2 
  (http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html)]
   and [3 
  (http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html)]
  * Mistral team: code sample (tests?) on how Mistral would like to consume 
  TaskFlow lazy engine  
  * Taskflow team: Provide a design for alternative TaskExecutor approach 
  (prototypes, boxes, arrows, crayons :))  
  * Decide on lazy engine
  * Move the discussion on other elements on integration.
   
  References:  
  [0] The scope of the prototype: 
  https://etherpad.openstack.org/p/mistral-taskflow-prototype
  [1] Prototype code and discussion https://github.com/enykeev/mistral/pull/1
  [2] Techical summary 
  http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html
  [3] Email discussion on TaskFlow lazy eninge 
  http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html
  [4] IRC discussion Mistral/Taskflow http://paste.openstack.org/show/75389/
  [5

Re: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow integration summary

2014-04-14 Thread Kirill Izotov
Thank for pointing that out, Joshua.

I had a look on [1] and it seems to me that it might actually do the trick to 
some degree, though I'm afraid this is still not what we are looking for. While 
Mistral is asynchronous and event-driven, this particular design is not and 
would still force us to store the engine in memory and therefore limit our 
means of scalability. The lazy engine (or better controller) I have proposed is 
asynchronous at its core and would fit the needs for both of us (since it's 
much easier to make sync from async, rather than backwards).

Regarding the retries, while it might work with the current flow design, I 
doubt it would work with conditional transitions. The attempt to build a 
repeater by incapsulating the tasks into sub-flow will basically means that 
every transition they produce will be in that flow and you can't leave it until 
they are all finished. The whole idea of sub-flows within the scope of direct 
conditional transitions is a bit unclear to me (and probably us all) at the 
moment, though I'm trying to rely on them only as a means to lesser the 
complexity.

[1] https://review.openstack.org/#/c/86470  

--  
Kirill Izotov


пятница, 11 апреля 2014 г. в 23:47, Joshua Harlow написал:

 Thanks for the write-up krill.
  
 Also some adjustments,  
  
 Both points are good, and putting some of this on @ 
 https://etherpad.openstack.org/p/taskflow-mistral-details so that we can have 
 it actively noted (feel free to adjust it).  
  
 I think ivan is working on some docs/code/… for the lazy engine idea, so 
 hopefully we can get back soon with that. Lets see what comes out of that 
 effort and iterate on that.  
  
 For (2), our are mostly correct about unconditional execution although [1] 
 does now change this, and there are a few active reviews that are being 
 worked [3] on to fit this mistral use-case better. I believe [2] can help 
 move in this direction, ivans ideas I think will also push it a little 
 farther to. Of course lets work together to make sure they fit the best so 
 that taskflow  mistral  openstack can be the best it can be (pigeons not 
 included).  
  
 Can we also make sure the small issues are noted somewhere (maybe in the 
 above etherpad??). Thanks!  
  
 [1] https://wiki.openstack.org/wiki/TaskFlow#Retries  
 [2] https://review.openstack.org/#/c/86470
 [3] 
 https://review.openstack.org/#/q/status:open+project:openstack/taskflow,n,z  
  
 From: Kirill Izotov enyk...@stackstorm.com (mailto:enyk...@stackstorm.com)
 Reply-To: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org (mailto:openstack-dev@lists.openstack.org)
 Date: Thursday, April 10, 2014 at 9:20 PM
 To: OpenStack-dev@lists.openstack.org 
 (mailto:OpenStack-dev@lists.openstack.org) 
 OpenStack-dev@lists.openstack.org (mailto:OpenStack-dev@lists.openstack.org)
 Subject: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow integration 
 summary
  
  Hi everyone,  
   
  This is a summary to the prototype integration we did not too long ago: 
  http://github.com/enykeev/mistral/pull/1. Hope it would shed some light on 
  the aspects of the integration we are struggling with.  
   
  There is a possibility to build Mistral on top of TaskFlow as a library, 
  but in order to meet the requirements dictated by Mistral users and use 
  cases, both Mistral and TaskFlow should change.  
   
  There are two main sides of the story. One is engine. The other is flow 
  control capabilities.   
   
  1) THE ENGINE   
  The current TaskFlow implementation of engine doesn't fit Mistral needs 
  because it is synchronous, it blocks the thread, it requires us to store 
  the reference to the particular engine to be able to get its status and 
  suspend the execution and it lacks long-running task compatibility. To fix 
  this problem in a solid and maintainable way, we need to split the engine 
  into its synchronous and asynchronous counterparts.
   
  Lazy engine should be async and atomic, it should not have its own state, 
  instead it should rely on some kind of global state (db or in-memory, 
  depending on a type of application). It should have at least two methods: 
  run and task_complete. Run method should calculate the first batch of tasks 
  and schedule them for executing (either put them in queue or spawn the 
  threads). Task_complete should mark a certain task to be completed and then 
  schedule the next batch of tasks that became available due to resolution of 
  this one.  
   
  The desired use of lazy engine in Mistral is illustrated here: 
  https://wiki.openstack.org/wiki/Mistral/Blueprints/ActionsDesign#Big_Picture.
   It should support long running tasks and survive engine process restart 
  without loosing the state of the running actions. So it must be passive 
  (lazy) and persistent.   
   
  On Mistral side we are using Lazy engine by patching async.run directly to 
  the API (or engine queue) and async.task_complete

Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

2014-04-14 Thread Joshua Harlow
Thanks, that helps explain those.

Let's see where the conditional evaluation logic goes. Likely it won't be 
python conditions directly.

I think though we should be able to work with other condition logic. I started 
https://review.openstack.org/#/c/87417/ today, hopefully can flush it out more 
in the days to come.

The differences I can see so far are around how a taskflow engine activates 
this conditional (and what results when the switch chooses a path). In taskflow 
the whole workflow is analyzed before execution (and translated into a directed 
graph) as to what is provided and what is required by each task in the 
workflow. Conditionals change this since its not known ahead of time which path 
will be selected. For now (in the above review) I am making it so that each 
path that could be switched to will have to have the same requirements and the 
same outputs (so that the analysis logic still works correctly). I'm thinking 
that a switch 'task' will return which choice it made, then this will affect 
the further path that will be followed (basically all other path choices will 
be 'abandoned'). This fits pretty well I think into how typically this is done 
in dataflow-like way and won't affect the state-transitions or ability to 
resume and such (btw found some neat papers at [1],[2] that show some past 
history that I didn't know about).

Of course I'm trying to make the above not be its own micro-language as much as 
possible (a switch object starts to act like one, sadly).

Comments welcome. Code welcome even more :-P

[1] http://www.cs.cmu.edu/~aldrich/papers/onward2009-concurrency.pdf
[2] 
http://www.cs.ucf.edu/~dcm/Teaching/COT4810-Spring2011/Literature/DataFlowProgrammingLanguages.pdf

From: Kirill Izotov enyk...@stackstorm.commailto:enyk...@stackstorm.com
Reply-To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Date: Monday, April 14, 2014 at 8:31 PM
To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

They are all parts of conditional transitions: every task should have a number 
of possible transitions; each transition consist of a reference to the task we 
want to transit to and the condition that should evaluate to true for 
transition to start.

At that point, I'd say that it perfectly fine for TaskFlow to evaluate python 
conditions rather than implementing YAQL, though there should be a place for us 
to pass the condition evaluation logic we are using.

--
Kirill Izotov


вторник, 15 апреля 2014 г. в 8:02, Joshua Harlow написал:

Can we describe exactly what references, direct transition, expression 
evaluation are doing in #2.

Expression evaluation especially seems to be an odd one, what's wrong with 
pythons expression evaluation? I can't quite see why that would/should exist in 
taskflow.

I can see it being implemented in mistral, where mistral converts whatever DSL 
it wants into taskflow primitives and then taskflow runs the code; this 
decoupling ensures that taskflow does not force a DSL on people that want to 
use taskflow as a python library (this kind of restriction imho isn't 
acceptable for a library to do,  and limits taskflows own usage and 
integration).

Thanks,

Josh

From: Dmitri Zimine d...@stackstorm.commailto:d...@stackstorm.com
Reply-To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Date: Friday, April 11, 2014 at 9:55 AM
To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

We prototyped Mistral / TaskFlow integration and have a follow-up discussions.

SUMMARY: Mistral (Workflow Service) can embed TaskFlow as a workflow library, 
with some required modifications to function resliently as a service, and for 
smooth integration. However, the TaskFlow flow controls are insufficient for 
Mistral use cases.

Details discussed on other thirds.
The prototype scope - 
[0https://etherpad.openstack.org/p/mistral-taskflow-prototype]; code and 
discussion - [1https://github.com/enykeev/mistral/pull/1] and techical 
highlights - 
[2http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html].

DETAILS:

1) Embedding TaskFlow inside Mistral:
* Required: make the engine lazy 
[3http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html], 
[4http://paste.openstack.org/show/75389/].This is required to support 
long-running delegates and not loose tasks when engine manager process restarts.

* Persistence: need clarity how to replace or mix-in TaskFlow persistence with 
Mistral persistence. Renat is taking a look.

* Declaring Flows in YAML DSL: done

Re: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow integration summary

2014-04-14 Thread Joshua Harlow
Sure, its not the fully complete lazy_engine, but piece by piece we can get 
there.

Of course code/contributions are welcome, as such things will benefit more than 
just mistral, but openstack as a whole :-)

-Josh

From: Kirill Izotov enyk...@stackstorm.commailto:enyk...@stackstorm.com
Date: Monday, April 14, 2014 at 9:02 PM
To: Joshua Harlow harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com
Cc: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow integration 
summary

Thank for pointing that out, Joshua.

I had a look on [1] and it seems to me that it might actually do the trick to 
some degree, though I'm afraid this is still not what we are looking for. While 
Mistral is asynchronous and event-driven, this particular design is not and 
would still force us to store the engine in memory and therefore limit our 
means of scalability. The lazy engine (or better controller) I have proposed is 
asynchronous at its core and would fit the needs for both of us (since it's 
much easier to make sync from async, rather than backwards).

Regarding the retries, while it might work with the current flow design, I 
doubt it would work with conditional transitions. The attempt to build a 
repeater by incapsulating the tasks into sub-flow will basically means that 
every transition they produce will be in that flow and you can't leave it until 
they are all finished. The whole idea of sub-flows within the scope of direct 
conditional transitions is a bit unclear to me (and probably us all) at the 
moment, though I'm trying to rely on them only as a means to lesser the 
complexity.

[1] https://review.openstack.org/#/c/86470

--
Kirill Izotov


пятница, 11 апреля 2014 г. в 23:47, Joshua Harlow написал:

Thanks for the write-up krill.

Also some adjustments,

Both points are good, and putting some of this on @ 
https://etherpad.openstack.org/p/taskflow-mistral-details so that we can have 
it actively noted (feel free to adjust it).

I think ivan is working on some docs/code/… for the lazy engine idea, so 
hopefully we can get back soon with that. Lets see what comes out of that 
effort and iterate on that.

For (2), our are mostly correct about unconditional execution although [1] does 
now change this, and there are a few active reviews that are being worked [3] 
on to fit this mistral use-case better. I believe [2] can help move in this 
direction, ivans ideas I think will also push it a little farther to. Of course 
lets work together to make sure they fit the best so that taskflow  mistral  
openstack can be the best it can be (pigeons not included).

Can we also make sure the small issues are noted somewhere (maybe in the above 
etherpad??). Thanks!

[1] https://wiki.openstack.org/wiki/TaskFlow#Retries
[2] https://review.openstack.org/#/c/86470
[3] https://review.openstack.org/#/q/status:open+project:openstack/taskflow,n,z

From: Kirill Izotov enyk...@stackstorm.commailto:enyk...@stackstorm.com
Reply-To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Date: Thursday, April 10, 2014 at 9:20 PM
To: 
OpenStack-dev@lists.openstack.orgmailto:OpenStack-dev@lists.openstack.org 
OpenStack-dev@lists.openstack.orgmailto:OpenStack-dev@lists.openstack.org
Subject: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow integration 
summary

Hi everyone,

This is a summary to the prototype integration we did not too long ago: 
http://github.com/enykeev/mistral/pull/1. Hope it would shed some light on the 
aspects of the integration we are struggling with.

There is a possibility to build Mistral on top of TaskFlow as a library, but in 
order to meet the requirements dictated by Mistral users and use cases, both 
Mistral and TaskFlow should change.

There are two main sides of the story. One is engine. The other is flow control 
capabilities.

1) THE ENGINE
The current TaskFlow implementation of engine doesn't fit Mistral needs because 
it is synchronous, it blocks the thread, it requires us to store the reference 
to the particular engine to be able to get its status and suspend the execution 
and it lacks long-running task compatibility. To fix this problem in a solid 
and maintainable way, we need to split the engine into its synchronous and 
asynchronous counterparts.

Lazy engine should be async and atomic, it should not have its own state, 
instead it should rely on some kind of global state (db or in-memory, depending 
on a type of application). It should have at least two methods: run and 
task_complete. Run method should calculate the first batch of tasks and 
schedule them for executing (either put them in queue or spawn the threads). 
Task_complete should mark a certain task to be completed and then schedule the 
next batch of tasks that became available due to resolution of this one

Re: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow integration summary

2014-04-11 Thread Joshua Harlow
Thanks for the write-up krill.

Also some adjustments,

Both points are good, and putting some of this on @ 
https://etherpad.openstack.org/p/taskflow-mistral-details so that we can have 
it actively noted (feel free to adjust it).

I think ivan is working on some docs/code/… for the lazy engine idea, so 
hopefully we can get back soon with that. Lets see what comes out of that 
effort and iterate on that.

For (2), our are mostly correct about unconditional execution although [1] does 
now change this, and there are a few active reviews that are being worked [3] 
on to fit this mistral use-case better. I believe [2] can help move in this 
direction, ivans ideas I think will also push it a little farther to. Of course 
lets work together to make sure they fit the best so that taskflow  mistral  
openstack can be the best it can be (pigeons not included).

Can we also make sure the small issues are noted somewhere (maybe in the above 
etherpad??). Thanks!

[1] https://wiki.openstack.org/wiki/TaskFlow#Retries
[2] https://review.openstack.org/#/c/86470
[3] https://review.openstack.org/#/q/status:open+project:openstack/taskflow,n,z

From: Kirill Izotov enyk...@stackstorm.commailto:enyk...@stackstorm.com
Reply-To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Date: Thursday, April 10, 2014 at 9:20 PM
To: 
OpenStack-dev@lists.openstack.orgmailto:OpenStack-dev@lists.openstack.org 
OpenStack-dev@lists.openstack.orgmailto:OpenStack-dev@lists.openstack.org
Subject: [openstack-dev] [mistral] [taskflow] Mistral TaskFlow integration 
summary

Hi everyone,

This is a summary to the prototype integration we did not too long ago: 
http://github.com/enykeev/mistral/pull/1. Hope it would shed some light on the 
aspects of the integration we are struggling with.

There is a possibility to build Mistral on top of TaskFlow as a library, but in 
order to meet the requirements dictated by Mistral users and use cases, both 
Mistral and TaskFlow should change.

There are two main sides of the story. One is engine. The other is flow control 
capabilities.

1) THE ENGINE
The current TaskFlow implementation of engine doesn't fit Mistral needs because 
it is synchronous, it blocks the thread, it requires us to store the reference 
to the particular engine to be able to get its status and suspend the execution 
and it lacks long-running task compatibility. To fix this problem in a solid 
and maintainable way, we need to split the engine into its synchronous and 
asynchronous counterparts.

Lazy engine should be async and atomic, it should not have its own state, 
instead it should rely on some kind of global state (db or in-memory, depending 
on a type of application). It should have at least two methods: run and 
task_complete. Run method should calculate the first batch of tasks and 
schedule them for executing (either put them in queue or spawn the threads). 
Task_complete should mark a certain task to be completed and then schedule the 
next batch of tasks that became available due to resolution of this one.

The desired use of lazy engine in Mistral is illustrated here: 
https://wiki.openstack.org/wiki/Mistral/Blueprints/ActionsDesign#Big_Picture. 
It should support long running tasks and survive engine process restart without 
loosing the state of the running actions. So it must be passive (lazy) and 
persistent.

On Mistral side we are using Lazy engine by patching async.run directly to the 
API (or engine queue) and async.task_complete to the worker queue result 
channel (and the API for long running tasks). We are still sharing the same 
graph_analyzer, but instead of relying on loop and Futures, we are handling the 
execution ourselves in a scalable and robust way.

Then, on top of it you can build a sync engine by introducing Futures. You are 
using async.run() to schedule tasks by transforming them to Futures and then 
starting a loop, checking Futures for completion and sending their results to 
async.task_complete() which would produce even more Futures to check over. Just 
the same way TaskFlow do it right now.

The reason I'm proposing to extract Futures from async engine is because they 
won't work if we have multiple engine processes that should handle the task 
results concurrently (and without that there will be no scalability).

2) THE FLOW CONTROL CAPABILITIES

Since we treat TaskFlow as a library we expect them to provide us with a number 
of primitives to build our workflow with them. Most important of them to us for 
the moment are Direct Transitions, and Conditional Transitions.

The current implementation of flow transitions in TaskFlow are built on top of 
data flow dependencies where each task provides some data to the flow and 
requires some data to be present prior being executed. In other words, you are 
starting to build your flow tree from the last task through the first one by 
adding their requirements

[openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

2014-04-11 Thread Dmitri Zimine
We prototyped Mistral / TaskFlow integration and have a follow-up discussions. 

SUMMARY: Mistral (Workflow Service) can embed TaskFlow as a workflow library, 
with some required modifications to function resliently as a service, and for 
smooth integration. However, the TaskFlow flow controls are insufficient for 
Mistral use cases. 

Details discussed on other thirds. 
The prototype scope - [0]; code and discussion - [1] and techical highlights - 
[2].

DETAILS: 

1) Embedding TaskFlow inside Mistral:
* Required: make the engine lazy [3], [4].This is required to support 
long-running delegates and not loose tasks when engine manager process restarts.

* Persistence: need clarity how to replace or mix-in TaskFlow persistence with 
Mistral persistence. Renat is taking a look.

* Declaring Flows in YAML DSL: done for simplest flow. Need to prototype for 
data flow. Rich flow controls are missing in TaskFlow for a representative 
prototype.

* ActionRunners vs Taskflow Workers - not prototyped. Not a risk: both Mistral 
and TaskFlow implementations work. But we shall resolve the overlap. 

* Ignored for now - unlikely any risks: Keystone integration, Mistral event 
scheduler, Mistral declarative services and action definition.

2) TaskFlow library features
* Must: flow control - conditional transitions, references, expression 
evaluation, to express real-life workflows [5]. The required flow control 
primitives are 1) repeater 2) flow in flow 3) direct transition 4) conditional 
transition 5) multiple data. TaskFlow has 1) and 2), need to add 3/4/5. 

* Other details and smaller requests are in the discussion [1]

3) Next Steps proposed:
* Mistal team: summarize the requirements discussed and agreed on [2] and [3]
* Mistral team: code sample (tests?) on how Mistral would like to consume 
TaskFlow lazy engine 
* Taskflow team: Provide a design for alternative TaskExecutor approach 
(prototypes, boxes, arrows, crayons :)) 
* Decide on lazy engine
* Move the discussion on other elements on integration.

References:
[0] The scope of the prototype: 
https://etherpad.openstack.org/p/mistral-taskflow-prototype
[1] Prototype code and discussion https://github.com/enykeev/mistral/pull/1
[2] Techical summary 
http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html
[3] Email discussion on TaskFlow lazy eninge 
http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html
[4] IRC discussion Mistral/Taskflow http://paste.openstack.org/show/75389/
[5] Use cases https://github.com/dzimine/mistral-workflows/tree/add-usecases___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

2014-04-11 Thread Joshua Harlow
I'm confused, why is this 2 emails??

http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html

Seems better to just have 1 chain, not 2.

From: Dmitri Zimine d...@stackstorm.commailto:d...@stackstorm.com
Reply-To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Date: Friday, April 11, 2014 at 9:55 AM
To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: [openstack-dev] [Mistral][TaskFlow] Mistral-TaskFlow Summary

We prototyped Mistral / TaskFlow integration and have a follow-up discussions.

SUMMARY: Mistral (Workflow Service) can embed TaskFlow as a workflow library, 
with some required modifications to function resliently as a service, and for 
smooth integration. However, the TaskFlow flow controls are insufficient for 
Mistral use cases.

Details discussed on other thirds.
The prototype scope - 
[0https://etherpad.openstack.org/p/mistral-taskflow-prototype]; code and 
discussion - [1https://github.com/enykeev/mistral/pull/1] and techical 
highlights - 
[2http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html].

DETAILS:

1) Embedding TaskFlow inside Mistral:
* Required: make the engine lazy 
[3http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html], 
[4http://paste.openstack.org/show/75389/].This is required to support 
long-running delegates and not loose tasks when engine manager process restarts.

* Persistence: need clarity how to replace or mix-in TaskFlow persistence with 
Mistral persistence. Renat is taking a look.

* Declaring Flows in YAML DSL: done for simplest flow. Need to prototype for 
data flow. Rich flow controls are missing in TaskFlow for a representative 
prototype.

* ActionRunners vs Taskflow Workers - not prototyped. Not a risk: both Mistral 
and TaskFlow implementations work. But we shall resolve the overlap.

* Ignored for now - unlikely any risks: Keystone integration, Mistral event 
scheduler, Mistral declarative services and action definition.

2) TaskFlow library features
* Must: flow control - conditional transitions, references, expression 
evaluation, to express real-life workflows 
[5https://github.com/dzimine/mistral-workflows/tree/add-usecases]. The 
required flow control primitives are 1) repeater 2) flow in flow 3) direct 
transition 4) conditional transition 5) multiple data. TaskFlow has 1) and 2), 
need to add 3/4/5.

* Other details and smaller requests are in the discussion 
[1https://github.com/enykeev/mistral/pull/1]

3) Next Steps proposed:
* Mistal team: summarize the requirements discussed and agreed on 
[2http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html] 
and 
[3http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html]
* Mistral team: code sample (tests?) on how Mistral would like to consume 
TaskFlow lazy engine
* Taskflow team: Provide a design for alternative TaskExecutor approach 
(prototypes, boxes, arrows, crayons :))
* Decide on lazy engine
* Move the discussion on other elements on integration.

References:
[0] The scope of the prototype: 
https://etherpad.openstack.org/p/mistral-taskflow-prototype
[1] Prototype code and discussion https://github.com/enykeev/mistral/pull/1
[2] Techical summary 
http://lists.openstack.org/pipermail/openstack-dev/2014-April/032461.html
[3] Email discussion on TaskFlow lazy eninge 
http://lists.openstack.org/pipermail/openstack-dev/2014-March/031134.html
[4] IRC discussion Mistral/Taskflow http://paste.openstack.org/show/75389/
[5] Use cases https://github.com/dzimine/mistral-workflows/tree/add-usecases
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Formalizing mistral task policy.

2014-04-10 Thread Manas Kelshikar
Hi everyone,

Some offline conversations and thoughts yielded a notion of providing a
formal policy/transition backing to on-error, on-success and on-finish. I
have a few thoughts in and etherpad (see
https://etherpad.openstack.org/p/mistral_task_policy).

The headliner : on-error, on-success and on-finish should be more complex
than defining what task to call next.

Look forward to the comments.

Thanks,
Manas
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] [taskflow] Mistral TaskFlow integration summary

2014-04-10 Thread Kirill Izotov
Hi everyone,

This is a summary to the prototype integration we did not too long ago: 
http://github.com/enykeev/mistral/pull/1. Hope it would shed some light on the 
aspects of the integration we are struggling with.

There is a possibility to build Mistral on top of TaskFlow as a library, but in 
order to meet the requirements dictated by Mistral users and use cases, both 
Mistral and TaskFlow should change.

There are two main sides of the story. One is engine. The other is flow control 
capabilities. 

1) THE ENGINE 
The current TaskFlow implementation of engine doesn't fit Mistral needs because 
it is synchronous, it blocks the thread, it requires us to store the reference 
to the particular engine to be able to get its status and suspend the execution 
and it lacks long-running task compatibility. To fix this problem in a solid 
and maintainable way, we need to split the engine into its synchronous and 
asynchronous counterparts.

Lazy engine should be async and atomic, it should not have its own state, 
instead it should rely on some kind of global state (db or in-memory, depending 
on a type of application). It should have at least two methods: run and 
task_complete. Run method should calculate the first batch of tasks and 
schedule them for executing (either put them in queue or spawn the threads). 
Task_complete should mark a certain task to be completed and then schedule the 
next batch of tasks that became available due to resolution of this one.

The desired use of lazy engine in Mistral is illustrated here: 
https://wiki.openstack.org/wiki/Mistral/Blueprints/ActionsDesign#Big_Picture. 
It should support long running tasks and survive engine process restart without 
loosing the state of the running actions. So it must be passive (lazy) and 
persistent. 

On Mistral side we are using Lazy engine by patching async.run directly to the 
API (or engine queue) and async.task_complete to the worker queue result 
channel (and the API for long running tasks). We are still sharing the same 
graph_analyzer, but instead of relying on loop and Futures, we are handling the 
execution ourselves in a scalable and robust way.

Then, on top of it you can build a sync engine by introducing Futures. You are 
using async.run() to schedule tasks by transforming them to Futures and then 
starting a loop, checking Futures for completion and sending their results to 
async.task_complete() which would produce even more Futures to check over. Just 
the same way TaskFlow do it right now.

The reason I'm proposing to extract Futures from async engine is because they 
won't work if we have multiple engine processes that should handle the task 
results concurrently (and without that there will be no scalability).

2) THE FLOW CONTROL CAPABILITIES

Since we treat TaskFlow as a library we expect them to provide us with a number 
of primitives to build our workflow with them. Most important of them to us for 
the moment are Direct Transitions, and Conditional Transitions. 

The current implementation of flow transitions in TaskFlow are built on top of 
data flow dependencies where each task provides some data to the flow and 
requires some data to be present prior being executed. In other words, you are 
starting to build your flow tree from the last task through the first one by 
adding their requirements to the tree. All the tasks of successfully finished 
flow should be successfully finished too. If one of the tasks finishes with 
error, the whole flow will be reverted back to its initial state 
unconditionally.

At the same time, Mistral use cases require direct control on the order of the 
task execution, with top-to-bottom scheme where the next task will be 
determined based on the results of the execution of the current one. This way 
to successfully finish a flow you don't have to execute all tasks in it. 
Besides, the error in execution of a particular task may cause execution of 
another one. The workflow examples (in pseudo DSL) are here: 
https://github.com/dzimine/mistral-workflows/tree/add-usecases

There is also a handful of small issues, but these two differences cover most 
basic parts of TaskFlow thus block us from integration and require substantial 
changes in TaskFlow engine design. Inability to make such changes will directly 
result in Mistral not being able to meet its requirements and thus rendering 
the whole project useless for its users.

-- 
Kirill Izotov

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Community meeting reminder - 04/07/2014

2014-04-07 Thread Renat Akhmerov
Hi,

This is a reminder that we have another community meeting today at 
#openstack-meeting at 16.00 UTC.

Agenda:
Review action items
Current status (quickly by team members)
POC demo scenario readiness and ways to improve it
TaskFlow integration status
Open discussion

It can also be found at https://wiki.openstack.org/wiki/Meetings/MistralAgenda 
as well as the links to the previous meeting minutes and logs.

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] Community meeting minutes - 04/07/2014

2014-04-07 Thread Renat Akhmerov
Thanks for joining today’s meeting!

As usually,

Minutes: 
http://eavesdrop.openstack.org/meetings/mistral/2014/mistral.2014-04-07-16.00.html
Full log: 
http://eavesdrop.openstack.org/meetings/mistral/2014/mistral.2014-04-07-16.00.log.html

Let’s meet next time on April 14th.

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] How Mistral handling long running delegate tasks

2014-04-04 Thread Renat Akhmerov

On 04 Apr 2014, at 07:33, Kirill Izotov enyk...@stackstorm.com wrote:

 Then, we can make task executor interface public and allow clients to
 provide their own task executors. It will be possible then for Mistral
 to implement its own task executor, or several, and share the
 executors between all the engine instances.
 I'm afraid that if we start to tear apart the TaskFlow engine, it would 
 quickly become a mess to support. Besides, the amount of things left to 
 integrate after we throw out engine might be so low it proof the whole 
 process of integration to be just nominal and we are back to square one. Any 
 way, task execution is the part that least bothers me, both graph action and 
 the engine itself is where the pain will be.

Would love to see something additional (boxedarrows) explaining this approach. 
Sorry, I’m hardly following the idea.

 That is part of our public API, it is stable and good enough. Basically,
 I don't think this API needs any major change.
 
 But whatever should and will be done about it, I daresay all that work
 can be done without affecting API more then I described above.
 
 I completely agree that we should not change the public API of the sync 
 engine, especially the one in helpers. What we need is, on the contrary, a 
 low level construct that would do the number of things i stated previously, 
 but will be a part of public API of TaskFlow so we can be sure it would work 
 exactly the same way it worked yesterday.

I’m 99.9% sure we’ll have to change API because all we’ve been discussing 
so far made me think this is a key point going implicitly through all our 
discussions: without have a public method like “task_done” we won’t build truly 
passive/async execution model. And it doesn’t matter wether it uses futures, 
callbacks or whatever else inside.

And again, just want to repeat. If we will be able to deal with all the 
challenges that passive/async execution model exposes then other models can be 
built trivially on top of it.

@Ivan,

Thanks for joining the conversation. Looks like we really need your active 
participation for you’re the one who knows all the TF internals and concepts 
very well. As for what you wrote about futures and callbacks, it would be 
helpful to see some illustration of your idea.

Renat Akhmerov
@ Mirantis Inc.___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Next crack at real workflows

2014-04-04 Thread Renat Akhmerov
Dmitri, nice work, will research them carefully early next week. I would ask 
other folks to do the same (especially Nikolay).

Renat Akhmerov
@ Mirantis Inc.

On 03 Apr 2014, at 06:22, Dmitri Zimine d...@stackstorm.com wrote:

 Two more workflows drafted - cloud cron, and lifecycle, version 1. 
 
 The mindset questions are: 
 1) is DSL syntax expressive, and capable and convenient to handle real use 
 cases?
 2) most importantly: what are the implied workflow capabilities which make it 
 all work? 
  
 * Take a look here: 
 https://github.com/dzimine/mistral-workflows/tree/add-usecases
 
 * Leave your comments - generally, or  line-by-line, in the pull request  
 https://github.com/dzimine/mistral-workflows/pull/1/files
 
 * Fork, do your own modifications and do another pull request. 
 
 * Or just reply with your comments  in email (lazy option :)) 
 
 NOTE: please keep this thread for specific comments on DSL and workflow 
 capabilities, create another thread if changing topic. Thanks! 
 
 DZ 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] How Mistral handling long running delegate tasks

2014-04-03 Thread Renat Akhmerov

On 03 Apr 2014, at 12:49, Kirill Izotov enyk...@stackstorm.com wrote:

 Actually, the idea to make the concept more expandable is exactly my point =) 
 Mistral's Workbook is roughly the same as TaskFlow Flow and have nothing to 
 do with TaskFlow LogBook. The only major difference in case of Workbook is 
 that we have to store it after it was created using API or DSL. I very much 
 like the idea to inherit form basic Flow and add serialization and additional 
 metadata on top of it, but the concept of retrying within a Workbook\Flow is 
 not exactly what we have in mind. Instead of repeating the Flow, we are 
 repeating the Task (which has the same differences between Mistral and 
 TaskFlow as Workbook has) and to use the trick you have proposed we would 
 have to translate the Task into a Flow. How much sense does it make in 
 respect to expandability and generality?

Just one clarification. Workbook is a wider abstraction. Along with workflow 
itself it includes action definitions, triggers (even though it’s still 
controversial even within the team itself). Potentially it may include 
something else. So having a workbook in TaskFlow with strictly defined 
behaviour is not a good decision.

 Ya, I think u are hitting this issue, if a worker acks a message saying its 
 'working on it' then the worker dies, this is where a message queue ack 
 model won't really help in solving, the engine will believe that the worker 
 is working on it (since hey the worker acked it) but the engine will really 
 have no idea that the worker is actually dead. Of course timeouts can be 
 used to get around this but imho that’s really un-elegant when something 
 like zookeeper (or similar) can be used to be notified of this worker death 
 immediately; which means no timeouts are needed at all, and this separate 
 process or engine can be notified of this death (and resolve it 
 immediately). I don't believe this kind of 'liveness' connection is possible 
 with rabbit (we also must think of other things besides rabbit, like qpid 
 and such) but I might be wrong, I thought once a worker acks a message then 
 whoever receives that ack will believe the work has started and will be 
 finished someday in the future (aka, no connection that the work is actually 
 in progress). Anyways, we can discuss this more since I think its a common 
 confusion point :-)
 As far as i understand, what Renat is proposing here is not to acknowledge 
 the message until it was successfully executed. I'm not sure how exactly 
 RabbitMQ will react in that case, though you are right in the idea that we 
 must investigate the other solutions more carefully.

Joshua, I think your understanding of how it works is not exactly correct (or 
my understanding actually :)). Let’s talk in IRC, we’ll explain it.

I’d suggest we talk in IRC on Thursday at 8.30 pm (Friday 10.30 in our 
timezone).

Renat Akhmerov
@ Mirantis Inc.

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral][Taskflow] meet on IRC to talk over TaskFlow/Mistral integration

2014-04-03 Thread Dmitri Zimine
IRC to discuss http://tinyurl.com/k3s2gmy

Joshua, 2000 UTC doesn't quite work for Renat and Kirill (3 am their time). 

The overlap is: 
PST (UTC-7) UTC NOVT (UTC+7)

04pm (16:00)11pm (23:00)6am (06:00)
10pm (22:00)05am (05:00)12pm (12:00)

Kirill's pref is 3am UTC, early is ok, if needed. 
@Joshua can you do 3 am UTC (8 pm local?)
@Renat? 

Can we pencil 3:00 UTC on #openstack-mistral and adjust for Renat if needed?

DZ 


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] How Mistral handling long running delegate tasks

2014-04-03 Thread Ivan Melnikov

I'm trying to catch up this rather long and interesting discussion,
sorry for somewhat late reply.

I can see aspects of 'lazy model' support in TaskFlow:
- how tasks are executed and reverted
- how flows are run
- how engine works internally

Let me address those aspects separately.

== Executing and reverting tasks ==

I think that should be done via different interface then running a flow
(or scheduling it to run), as it is completely different thing. In
current TaskFlow this interface is called task executor:
https://github.com/openstack/taskflow/blob/master/taskflow/engines/action_engine/executor.py#L57

That is actually how our WorkerBasedEngine was implemented: it's the
same engine with special task executor that schedules tasks on worker
instead of running task code locally.

Task executors are not aware of flows by design, all they do is
executing and reverting tasks. That means that task executors can be
easily shared between engines if that's wanted.

Current TaskExecutorBase interface uses futures (PEP 3148-like). When I
proposed it, futures looked like good tool for the task at hand (see
e.g. async task etherpad
https://etherpad.openstack.org/p/async-taskflow-tasks)

Now it may be time to reconsider that: having one future object per
running task may become a scalability issue. It may be worth to use
callbacks instead. It should not be too hard to refactor current engine
for that. Also, as TaskExecutorBase is an internal API, there should not
be any compatibility issues.

Then, we can make task executor interface public and allow clients to
provide their own task executors. It will be possible then for Mistral
to implement its own task executor, or several, and share the
executors between all the engine instances.

You can call it a plan;)

== Running flows ==

To run the flow TaskFlow client uses engine interface; also, there are
few of helper functions provided for convenience:

http://docs.openstack.org/developer/taskflow/engines.html#module-taskflow.engines.base
http://docs.openstack.org/developer/taskflow/engines.html#creating-engines

That is part of our public API, it is stable and good enough. Basically,
I don't think this API needs any major change.

Maybe it worth to add function or method to schedule running flow
without actually waiting for flow completion (at least, it was on my top
secret TODO list for quite a long time).

== Engine internals ==

Each engine eats resources, like thread it runs on; using these
resources to run one flow only is somewhat wasteful. Some work is
already planned to address this situation (see e.g.
https://blueprints.launchpad.net/taskflow/+spec/share-engine-thread).
Also, it might be good idea to implement different 'type' of engine to
support 'lazy' model, as Joshua suggests.

But whatever should and will be done about it, I daresay all that work
can be done without affecting API more then I described above.

-- 
WBR,
Ivan A. Melnikov

... tasks must flow ...


On 02.04.2014 01:51, Dmitri Zimine wrote:
 Even more responses inline :)
[...]

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] How Mistral handling long running delegate tasks

2014-04-03 Thread Joshua Harlow
Thank Ivan,

This does seem like a possible way forward also.

I'd be interesting to see what/how callbacks would work vs. futures and
what extension point we could provide to mistral for task execution (maybe
there task executor would complete by doing a call to some service, not
amqp for example?).

Maybe some example/POC code would help all :-)

-Josh

-Original Message-
From: Ivan Melnikov imelni...@griddynamics.com
Date: Thursday, April 3, 2014 at 12:04 PM
To: OpenStack Development Mailing List (not for usage questions)
openstack-dev@lists.openstack.org, Joshua Harlow harlo...@yahoo-inc.com
Subject: Re: [openstack-dev] [Mistral] How Mistral handling long running
delegate tasks


I'm trying to catch up this rather long and interesting discussion,
sorry for somewhat late reply.

I can see aspects of 'lazy model' support in TaskFlow:
- how tasks are executed and reverted
- how flows are run
- how engine works internally

Let me address those aspects separately.

== Executing and reverting tasks ==

I think that should be done via different interface then running a flow
(or scheduling it to run), as it is completely different thing. In
current TaskFlow this interface is called task executor:
https://github.com/openstack/taskflow/blob/master/taskflow/engines/action_
engine/executor.py#L57

That is actually how our WorkerBasedEngine was implemented: it's the
same engine with special task executor that schedules tasks on worker
instead of running task code locally.

Task executors are not aware of flows by design, all they do is
executing and reverting tasks. That means that task executors can be
easily shared between engines if that's wanted.

Current TaskExecutorBase interface uses futures (PEP 3148-like). When I
proposed it, futures looked like good tool for the task at hand (see
e.g. async task etherpad
https://etherpad.openstack.org/p/async-taskflow-tasks)

Now it may be time to reconsider that: having one future object per
running task may become a scalability issue. It may be worth to use
callbacks instead. It should not be too hard to refactor current engine
for that. Also, as TaskExecutorBase is an internal API, there should not
be any compatibility issues.

Then, we can make task executor interface public and allow clients to
provide their own task executors. It will be possible then for Mistral
to implement its own task executor, or several, and share the
executors between all the engine instances.

You can call it a plan;)

== Running flows ==

To run the flow TaskFlow client uses engine interface; also, there are
few of helper functions provided for convenience:

http://docs.openstack.org/developer/taskflow/engines.html#module-taskflow.
engines.base
http://docs.openstack.org/developer/taskflow/engines.html#creating-engines

That is part of our public API, it is stable and good enough. Basically,
I don't think this API needs any major change.

Maybe it worth to add function or method to schedule running flow
without actually waiting for flow completion (at least, it was on my top
secret TODO list for quite a long time).

== Engine internals ==

Each engine eats resources, like thread it runs on; using these
resources to run one flow only is somewhat wasteful. Some work is
already planned to address this situation (see e.g.
https://blueprints.launchpad.net/taskflow/+spec/share-engine-thread).
Also, it might be good idea to implement different 'type' of engine to
support 'lazy' model, as Joshua suggests.

But whatever should and will be done about it, I daresay all that work
can be done without affecting API more then I described above.

-- 
WBR,
Ivan A. Melnikov

... tasks must flow ...


On 02.04.2014 01:51, Dmitri Zimine wrote:
 Even more responses inline :)
[...]


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] How Mistral handling long running delegate tasks

2014-04-03 Thread Kirill Izotov
 Then, we can make task executor interface public and allow clients to
 provide their own task executors. It will be possible then for Mistral
 to implement its own task executor, or several, and share the
 executors between all the engine instances.

I'm afraid that if we start to tear apart the TaskFlow engine, it would quickly 
become a mess to support. Besides, the amount of things left to integrate after 
we throw out engine might be so low it proof the whole process of integration 
to be just nominal and we are back to square one. Any way, task execution is 
the part that least bothers me, both graph action and the engine itself is 
where the pain will be.

 That is part of our public API, it is stable and good enough. Basically,
 I don't think this API needs any major change.


 But whatever should and will be done about it, I daresay all that work
 can be done without affecting API more then I described above.



I completely agree that we should not change the public API of the sync engine, 
especially the one in helpers. What we need is, on the contrary, a low level 
construct that would do the number of things i stated previously, but will be a 
part of public API of TaskFlow so we can be sure it would work exactly the same 
way it worked yesterday.

--  
Kirill Izotov


пятница, 4 апреля 2014 г. в 2:04, Ivan Melnikov написал:

  
 I'm trying to catch up this rather long and interesting discussion,
 sorry for somewhat late reply.
  
 I can see aspects of 'lazy model' support in TaskFlow:
 - how tasks are executed and reverted
 - how flows are run
 - how engine works internally
  
 Let me address those aspects separately.
  
 == Executing and reverting tasks ==
  
 I think that should be done via different interface then running a flow
 (or scheduling it to run), as it is completely different thing. In
 current TaskFlow this interface is called task executor:
 https://github.com/openstack/taskflow/blob/master/taskflow/engines/action_engine/executor.py#L57
  
 That is actually how our WorkerBasedEngine was implemented: it's the
 same engine with special task executor that schedules tasks on worker
 instead of running task code locally.
  
 Task executors are not aware of flows by design, all they do is
 executing and reverting tasks. That means that task executors can be
 easily shared between engines if that's wanted.
  
 Current TaskExecutorBase interface uses futures (PEP 3148-like). When I
 proposed it, futures looked like good tool for the task at hand (see
 e.g. async task etherpad
 https://etherpad.openstack.org/p/async-taskflow-tasks)
  
 Now it may be time to reconsider that: having one future object per
 running task may become a scalability issue. It may be worth to use
 callbacks instead. It should not be too hard to refactor current engine
 for that. Also, as TaskExecutorBase is an internal API, there should not
 be any compatibility issues.
  
 Then, we can make task executor interface public and allow clients to
 provide their own task executors. It will be possible then for Mistral
 to implement its own task executor, or several, and share the
 executors between all the engine instances.
  
 You can call it a plan;)
  
 == Running flows ==
  
 To run the flow TaskFlow client uses engine interface; also, there are
 few of helper functions provided for convenience:
  
 http://docs.openstack.org/developer/taskflow/engines.html#module-taskflow.engines.base
 http://docs.openstack.org/developer/taskflow/engines.html#creating-engines
  
 That is part of our public API, it is stable and good enough. Basically,
 I don't think this API needs any major change.
  
 Maybe it worth to add function or method to schedule running flow
 without actually waiting for flow completion (at least, it was on my top
 secret TODO list for quite a long time).
  
 == Engine internals ==
  
 Each engine eats resources, like thread it runs on; using these
 resources to run one flow only is somewhat wasteful. Some work is
 already planned to address this situation (see e.g.
 https://blueprints.launchpad.net/taskflow/+spec/share-engine-thread).
 Also, it might be good idea to implement different 'type' of engine to
 support 'lazy' model, as Joshua suggests.
  
 But whatever should and will be done about it, I daresay all that work
 can be done without affecting API more then I described above.
  
 --  
 WBR,
 Ivan A. Melnikov
  
 ... tasks must flow ...
  
  
 On 02.04.2014 01:51, Dmitri Zimine wrote:
  Even more responses inline :)
  
 [...]
  
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org (mailto:OpenStack-dev@lists.openstack.org)
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
  
  


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] How Mistral handling long running delegate tasks

2014-04-02 Thread Renat Akhmerov
On 02 Apr 2014, at 13:38, Kirill Izotov enyk...@stackstorm.com wrote:

 I agree that we probably need new engine for that kind of changes and, as 
 Renat already said in another thread, lazy model seems to be more basic and 
 it would be easier to build sync engine on top of that rather than other way 
 around. Yes, it will entail a lot of changes in engines that are currently 
 here, but it seems like the only way to get something that would fit us both.
 
 Since it seems like we are getting some kind of agreement here, we should 
 probably start shifting to the plane where we discuss the design of the new 
 engine, rather than the need of one. The idea has been spread over to many 
 places, so i'll try to gather it back. 
 
 Lazy engine should be async and atomic, it should not have its own state, 
 instead it should rely on on some kind of global state (db or in-memory, 
 depending on a type of application). I should have at least two methods: run 
 and task_complete. Run method should calculate the first batch of tasks and 
 schedule them to execution (either put them in queue or spawn the threads... 
 or send a pidgin, i insist =). Task_complete should mark a certain task to be 
 completed and then schedule the next batch of tasks that became available due 
 to resolution of this one.
 
 Then, on top of it you can build sync engine by introducing Futures. You are 
 using async.run() to schedule the tasks by transforming them to Futures and 
 then starting a loop, checking Futures for completion and sending their 
 results to async.task_complete() which would produce even more Futures to 
 check over. Just the same way TaskFlow do it right now.
 
 On the Mistral side we are using Lazy engine by patching async.run to the API 
 (or engine queue) and async.task_complete to the worker queue result channel 
 (and the API for long running tasks). We still sharing the same 
 graph_analyzer, but instead of relying on loop and Futures, we are handling 
 execution in a scalable and robust way.
 
 The reason i'm proposing to extract Futures from async engine is because they 
 won't work if we have multiple engines that should handle the task results 
 concurrently (and without that there will be no scalability).

I agree with all the major points here. It sounds like a plan.

 What i see is bothering Joshua is that worker that handles long running task 
 may just die in a process and there is no way for us to know for sure is it 
 still working or not. It is more important for sync engine because without 
 that it would just hang forever (though it is not clear do sync engine needs 
 long running tasks at all?). In case of sync engine, the role of watch-dog 
 may be performed by the loop, while in case of Mistral it might be a separate 
 process (though i bet there should be something for resending the message in 
 the RabbitMQ itself). The common solution is not necessary here.


As for not loosing messages (resending them to the queue) that’s why I 
mentioned message acknowledgement ([0]). Rabbit does it automatically if a 
message that has been pulled out of queue should be acknowledged and the 
corresponding rabbit client connection dies before the client acknowledges the 
message (at this point there’s a guarantee it’s been processed). It works this 
way now in Mistral. A slight problem with the current Mistral implementation is 
that engine works as follows when starting a workflow:

1.
Start DB Transaction
Make all smart logic and DB operations (updating persistent state of 
tasks and execution)
Commit DB Transaction
2. Submit task messages to MQ.

So there’s a window between steps 1 and 2 when if the system crashes DB state 
won’t be consistent with the state of the MQ. From a worker perspective looks 
like this problem doesn’t exist (at least we thought through it and didn’t find 
any synchronisation windows). Initially step 2 was a part of step 1 (a part of 
DB TX) and it would solve the problem but it’s generally a bad pattern to have 
interprocess communication inside DB TX so we got rid of it.

So this seems to me the only problem with the current architecture, we left it 
as it was and were going to get back to it after POC. I assume this might be 
describing the reason why Josh keeps talking about ‘jobboard’ thing, but I just 
don’t have enough details at this point to say if that’s what we need or not.

One solution I see here is just to consider this situation exceptional from 
workflow execution model perspective and apply policies to tasks that are 
persisted in DB but not submitted to MQ (what you guys discussed about retries 
and all that stuff..). So our watch-dog process could just resubmit tasks that 
have been hanging in DB longer than a configured period with the state IDLE. 
Something like that.

[0] http://www.rabbitmq.com/tutorials/tutorial-two-python.html

Renat Akhmerov
@ Mirantis Inc.

___
OpenStack-dev mailing list

[openstack-dev] [Mistral] Next crack at real workflows

2014-04-02 Thread Dmitri Zimine
Two more workflows drafted - cloud cron, and lifecycle, version 1. 

The mindset questions are: 
1) is DSL syntax expressive, and capable and convenient to handle real use 
cases?
2) most importantly: what are the implied workflow capabilities which make it 
all work? 
 
* Take a look here: 
https://github.com/dzimine/mistral-workflows/tree/add-usecases

* Leave your comments - generally, or  line-by-line, in the pull request  
https://github.com/dzimine/mistral-workflows/pull/1/files

* Fork, do your own modifications and do another pull request. 

* Or just reply with your comments  in email (lazy option :)) 

NOTE: please keep this thread for specific comments on DSL and workflow 
capabilities, create another thread if changing topic. Thanks! 

DZ ___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] How Mistral handling long running delegate tasks

2014-04-01 Thread Dmitri Zimine
Even more responses inline :)
On Mar 31, 2014, at 8:44 PM, Joshua Harlow harlo...@yahoo-inc.com wrote:

 More responses inline :)
 
 From: Dmitri Zimine d...@stackstorm.com
 Date: Monday, March 31, 2014 at 5:59 PM
 To: Joshua Harlow harlo...@yahoo-inc.com
 Cc: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org
 Subject: Re: [openstack-dev] [Mistral] How Mistral handling long running 
 delegate tasks
 
 Inline...
 On Mar 27, 2014, at 5:10 PM, Joshua Harlow harlo...@yahoo-inc.com wrote:
 
 Thanks for the description!
 
 The steps here seem very much like what a taskflow engine does (which is 
 good).
 
 To connect this to how I think could work in taskflow.
 Someone creates tasks/flows describing the work to-be-done (converting a 
 DSL - taskflow tasks/flows/retry[1] objects…)
 On execute(workflow) engine creates a new workflow execution, computes the 
 first batch of tasks, creates executor for those tasks (remote, local…) and 
 executes those tasks.
 Waits for response back from futures returned from executor.
 Receives futures responses (or receives new response DELAY, for example), 
 or exceptions…
 Continues sending out batches of tasks that can be still be executing (aka 
 tasks that don't have dependency on output of delayed tasks).
 If any delayed tasks after repeating #2-5 as many times as it can, the 
 engine will shut itself down (see http://tinyurl.com/l3x3rrb).
 Why would engine treat long running tasks differently? The model Mistral 
 tried out is the engine sends the batch of tasks and goes asleep; the 
 'worker/executor' is calling engine back when the task(s) complete. Can it 
 be applied 
 
 
 Not all ways of using taskflow I think want to go 'asleep', some active 
 conductors I would think actually stay 'awake', that’s why I was thinking 
 this would be a comprimise, the usage of 'DELAY' (via exception or return) 
 would allow a task to say it is going to be finished sometime in the future 
 (btw started this @ https://review.openstack.org/#/c/84277/ --- WIP, likely 
 won't go into taskflow 0.2 but seems like a reasonable start on something 
 like this proposal). To me offering just the going asleep way means that all 
 users of taskflow need to have some type of entrypoint (rest, mq, other…) 
 that restarts the engine on result finishing. I'd rather not force that model 
 onto all users (since that seems inappropriate).
I understand and agree with not enforcing this model on all users. On a flip 
side, TaskFlow enforces the current model on Mistral :) It calls for supporting 
more models (to your earlier point of 3rd mode of operations). The BP proposal 
is a step in the direction but still a compromise. How can we support both 
'active' and 'passive' models, sharing the same 'library' - of all things 
responsible for control flow and data flow?

Here is a strawman (DISCLAIMER: this is sharing ideas and brainstorming: I 
don't know enough of TaksFlow to suggest): 
1) break the run loop: add engine.run_async() method which instead of looping 
the tasks till the flow completes (http://tinyurl.com/nou2em9), only schedules 
the first batch and returns; 
https://github.com/openstack/taskflow/blob/master/taskflow/engines/action_engine/graph_action.py#L61-L68

2) introduce engine.task_complete(…) method that marks the current task 
complete, computes the next tasks ready for execution, schedules them and 
returns; loosely, doing this part: 
https://github.com/openstack/taskflow/blob/master/taskflow/engines/action_engine/graph_action.py#L75-L85

3) make executor signal engine back by calling engine.task_complete(…): 
executor.execute_task() submits the task to the worker queue and calls 
engine.task_complete(status, results, etc.) instead of waiting for task 
completion and returning the results. 

And looks like it all can be done as a third lazy_engine, without messing the 
current two engines? 


 
 
 On delay task finishing some API/webhook/other (the mechanism imho 
 shouldn't be tied to webhooks, at least not in taskflow, but should be left 
 up to the user of taskflow to decide how to accomplish this) will be/must 
 be responsible for resuming the engine and setting the result for the 
 previous delayed task.
 Oh no, webhook is the way to expose it to 3rd party system. From the library 
 standpoint it's just an API call. 
 
 One can do it even now by getting the appropriate Flow_details, 
 instantiating and engine (flow, flow_details) and running it to continue 
 from where it left out. Is it how you mean it? But I keep on dreaming of a 
 passive version of TaskFlow engine which treats all tasks the same and 
 exposes one extra method - handle_tasks. 
 
 
 I was thinking that, although I'm unsure on the one extra method idea, can u 
 explain more :) What would handle_tasks do? Restart/resume the engine 
 (basically the work u stated 'getting the appropriate Flow_details, 
 instantiating and engine (flow, flow_details) and running

Re: [openstack-dev] [Mistral][TaskFlow] Long running actions

2014-04-01 Thread Dmitri Zimine

On Apr 1, 2014, at 3:43 AM, Renat Akhmerov rakhme...@mirantis.com wrote:
 On 25 Mar 2014, at 01:51, Joshua Harlow harlo...@yahoo-inc.com wrote:
 
 The first execution model I would call the local execution model, this model 
 involves forming tasks and flows and then executing them inside an 
 application, that application is running for the duration of the workflow 
 (although if it crashes it can re-establish the task and flows that it was 
 doing and attempt to resume them). This could also be what openstack 
 projects would call the 'conductor' approach where nova, ironic, trove have 
 a conductor which manages these long-running actions (the conductor is 
 alive/running throughout the duration of these workflows, although it may be 
 restarted while running). The restarting + resuming part is something that 
 openstack hasn't handled so gracefully currently, typically requiring either 
 some type of cleanup at restart (or by operations), with taskflow using this 
 model the resumption part makes it possible to resume from the last saved 
 state (this connects into the persistence model that taskflow uses, the 
 state transitions, how execution occurrs itself...). 
 
 The second execution model is an extension of the first, whereby there is 
 still a type of 'conductor' that is managing the life-time of the workflow, 
 but instead of locally executing tasks in the conductor itself tasks are now 
 executed on remote-workers (see http://tinyurl.com/lf3yqe4
 ). The engine currently still is 'alive' for the life-time of the execution, 
 although the work that it is doing is relatively minimal (since its not 
 actually executing any task code, but proxying those requests to others 
 works). The engine while running does the conducting of the remote-workers 
 (saving persistence details, doing state-transtions, getting results, 
 sending requests to workers…).
 
 These two execution models are special cases of what you call “lazy execution 
 model” (or passive as we call it). To illustrate this idea we can take a look 
 at the first sequence diagram at [0], we basically will see the following 
 interaction:
 
 1) engine --(task)-- queue --(task)-- worker
 2) execute task
 3) worker --(result)-- queue --(result)-- engine
 
 This is how TaskFlow worker based model works.
 
 If we loosen the requirement in 3) and assume that not only worker can send a 
 task result back to engine we’ll get our passive model. Instead of worker it 
 can be anything else (some external system) that knows how to make this call. 
 A particular way is not too important, it can be a direct message or it can 
 be hidden behind an API method. In Mistral it’s now a REST API method however 
 we’re about to decouple engine from REST API so that engine is a standalone 
 process and listens to a queue. So worker-based model is basically the same 
 with the only strict requirement that only worker sends a result back.
 
 In order to implement local execution model on top of “lazy execution model” 
 we just need to abstract a transport (queue) so that we can use an in-process 
 transport. That’s it. It’s what Mistral already has implemented. Again, we 
 see that “lazy execution model” is more universal.
 
 IMO this “lazy execution model” should be the main execution model that 
 TaskFlow supports, others can be easily implemented on top of it. But the 
 opposite assertion is wrong. IMO this is the most important obstacle in all 
 our discussions, the reason why we don’t always understand each other well 
 enough. I know it may be a lot of work to shift a paradigm in TaskFlow team 
 but if we did that we would get enough freedom for using TaskFlow in lots of 
 cases.
 
 Let me know what you think. I might have missed something.

DZ: Interesting idea! So that other models of execution are based on lazy 
execution model? TaskFlow implements this, we can use it, and for other clients 
more convenient higher level execution models are provided? Interesting. Makes 
sense.
@Joshua? @Kirill? Others? 

 
 === HA ===
 
 So this is an interesting question, and to me is strongly connected to how 
 your engines are executing (and the persistence and state-transitions that 
 they go through while running). Without persistence of state and transitions 
 there is no good way (a bad way of course can be created, by just redoing 
 all the work, but that's not always feasible or the best option) to 
 accomplish resuming in a sane manner and there is also imho no way to 
 accomplish any type of automated HA of workflows. 
 
 Sure, no questions here.
 
 Let me describe:
 
 When you save the states of a workflow and any intermediate results of a 
 workflow to some database (for example) and the engine (see above models) 
 which is being used (for example the conductor type from above) the 
 application containing that engine may be prone to crashes (or just being 
 powered off due to software upgrades...). Since taskflows key primitives 
 were made to allow for 

Re: [openstack-dev] [Mistral] How Mistral handling long running delegate tasks

2014-04-01 Thread Joshua Harlow
Cool, my thoughts added ;)

From: Dmitri Zimine d...@stackstorm.commailto:d...@stackstorm.com
Date: Tuesday, April 1, 2014 at 2:51 PM
To: Joshua Harlow harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com
Cc: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [Mistral] How Mistral handling long running 
delegate tasks

Even more responses inline :)
On Mar 31, 2014, at 8:44 PM, Joshua Harlow 
harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com wrote:

More responses inline :)

From: Dmitri Zimine d...@stackstorm.commailto:d...@stackstorm.com
Date: Monday, March 31, 2014 at 5:59 PM
To: Joshua Harlow harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com
Cc: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [Mistral] How Mistral handling long running 
delegate tasks

Inline...
On Mar 27, 2014, at 5:10 PM, Joshua Harlow 
harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com wrote:

Thanks for the description!

The steps here seem very much like what a taskflow engine does (which is good).

To connect this to how I think could work in taskflow.

  1.  Someone creates tasks/flows describing the work to-be-done (converting a 
DSL - taskflow tasks/flows/retry[1] objects…)
  2.  On execute(workflow) engine creates a new workflow execution, computes 
the first batch of tasks, creates executor for those tasks (remote, local…) and 
executes those tasks.
  3.  Waits for response back from 
futureshttp://docs.python.org/dev/library/concurrent.futures.html returned 
from executor.
  4.  Receives futures responses (or receives new response DELAY, for example), 
or exceptions…
  5.  Continues sending out batches of tasks that can be still be executing 
(aka tasks that don't have dependency on output of delayed tasks).
  6.  If any delayed tasks after repeating #2-5 as many times as it can, the 
engine will shut itself down (see http://tinyurl.com/l3x3rrb).

Why would engine treat long running tasks differently? The model Mistral tried 
out is the engine sends the batch of tasks and goes asleep; the 
'worker/executor' is calling engine back when the task(s) complete. Can it be 
applied

Not all ways of using taskflow I think want to go 'asleep', some active 
conductors I would think actually stay 'awake', that’s why I was thinking this 
would be a comprimise, the usage of 'DELAY' (via exception or return) would 
allow a task to say it is going to be finished sometime in the future (btw 
started this @ https://review.openstack.org/#/c/84277/ --- WIP, likely won't go 
into taskflow 0.2 but seems like a reasonable start on something like this 
proposal). To me offering just the going asleep way means that all users of 
taskflow need to have some type of entrypoint (rest, mq, other…) that restarts 
the engine on result finishing. I'd rather not force that model onto all users 
(since that seems inappropriate).
I understand and agree with not enforcing this model on all users. On a flip 
side, TaskFlow enforces the current model on Mistral :) It calls for supporting 
more models (to your earlier point of 3rd mode of operations). The BP proposal 
is a step in the direction but still a compromise. How can we support both 
'active' and 'passive' models, sharing the same 'library' - of all things 
responsible for control flow and data flow?

To me this is what engines 'types' are for, to support different execution 
models while using as many of the same components as possible (making usage as 
seamless as can be).


Here is a strawman (DISCLAIMER: this is sharing ideas and brainstorming: I 
don't know enough of TaksFlow to suggest):
1) break the run loop: add engine.run_async() method which instead of looping 
the tasks till the flow completes (http://tinyurl.com/nou2em9), only schedules 
the first batch and returns;
https://github.com/openstack/taskflow/blob/master/taskflow/engines/action_engine/graph_action.py#L61-L68

Seems like a possiblity, although I'd like to make this still a new engine type 
that does this (or maybe the existing engine types wrap this change to retain 
the usage that exists). This just seems like an extension of DELAY thought, 
where at each iteration the engine would return DELAYed, then the caller (the 
one executing) would become aware that this has happened and decide how to 
handle this accordingly. Exposing 'run_async' doesn't still feel right, maybe 
its just wording, but it seems like an 'async/lazy' engine just still has a 
run() method that returns DELAYed more often than an engine that loops and 
never returns DELAYed (or only returns DELAYed if a task causes this to 
happen). To me they are the same run() method, just different implementations 
of run(). Exposing the semantics of running by naming run_async exposes the 
underlying execution abstraction, which imho isn't

Re: [openstack-dev] [Mistral][TaskFlow] Long running actions

2014-04-01 Thread Joshua Harlow
Inline responses.

From: Renat Akhmerov rakhme...@mirantis.commailto:rakhme...@mirantis.com
Reply-To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Date: Tuesday, April 1, 2014 at 3:43 AM
To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [Mistral][TaskFlow] Long running actions


On 25 Mar 2014, at 01:51, Joshua Harlow 
harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com wrote:

The first execution model I would call the local execution model, this model 
involves forming tasks and flows and then executing them inside an application, 
that application is running for the duration of the workflow (although if it 
crashes it can re-establish the task and flows that it was doing and attempt to 
resume them). This could also be what openstack projects would call the 
'conductor' approach where nova, ironic, trove have a conductor which manages 
these long-running actions (the conductor is alive/running throughout the 
duration of these workflows, although it may be restarted while running). The 
restarting + resuming part is something that openstack hasn't handled so 
gracefully currently, typically requiring either some type of cleanup at 
restart (or by operations), with taskflow using this model the resumption part 
makes it possible to resume from the last saved state (this connects into the 
persistence model that taskflow uses, the state transitions, how execution 
occurrs itself...).

The second execution model is an extension of the first, whereby there is still 
a type of 'conductor' that is managing the life-time of the workflow, but 
instead of locally executing tasks in the conductor itself tasks are now 
executed on remote-workers (see http://tinyurl.com/lf3yqe4
). The engine currently still is 'alive' for the life-time of the execution, 
although the work that it is doing is relatively minimal (since its not 
actually executing any task code, but proxying those requests to others works). 
The engine while running does the conducting of the remote-workers (saving 
persistence details, doing state-transtions, getting results, sending requests 
to workers…).

These two execution models are special cases of what you call “lazy execution 
model” (or passive as we call it). To illustrate this idea we can take a look 
at the first sequence diagram at [0], we basically will see the following 
interaction:

1) engine --(task)-- queue --(task)-- worker
2) execute task
3) worker --(result)-- queue --(result)-- engine

This is how TaskFlow worker based model works.

If we loosen the requirement in 3) and assume that not only worker can send a 
task result back to engine we’ll get our passive model. Instead of worker it 
can be anything else (some external system) that knows how to make this call. A 
particular way is not too important, it can be a direct message or it can be 
hidden behind an API method. In Mistral it’s now a REST API method however 
we’re about to decouple engine from REST API so that engine is a standalone 
process and listens to a queue. So worker-based model is basically the same 
with the only strict requirement that only worker sends a result back.

In order to implement local execution model on top of “lazy execution model” we 
just need to abstract a transport (queue) so that we can use an in-process 
transport. That’s it. It’s what Mistral already has implemented. Again, we see 
that “lazy execution model” is more universal.

IMO this “lazy execution model” should be the main execution model that 
TaskFlow supports, others can be easily implemented on top of it. But the 
opposite assertion is wrong. IMO this is the most important obstacle in all our 
discussions, the reason why we don’t always understand each other well enough. 
I know it may be a lot of work to shift a paradigm in TaskFlow team but if we 
did that we would get enough freedom for using TaskFlow in lots of cases.

Everything is a lot of work ;) That’s just how it goes. I think we work through 
it then it's all fine in the end.

I think some of this is being resolved/discussed @ http://tinyurl.com/k3s2gmy


Let me know what you think. I might have missed something.

=== HA ===

So this is an interesting question, and to me is strongly connected to how your 
engines are executing (and the persistence and state-transitions that they go 
through while running). Without persistence of state and transitions there is 
no good way (a bad way of course can be created, by just redoing all the work, 
but that's not always feasible or the best option) to accomplish resuming in a 
sane manner and there is also imho no way to accomplish any type of automated 
HA of workflows.

Sure, no questions here.

Let me describe:

When you save the states of a workflow and any intermediate results of a 
workflow to some database

Re: [openstack-dev] [Mistral][TaskFlow] Long running actions

2014-04-01 Thread Joshua Harlow
More inline.

From: Dmitri Zimine d...@stackstorm.commailto:d...@stackstorm.com
Reply-To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Date: Tuesday, April 1, 2014 at 2:59 PM
To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [Mistral][TaskFlow] Long running actions


On Apr 1, 2014, at 3:43 AM, Renat Akhmerov 
rakhme...@mirantis.commailto:rakhme...@mirantis.com wrote:
On 25 Mar 2014, at 01:51, Joshua Harlow 
harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com wrote:

The first execution model I would call the local execution model, this model 
involves forming tasks and flows and then executing them inside an application, 
that application is running for the duration of the workflow (although if it 
crashes it can re-establish the task and flows that it was doing and attempt to 
resume them). This could also be what openstack projects would call the 
'conductor' approach where nova, ironic, trove have a conductor which manages 
these long-running actions (the conductor is alive/running throughout the 
duration of these workflows, although it may be restarted while running). The 
restarting + resuming part is something that openstack hasn't handled so 
gracefully currently, typically requiring either some type of cleanup at 
restart (or by operations), with taskflow using this model the resumption part 
makes it possible to resume from the last saved state (this connects into the 
persistence model that taskflow uses, the state transitions, how execution 
occurrs itself...).

The second execution model is an extension of the first, whereby there is still 
a type of 'conductor' that is managing the life-time of the workflow, but 
instead of locally executing tasks in the conductor itself tasks are now 
executed on remote-workers (see http://tinyurl.com/lf3yqe4
). The engine currently still is 'alive' for the life-time of the execution, 
although the work that it is doing is relatively minimal (since its not 
actually executing any task code, but proxying those requests to others works). 
The engine while running does the conducting of the remote-workers (saving 
persistence details, doing state-transtions, getting results, sending requests 
to workers…).

These two execution models are special cases of what you call “lazy execution 
model” (or passive as we call it). To illustrate this idea we can take a look 
at the first sequence diagram at [0], we basically will see the following 
interaction:

1) engine --(task)-- queue --(task)-- worker
2) execute task
3) worker --(result)-- queue --(result)-- engine

This is how TaskFlow worker based model works.

If we loosen the requirement in 3) and assume that not only worker can send a 
task result back to engine we’ll get our passive model. Instead of worker it 
can be anything else (some external system) that knows how to make this call. A 
particular way is not too important, it can be a direct message or it can be 
hidden behind an API method. In Mistral it’s now a REST API method however 
we’re about to decouple engine from REST API so that engine is a standalone 
process and listens to a queue. So worker-based model is basically the same 
with the only strict requirement that only worker sends a result back.

In order to implement local execution model on top of “lazy execution model” we 
just need to abstract a transport (queue) so that we can use an in-process 
transport. That’s it. It’s what Mistral already has implemented. Again, we see 
that “lazy execution model” is more universal.

IMO this “lazy execution model” should be the main execution model that 
TaskFlow supports, others can be easily implemented on top of it. But the 
opposite assertion is wrong. IMO this is the most important obstacle in all our 
discussions, the reason why we don’t always understand each other well enough. 
I know it may be a lot of work to shift a paradigm in TaskFlow team but if we 
did that we would get enough freedom for using TaskFlow in lots of cases.

Let me know what you think. I might have missed something.

DZ: Interesting idea! So that other models of execution are based on lazy 
execution model? TaskFlow implements this, we can use it, and for other clients 
more convenient higher level execution models are provided? Interesting. Makes 
sense.
@Joshua? @Kirill? Others?

I think this is likely possible, which is simiar to whats in 
http://tinyurl.com/k3s2gmy, engine types can be built from each other (and if 
we wanted to alter the structure that exists in taskflow) then sure. But see 
that message for more of my concerns around exposing that engine API to library 
users (I think it could have its usage in mistral to expose this, but I'm not 
sure its useful for elsewhere, and once its public engine API, its public for a 
very long time).



=== HA ===

So

Re: [openstack-dev] [Mistral] How Mistral handling long running delegate tasks

2014-04-01 Thread Renat Akhmerov
On 02 Apr 2014, at 05:45, Joshua Harlow harlo...@yahoo-inc.com wrote:

 Possibly, although to me this is still exposing the internal of engines to 
 users who shouldn't care (or only care if they are specifying an engine type 
 that gives them access to these details). Allowing public access to these 
 API's worries me in that they are now the API (which goes back to having an 
 engine type that exposes these, if that’s desired, and if we are willing to 
 accept the consequences of exposing them).

Given all we discussed by now calling it “internal of engines” is not correct 
anymore. If for some cases we know that only workers will be calling this API 
method and we need to protect the workflow execution from occasional calls from 
3rd parties I believe there’s a million ways how to solve this. The simplest 
thing that comes to my mind is just passing a generated token to confirm 
authority to perform this operation.

 Who responds to the timeout though? Isn't that process the watchdog then? 
 Likely the triggering of a timeout causes something to react (in both 
 cases).
 The workflow engine IS this watch-dog (and in Mistral, engine is a single 
 manager for all flow executions, in the prototype we call it engine_manager 
 and I hate this name :)) Engine live in process or as a separate process. 
 And it is passive - executed in a thread of a callee. E.g., in process is 
 either called on messaging event handler thread, or by web method thread.
 
 
 Right, which in mistral is a web-server right (aka, wherever mistral is 
 setup) since the tasks finish by calling a rest-endpoint (or something 
 sitting on MQ?)?

Not exactly right. Currently it’s a web server but we’re about to decouple 
engine and API server. Most of the work is done. Engine is supposed to listen 
to a queue and there may be any number of engines since they are stateless and 
hence what’s behind a web server can be scaled as needed. And actually a web 
server tier can be scaled easily too (assuming we have a loadbalancer in place).

 That may be good enough: when DSL is translated to flow, and the task 
 demands repetition with timeout, it's ok to do this trick under the hood 
 when compiling a flow. 
 flow.add(LinearFlow(subblahblah, 
 retry=XYZ).add(OneTask().add(Timeout(timeout))
 
 
 Yup, in a way most languages compilers do all these types of tricks under the 
 hood (in much much more complicated manners); as long as we retain 'user 
 intention' (aka don't mess how the code executes) we should be able to do any 
 tricks we want (in fact most compliers do many many tricks). To me the same 
 kind of tricks start to become possible after we get the basics right (can't 
 do optimizations, aka -O2, if u don't have basics in the first place).

I’d be careful about this assumption that we can convert DSL to flow, right now 
it’s impossible since we need to add more control flow primitives in TaskFlow. 
But that’s what Kirill described in the prototype description.

Renat Akhmerov
@ Mirantis Inc.___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral][TaskFlow] Long running actions

2014-04-01 Thread Renat Akhmerov
On 02 Apr 2014, at 06:00, Joshua Harlow harlo...@yahoo-inc.com wrote:

 More inline.
 
 From: Dmitri Zimine d...@stackstorm.com
 Reply-To: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org
 Date: Tuesday, April 1, 2014 at 2:59 PM
 To: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org
 Subject: Re: [openstack-dev] [Mistral][TaskFlow] Long running actions
 
 
 On Apr 1, 2014, at 3:43 AM, Renat Akhmerov rakhme...@mirantis.com wrote:
 On 25 Mar 2014, at 01:51, Joshua Harlow harlo...@yahoo-inc.com wrote:
 
 The first execution model I would call the local execution model, this 
 model involves forming tasks and flows and then executing them inside an 
 application, that application is running for the duration of the workflow 
 (although if it crashes it can re-establish the task and flows that it was 
 doing and attempt to resume them). This could also be what openstack 
 projects would call the 'conductor' approach where nova, ironic, trove 
 have a conductor which manages these long-running actions (the conductor 
 is alive/running throughout the duration of these workflows, although it 
 may be restarted while running). The restarting + resuming part is 
 something that openstack hasn't handled so gracefully currently, typically 
 requiring either some type of cleanup at restart (or by operations), with 
 taskflow using this model the resumption part makes it possible to resume 
 from the last saved state (this connects into the persistence model that 
 taskflow uses, the state transitions, how execution occurrs itself...). 
 
 The second execution model is an extension of the first, whereby there is 
 still a type of 'conductor' that is managing the life-time of the 
 workflow, but instead of locally executing tasks in the conductor itself 
 tasks are now executed on remote-workers (see http://tinyurl.com/lf3yqe4
 ). The engine currently still is 'alive' for the life-time of the 
 execution, although the work that it is doing is relatively minimal (since 
 its not actually executing any task code, but proxying those requests to 
 others works). The engine while running does the conducting of the 
 remote-workers (saving persistence details, doing state-transtions, 
 getting results, sending requests to workers…).
 
 These two execution models are special cases of what you call “lazy 
 execution model” (or passive as we call it). To illustrate this idea we can 
 take a look at the first sequence diagram at [0], we basically will see the 
 following interaction:
 
 1) engine --(task)-- queue --(task)-- worker
 2) execute task
 3) worker --(result)-- queue --(result)-- engine
 
 This is how TaskFlow worker based model works.
 
 If we loosen the requirement in 3) and assume that not only worker can send 
 a task result back to engine we’ll get our passive model. Instead of worker 
 it can be anything else (some external system) that knows how to make this 
 call. A particular way is not too important, it can be a direct message or 
 it can be hidden behind an API method. In Mistral it’s now a REST API 
 method however we’re about to decouple engine from REST API so that engine 
 is a standalone process and listens to a queue. So worker-based model is 
 basically the same with the only strict requirement that only worker sends 
 a result back.
 
 In order to implement local execution model on top of “lazy execution 
 model” we just need to abstract a transport (queue) so that we can use an 
 in-process transport. That’s it. It’s what Mistral already has implemented. 
 Again, we see that “lazy execution model” is more universal.
 
 IMO this “lazy execution model” should be the main execution model that 
 TaskFlow supports, others can be easily implemented on top of it. But the 
 opposite assertion is wrong. IMO this is the most important obstacle in all 
 our discussions, the reason why we don’t always understand each other well 
 enough. I know it may be a lot of work to shift a paradigm in TaskFlow team 
 but if we did that we would get enough freedom for using TaskFlow in lots 
 of cases.
 
 Let me know what you think. I might have missed something.
 
 DZ: Interesting idea! So that other models of execution are based on lazy 
 execution model? TaskFlow implements this, we can use it, and for other 
 clients more convenient higher level execution models are provided? 
 Interesting. Makes sense.
 @Joshua? @Kirill? Others? 
 
 
 I think this is likely possible, which is simiar to whats in 
 http://tinyurl.com/k3s2gmy, engine types can be built from each other (and if 
 we wanted to alter the structure that exists in taskflow) then sure. But see 
 that message for more of my concerns around exposing that engine API to 
 library users (I think it could have its usage in mistral to expose this, but 
 I'm not sure its useful for elsewhere, and once its public engine API, its 
 public for a very long time).

What are we

Re: [openstack-dev] [Mistral] Review reminder

2014-04-01 Thread Renat Akhmerov
LGTM. If others agree we can fix the jenkins job.

Renat Akhmerov
@ Mirantis Inc.



On 02 Apr 2014, at 07:51, Dmitri Zimine d...@stackstorm.com wrote:

 We agreed to review this and if/when OK, fix the murano-cli. Can you guys 
 please take a look? 
 https://review.openstack.org/#/c/81941/
 
 DZ
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral][TaskFlow] Long running actions

2014-04-01 Thread Joshua Harlow
Get er' done!

Haha, u guys want to jump into #openstack-state-management tommorow or on our 
Thursday meeting we can discuss more how this might work and such.

That'd be cool.

Sent from my really tiny device...

On Apr 1, 2014, at 9:37 PM, Renat Akhmerov 
rakhme...@mirantis.commailto:rakhme...@mirantis.com wrote:

On 02 Apr 2014, at 06:00, Joshua Harlow 
harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com wrote:

More inline.

From: Dmitri Zimine d...@stackstorm.commailto:d...@stackstorm.com
Reply-To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Date: Tuesday, April 1, 2014 at 2:59 PM
To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [Mistral][TaskFlow] Long running actions


On Apr 1, 2014, at 3:43 AM, Renat Akhmerov 
rakhme...@mirantis.commailto:rakhme...@mirantis.com wrote:
On 25 Mar 2014, at 01:51, Joshua Harlow 
harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com wrote:

The first execution model I would call the local execution model, this model 
involves forming tasks and flows and then executing them inside an application, 
that application is running for the duration of the workflow (although if it 
crashes it can re-establish the task and flows that it was doing and attempt to 
resume them). This could also be what openstack projects would call the 
'conductor' approach where nova, ironic, trove have a conductor which manages 
these long-running actions (the conductor is alive/running throughout the 
duration of these workflows, although it may be restarted while running). The 
restarting + resuming part is something that openstack hasn't handled so 
gracefully currently, typically requiring either some type of cleanup at 
restart (or by operations), with taskflow using this model the resumption part 
makes it possible to resume from the last saved state (this connects into the 
persistence model that taskflow uses, the state transitions, how execution 
occurrs itself...).

The second execution model is an extension of the first, whereby there is still 
a type of 'conductor' that is managing the life-time of the workflow, but 
instead of locally executing tasks in the conductor itself tasks are now 
executed on remote-workers (see http://tinyurl.com/lf3yqe4
). The engine currently still is 'alive' for the life-time of the execution, 
although the work that it is doing is relatively minimal (since its not 
actually executing any task code, but proxying those requests to others works). 
The engine while running does the conducting of the remote-workers (saving 
persistence details, doing state-transtions, getting results, sending requests 
to workers…).

These two execution models are special cases of what you call “lazy execution 
model” (or passive as we call it). To illustrate this idea we can take a look 
at the first sequence diagram at [0], we basically will see the following 
interaction:

1) engine --(task)-- queue --(task)-- worker
2) execute task
3) worker --(result)-- queue --(result)-- engine

This is how TaskFlow worker based model works.

If we loosen the requirement in 3) and assume that not only worker can send a 
task result back to engine we’ll get our passive model. Instead of worker it 
can be anything else (some external system) that knows how to make this call. A 
particular way is not too important, it can be a direct message or it can be 
hidden behind an API method. In Mistral it’s now a REST API method however 
we’re about to decouple engine from REST API so that engine is a standalone 
process and listens to a queue. So worker-based model is basically the same 
with the only strict requirement that only worker sends a result back.

In order to implement local execution model on top of “lazy execution model” we 
just need to abstract a transport (queue) so that we can use an in-process 
transport. That’s it. It’s what Mistral already has implemented. Again, we see 
that “lazy execution model” is more universal.

IMO this “lazy execution model” should be the main execution model that 
TaskFlow supports, others can be easily implemented on top of it. But the 
opposite assertion is wrong. IMO this is the most important obstacle in all our 
discussions, the reason why we don’t always understand each other well enough. 
I know it may be a lot of work to shift a paradigm in TaskFlow team but if we 
did that we would get enough freedom for using TaskFlow in lots of cases.

Let me know what you think. I might have missed something.

DZ: Interesting idea! So that other models of execution are based on lazy 
execution model? TaskFlow implements this, we can use it, and for other clients 
more convenient higher level execution models are provided? Interesting. Makes 
sense.
@Joshua? @Kirill? Others?

I think this is likely possible, which is simiar to whats in 
http

[openstack-dev] [Mistral] Engine overview and proposal

2014-03-31 Thread Kirill Izotov
I have an idea regarding engine design i want to share with you. But first, it 
seems like we need a small overview of the current implementations.

I'm not sure how ML will react on a bunch of ASCII graphs, so here is an 
etherpad: https://etherpad.openstack.org/p/mistral-engine-overview-and-proposal

What do you think, guys, is this the way to go? 

-- 
Kirill Izotov

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Community meeting minutes - 03/31/2014

2014-03-31 Thread Renat Akhmerov
Thanks for joining IRC meeting today at #openstack-meeting channel.

As usually,

Minutes: 
http://eavesdrop.openstack.org/meetings/mistral/2014/mistral.2014-03-31-16.00.html
Full log: 
http://eavesdrop.openstack.org/meetings/mistral/2014/mistral.2014-03-31-16.00.log.html

Looking forward to see you again in one week.

Renat Akhmerov
@ Mirantis Inc.



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Engine overview and proposal

2014-03-31 Thread Dmitri Zimine
I am in the full agreement with the proposed approach (risked to copy below, 
let's see if email handles your diagrams): 

* Single Engine handles multiple executions asynchronously, in non-blocking way.
* Persistence access only from API and/or Engine, Engine writes, API reads. 
* Action runes don't talk to DB - it's very simple protocol and queue is 
perfectly fine. 
* This is scalable and as fault tolerant as underlying DB and Queue. Engine 
restart is no loss of info with right persistense; ActionRunner restart  is a 
lost of Action, which can fail for 100 other reasons thus expected, and with 
the right retry policy potentially recoverable. 

I'll inline minor points in the etherpad. 



 API EngineQueueDatabaseWorkers
  |   |   | | | ||   |
--- +-+  |   | | | ||   |
 |S|  |   | | | ||   |
 |t| -- +-+  | | | ||   |
 |a| | |  - - - - - - - - ||   |
 |r| | | - - - - t - - - - - - - - -  +-+  |
 |t| -- +-+  | | | |   | |  |
--- +-+  |   | | | |   | |  |
  |   |  +-+ - r - - - - - - - - - -  +-+  |
--- +-+  |  | | - - - - - -  R|   |
 |I|  |  | | - - t - - - - - - - - -  +-+  |
 |n|  |  | | - - t - - - - - - - - - - -  +-+
 |f|  |  +-+| | |   | | | |
 |o| - - - - - - - - - - - -  |   | | | |
--- +-+  |  +-+ - r - - - - - - - - - - -+-+ | |
  |   |  | | - - - - - -  R|  | |
--- +-+  |  +-+| | ||  | |
 |S| -- +-+  | | | ||  | |
 |t| | | - - - - - - - -  ||  | |
 |o| -- +-+  | | | ||  | |
 |p|  |  +-+ - r  - - - - - - - - - - - - +-+
--- +-+  |  | | - - - - - -  R|   |
  |   |  |%|| | ||   |
  |   |  +-+| | ||   |
  |   |   | | | ||   |


On Mar 31, 2014, at 4:09 AM, Kirill Izotov enyk...@stackstorm.com wrote:

 I have an idea regarding engine design i want to share with you. But first, 
 it seems like we need a small overview of the current implementations.
 
 I'm not sure how ML will react on a bunch of ASCII graphs, so here is an 
 etherpad: 
 https://etherpad.openstack.org/p/mistral-engine-overview-and-proposal
 
 What do you think, guys, is this the way to go?
 
 -- 
 Kirill Izotov
 
 ___
 OpenStack-dev mailing list
 OpenStack-dev@lists.openstack.org
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] How Mistral handling long running delegate tasks

2014-03-31 Thread Dmitri Zimine
Inline...
On Mar 27, 2014, at 5:10 PM, Joshua Harlow harlo...@yahoo-inc.com wrote:

 Thanks for the description!
 
 The steps here seem very much like what a taskflow engine does (which is 
 good).
 
 To connect this to how I think could work in taskflow.
 Someone creates tasks/flows describing the work to-be-done (converting a DSL 
 - taskflow tasks/flows/retry[1] objects…)
 On execute(workflow) engine creates a new workflow execution, computes the 
 first batch of tasks, creates executor for those tasks (remote, local…) and 
 executes those tasks.
 Waits for response back from futures returned from executor.
 Receives futures responses (or receives new response DELAY, for example), or 
 exceptions…
 Continues sending out batches of tasks that can be still be executing (aka 
 tasks that don't have dependency on output of delayed tasks).
 If any delayed tasks after repeating #2-5 as many times as it can, the engine 
 will shut itself down (see http://tinyurl.com/l3x3rrb).
Why would engine treat long running tasks differently? The model Mistral tried 
out is the engine sends the batch of tasks and goes asleep; the 
'worker/executor' is calling engine back when the task(s) complete. Can it be 
applied 
 On delay task finishing some API/webhook/other (the mechanism imho shouldn't 
 be tied to webhooks, at least not in taskflow, but should be left up to the 
 user of taskflow to decide how to accomplish this) will be/must be 
 responsible for resuming the engine and setting the result for the previous 
 delayed task.
Oh no, webhook is the way to expose it to 3rd party system. From the library 
standpoint it's just an API call. 

One can do it even now by getting the appropriate Flow_details, instantiating 
and engine (flow, flow_details) and running it to continue from where it left 
out. Is it how you mean it? But I keep on dreaming of a passive version of 
TaskFlow engine which treats all tasks the same and exposes one extra method - 
handle_tasks. 
 Repeat 2 - 7 until all tasks have executed/failed.
 Profit!

 This seems like it could be accomplished, although there are race conditions 
 in the #6 (what if multiple delayed requests are received at the same time)? 
 What locking is done to ensure that this doesn't cause conflicts?
Engine must handle concurrent calls of mutation methods - start, stop, 
handle_action. How -  differs depending on engine running in multiple threads 
or in event loop on queues of calls. 

 Does the POC solve that part (no simultaneous step #5 from below)?
Yes although we may want to revisit the current solution. 

 There was a mention of a watch-dog (ideally to ensure that delayed tasks 
 can't just sit around forever), was that implemented?
If _delayed_ tasks and 'normal' tasks are treat alike, this is just a matter of 
timeout as a generic property on a task. So Mistral didn't have to have it. For 
the proposal above, a separate treatment is necessary for _delayed_ tasks. 
 
 [1] https://wiki.openstack.org/wiki/TaskFlow#Retries (new feature!)
This is nice. I would call it a 'repeater': running a sub flow several times 
with various data for various reasons is reacher then 'retry'. 
What about the 'retry policy' on individual task? 

 
 From: Dmitri Zimine d...@stackstorm.com
 Reply-To: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org
 Date: Thursday, March 27, 2014 at 4:43 PM
 To: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org
 Subject: [openstack-dev] [Mistral] How Mistral handling long running delegate 
 tasks
 
 Following up on http://tinyurl.com/l8gtmsw and http://tinyurl.com/n3v9lt8: 
 this explains how Mistral handles long running delegate tasks. Note that a 
 'passive' workflow engine can handle both normal tasks and delegates the 
 same way. I'll also put that on ActionDesign wiki, after discussion.
 
 Diagram: 
 https://docs.google.com/a/stackstorm.com/drawings/d/147_EpdatpN_sOLQ0LS07SWhaC3N85c95TkKMAeQ_a4c/edit?usp=sharing
 
 1. On start(workflow), engine creates a new workflow execution, computes the 
 first batch of tasks, sends them to ActionRunner [1].
 2. ActionRunner creates an action and calls action.run(input)
 3. Action does the work (compute (10!)), produce the results,  and return 
 the results to executor. If it returns, status=SUCCESS. If it fails it 
 throws exception, status=ERROR.
 4. ActionRunner notifies Engine that the task is complete 
 task_done(execution, task, status, results)[2]
 5. Engine computes the next task(s) ready to trigger, according to control 
 flow and data flow, and sends them to ActionRunner.
 6. Like step 2: ActionRunner calls the action's run(input)
 7. A delegate action doesn't produce results: it calls out the 3rd party 
 system, which is expected to make a callback to a workflow service with the 
 results. It returns to ActionRunner without results, immediately.  
 8. ActionRunner marks status=RUNNING [?]
 9. 3rd party system

Re: [openstack-dev] [Mistral] How Mistral handling long running delegate tasks

2014-03-31 Thread Joshua Harlow
More responses inline :)

From: Dmitri Zimine d...@stackstorm.commailto:d...@stackstorm.com
Date: Monday, March 31, 2014 at 5:59 PM
To: Joshua Harlow harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com
Cc: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.orgmailto:openstack-dev@lists.openstack.org
Subject: Re: [openstack-dev] [Mistral] How Mistral handling long running 
delegate tasks

Inline...
On Mar 27, 2014, at 5:10 PM, Joshua Harlow 
harlo...@yahoo-inc.commailto:harlo...@yahoo-inc.com wrote:

Thanks for the description!

The steps here seem very much like what a taskflow engine does (which is good).

To connect this to how I think could work in taskflow.

  1.  Someone creates tasks/flows describing the work to-be-done (converting a 
DSL - taskflow tasks/flows/retry[1] objects…)
  2.  On execute(workflow) engine creates a new workflow execution, computes 
the first batch of tasks, creates executor for those tasks (remote, local…) and 
executes those tasks.
  3.  Waits for response back from 
futureshttp://docs.python.org/dev/library/concurrent.futures.html returned 
from executor.
  4.  Receives futures responses (or receives new response DELAY, for example), 
or exceptions…
  5.  Continues sending out batches of tasks that can be still be executing 
(aka tasks that don't have dependency on output of delayed tasks).
  6.  If any delayed tasks after repeating #2-5 as many times as it can, the 
engine will shut itself down (see http://tinyurl.com/l3x3rrb).

Why would engine treat long running tasks differently? The model Mistral tried 
out is the engine sends the batch of tasks and goes asleep; the 
'worker/executor' is calling engine back when the task(s) complete. Can it be 
applied

Not all ways of using taskflow I think want to go 'asleep', some active 
conductors I would think actually stay 'awake', that’s why I was thinking this 
would be a comprimise, the usage of 'DELAY' (via exception or return) would 
allow a task to say it is going to be finished sometime in the future (btw 
started this @ https://review.openstack.org/#/c/84277/ --- WIP, likely won't go 
into taskflow 0.2 but seems like a reasonable start on something like this 
proposal). To me offering just the going asleep way means that all users of 
taskflow need to have some type of entrypoint (rest, mq, other…) that restarts 
the engine on result finishing. I'd rather not force that model onto all users 
(since that seems inappropriate).



  1.  On delay task finishing some API/webhook/other (the mechanism imho 
shouldn't be tied to webhooks, at least not in taskflow, but should be left up 
to the user of taskflow to decide how to accomplish this) will be/must be 
responsible for resuming the engine and setting the result for the previous 
delayed task.

Oh no, webhook is the way to expose it to 3rd party system. From the library 
standpoint it's just an API call.

One can do it even now by getting the appropriate Flow_details, instantiating 
and engine (flow, flow_details) and running it to continue from where it left 
out. Is it how you mean it? But I keep on dreaming of a passive version of 
TaskFlow engine which treats all tasks the same and exposes one extra method - 
handle_tasks.

I was thinking that, although I'm unsure on the one extra method idea, can u 
explain more :) What would handle_tasks do? Restart/resume the engine 
(basically the work u stated 'getting the appropriate Flow_details, 
instantiating and engine (flow, flow_details) and running it to continue')? 
Seems like a tiny helper function if its really wanted, but maybe I'm 
misunderstanding.  It might be connected into a recent taskflow BP @ 
https://blueprints.launchpad.net/taskflow/+spec/generic-flow-conductor?

  1.  Repeat 2 - 7 until all tasks have executed/failed.
  2.  Profit!

This seems like it could be accomplished, although there are race conditions in 
the #6 (what if multiple delayed requests are received at the same time)? What 
locking is done to ensure that this doesn't cause conflicts?
Engine must handle concurrent calls of mutation methods - start, stop, 
handle_action. How -  differs depending on engine running in multiple threads 
or in event loop on queues of calls.

Agreed, to me this requires some level of locking, likely something that the 
toozhttps://review.openstack.org/#/c/71167/ library can provide (or in 
concept is similar to what the 
jobboardhttps://wiki.openstack.org/wiki/TaskFlow/Paradigm_shifts#Workflow_ownership_transfer
 concept provides, single 'atomic' engine access to a given workflow, ensuring 
this with a distributing locking scheme, such as zookeeper).


Does the POC solve that part (no simultaneous step #5 from below)?
Yes although we may want to revisit the current solution.

Is it using some form of database locking? :(


There was a mention of a watch-dog (ideally to ensure that delayed tasks can't 
just sit around forever), was that implemented?
If _delayed_ tasks

<    4   5   6   7   8   9   10   11   12   >