summaryrefslogtreecommitdiff
path: root/taskflow/engines/action_engine/engine.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove sixTakashi Kajinami2022-05-181-5/+5
| | | | | | | | This library no longer supports Python 2, thus usage of six can be removed. This also removes workaround about pickle library used in Python 2 only. Change-Id: I19d298cf0f402d65f0b142dea0bf35cf992332a9
* Fix minor typo in ActionEngine exception messageEric Harney2021-12-021-1/+1
| | | | Change-Id: I66b9937df5c58561792328e08f836dc05927e7f1
* Update TaskFlow for networkx 2.xMichael Johnson2019-10-181-1/+1
| | | | | | | | | | | The networkx 2.x series has been out for two years now and supports python 3.6 and greater[1]. This patch updates TaskFlow to require a minimum of networkx 2.1. It also updates the code to support recent deprecation expiration introduced in the 2.4 release. [1] https://networkx.github.io/documentation/stable/news.html Change-Id: Ife31d353ba80824ebc63c8b21ee90943badc8da3
* Rename engine analyzer to be named selectorJoshua Harlow2017-01-031-3/+3
| | | | | | | | | | | | | This moves out the engine next to run (or revert) selection process to a single class that just does this and moves out the common functions the analyzer class provided to the runtime object (which all components can access). This makes it easier to adjust the selection algorithm in different ways. Change-Id: I091c69297a7bff60729791d3ca6c3fae14d6eea5
* Merge "Use the full 'get_execute_failures' vs the shortname"Jenkins2016-07-081-6/+6
|\
| * Use the full 'get_execute_failures' vs the shortnameJoshua Harlow2016-05-281-6/+6
| | | | | | | | | | | | | | | | The usage of the full name is easier to read and easier to understand in the surronding code so prefer to use it. Change-Id: I1c43704ae7dfdba90217ce9a1c60cef8e2ce8632
* | Split revert/execute missing args messagesGreg Hill2016-05-261-9/+12
|/ | | | | | | | | To make it more obvious when a revert method is missing a dependency, we now identify which method was missing the required paramater. Change-Id: I24b0d0b01dbd239b92ba444f6ef44273c5ac25d3 Closes-Bug: 1581616
* Instead of a multiprocessing queue use sockets via asyncoreJoshua Harlow2016-05-241-6/+8
| | | | | | | | | | | | | | | | | | | | | | For a local process based executor usage currently to ensure that task emitted notifications are proxied we use the multi processing library and use its queue concept. This sadly creates a proxy process that gets associated, and this proxy process handles the queue and messages sent to and from it. Instead of doing this we can instead just create a temporary local socket using a random socket and have tasks (which are running in different processes) use that to communicate back any emitted notifications instead (and we can use the asyncore module to handle the emitted notifications since it handles the lower level socket reading, polling and dispatching). To ensure that the socket created is somewhat secure we use a similar process as the multi-processing library uses where we sign all messages with a hmac that uses a one time key that only the main process and the child process know about (and reject any messages that do not validate using this key). Change-Id: Iff9180054bf14495e5667af00ae2fafbdbc23791
* Allow for specifying green threaded to parallel engineJoshua Harlow2016-05-031-0/+9
| | | | | | | | | | | | | Currently when a string is passed to the parallel engine it will only know how to create a process or a native thread based executor. The futurist library also supports making a green thread based executor, so support creating it. This will save glance some code that they have to create a executor based on different options (one of those is a green option). Change-Id: I15c164a38b4445d28eb6062aed6c56cce0e0364b
* Merge "Have the storage class provide a 'change_flow_state' method"Jenkins2016-04-281-13/+9
|\
| * Have the storage class provide a 'change_flow_state' methodJoshua Harlow2015-08-151-13/+9
| | | | | | | | | | | | | | | | | | | | Instead of needing the engine method to lock, fetch, check and then update the flow state it is more appropriate if the storage class does all these actions itself (therefore hiding this change from the engine code, making the engine code that much smaller). Change-Id: I2a289c2bcabe76728fa8eb26265ce168abf81b7c
* | Merge "Ensure that the engine finishes up even under sent-in failures"Jenkins2016-04-281-0/+7
|\ \
| * | Ensure that the engine finishes up even under sent-in failuresJoshua Harlow2016-01-201-0/+7
| | | | | | | | | | | | Change-Id: Ic16c854d285398c688f132697c3bb7e637feb9a8
* | | Merge "Add some basic/initial engine statistics"Jenkins2016-04-281-1/+21
|\ \ \
| * | | Add some basic/initial engine statisticsJoshua Harlow2016-02-011-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can be quite nice to expose a basic set of metrics about the internals of an engine, including the time in each state, and how long the engine is active for and likely more in the future. To start add a engine statistics property and gather some basic timing data and place this data into this property for access (and/or introspection) by users. Part of blueprint gather-engine-statistics Change-Id: Ibc3c78755bd8ae779b52fc4772519f243a521576
* | | | Merge "Allow for revert to have a different argument list from execute"Jenkins2016-04-281-1/+5
|\ \ \ \
| * | | | Allow for revert to have a different argument list from executeGreg Hill2016-02-261-1/+5
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also allows for people to create Atom's with a different rebind or requires structure for the revert method, if desired. Implements blueprint: seperate-revert-args Change-Id: Ie7d13c8000ef08ff303481d486d1ba1cfbdeea44
* | | | Add the ability to skip resolving from activatingJoshua Harlow2016-04-041-0/+9
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can be useful for debugging a failure to be able to stop when a failure is detected so that the failure can be examined in more detail. This adds the ability to have a 'never_resolve' engine option which will skip such resolution attempts for these types of scenarios. Change-Id: If2386cba970e14c7168a6ff2d4fd4786bcd8e989
* | | Merge "Pass through run timeout in engine run()"Jenkins2016-01-261-2/+8
|\ \ \ | |/ / |/| |
| * | Pass through run timeout in engine run()Joshua Harlow2015-12-031-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can be quite useful to control the delay/timeout used during waiting periods via the run() method and not requiring the usage of run_iter() to achieve the same thing. This change makes it possible to pass the same timeout used in run_iter() to run() and have it be used in the engine internals. Change-Id: I3798ee14600a2d30e009abf1f273b5edbbe3f5ed
* | | Allow for alterations in decider 'area of influence'Joshua Harlow2016-01-091-42/+62
| | | | | | | | | | | | | | | | | | | | | | | | Christmas came early. Closes-Bug: #1479466 Change-Id: I931d826690c925f022dbfffe9afb7bf41345b1d0
* | | Move all internal blather usage/calls to trace usage/callsJoshua Harlow2015-12-171-6/+6
| | | | | | | | | | | | Change-Id: I415a81d3b6b15b17a9a91cc2a0681c159172a4e1
* | | Change engine 'self._check' into a decoratorJoshua Harlow2015-12-021-14/+38
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of having 'self._check' be called at the stat of every using function it can be made into a decorator and placed on the function instead. This way it is a little more explicit than having it called at the start of each method. This also adds a check to ensure the engine has been validated before it is ran (and the decorator takes into this into account as well). Change-Id: I67ee8fe8629392003f7777d4d4fab918b1a071dd
* | Merge "Move engine options extraction to __init__ methods"Jenkins2015-12-021-4/+51
|\ \
| * | Move engine options extraction to __init__ methodsJoshua Harlow2015-11-191-4/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of repeatedly extraction of engine options in local functions/methods, just extract the currently used options once (in using objects __init__ methods). This saves some repeated extraction and establishes the pattern of where engine options should be extracted going forward. Change-Id: I4d24f7badef61fdd69db22f59931c374c32986ff
* | | Merge "Convert executor proxied engine options into their correct type"Jenkins2015-11-241-7/+8
|\ \ \
| * | | Convert executor proxied engine options into their correct typeJoshua Harlow2015-11-181-7/+8
| | | | | | | | | | | | | | | | Change-Id: If0f213a0304bc336e95d72157cc2d4d402ebdd3f
* | | | Move validation of compiled unit out of compiler1.25.0Joshua Harlow2015-11-201-2/+19
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of having the compiler do any validation on the graph it has created instead have the compiler just compile and have the engine that uses that compiled result do any post compilation validation instead. This makes it more clear that the compiler just compiles a flow (and tasks and nested flows) into a graph, and that is all that it does. Change-Id: I96a35d732dc2be9fc8bc8dc6466256a19ac2df6d
* | | Add optional 'defer_reverts' behaviorGreg Hill2015-11-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible to REVERT a subflow and have it also revert the parent flow if the parent flow doesn't have its own retry strategy. We will probably want to make this new behavior the default or only behavior in a future release. Change-Id: Iea5ac366380ba7396a87d0185703549fb0c2f825
* | | Simplify flow action engine compilation1.22.0Joshua Harlow2015-10-011-15/+13
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | Instead of the added complexity of discarding flow nodes we can simplify the compilation process by just retaining them and jumping over them in further iteration and graph and tree runtime usage. This change moves toward a model that does just this, which makes it also easier to in the future use the newly added flow graph nodes to do meaningful things (like use them as a point to change which flow_detail is used). Change-Id: Icb1695f4b995a0392f940837514774768f222db4
* | Merge "Use the action engine '_check' helper method"Jenkins2015-08-011-4/+1
|\ \
| * | Use the action engine '_check' helper methodJoshua Harlow2015-07-251-4/+1
| |/ | | | | | | Change-Id: I0822bbf1caf28a8fd2b4e914643aca61ae0c7f45
* | Remove extra runner layer and just use use machine in engineJoshua Harlow2015-07-281-19/+34
|/ | | | | | | | | Just directly use the built machine in the action engine and avoid having another layer of abstraction that does not provide that much value. This makes the code cleaner, and more easy to understand (and so-on). Change-Id: Iae1279098112254338258c1941c15889f1ad1a79
* Merge "Add ability to reset an engine via a `reset` method"Jenkins2015-07-251-2/+13
|\
| * Add ability to reset an engine via a `reset` methodJoshua Harlow2015-07-181-2/+13
| | | | | | | | | | | | | | | | | | | | If an engines work was previously partially completed and it is desired to reset it (and re-run) so that partially completed or ignored (or other) work inside of it can run again make that possible by exposing and documenting a new `reset` method (and use it internally as well). Change-Id: I47f82010a2108d5d8fd5e42ca9f7e5f165e65488
* | Create and use a serial retry executorJoshua Harlow2015-07-211-7/+15
|/ | | | | | | | | | | | To make it easily possible to change the retry atom execution from being in the engine thread this creates a retry executor (which is similar to the task executor) and provide that a serial executor (which it will use to execute with). This makes the retry and task actions closer to being the same and makes the surrounding code that much similar (which makes understanding it easier). Change-Id: I993e938280df3bd97f8076293183ef21989e2dba
* Merge "Just make the compiler object at __init__ time"Jenkins2015-07-171-5/+1
|\
| * Just make the compiler object at __init__ timeJoshua Harlow2015-06-281-5/+1
| | | | | | | | | | | | | | | | There really isn't any benefit in delaying the local attributes creation until its first used so just upfront create the compiler object. Change-Id: I48c4342a6669077dd35f9cb8f25b5313d6814c8e
* | Merge "Retain atom 'revert' result (or failure)"Jenkins2015-07-151-2/+5
|\ \
| * | Retain atom 'revert' result (or failure)Joshua Harlow2015-07-101-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | When a atom is reverted it can be useful to retain the result of that 'revert' method being called, so that it can be later analyzed (or used for various purposes) so adjust the storage, and actions to enable it to be stored. Change-Id: I38a9a5f3bf7550e924468bb4a86652cb8beb306c
* | | Integrate futurist (and **remove** taskflow originating code)Joshua Harlow2015-07-091-1/+1
|/ / | | | | | | Change-Id: If89baa042695f19e42b6368034f3ccf22c2cf0aa
* | Merge "Add bulk `ensure_atoms` method to storage"Jenkins2015-07-081-1/+2
|\ \ | |/ |/|
| * Add bulk `ensure_atoms` method to storageJoshua Harlow2015-06-201-1/+2
| | | | | | | | | | | | | | | | | | | | The addition of this method will make it possible to optimize the many queries and updates that are performed when a engine is initially having its storage unit prepared. Part of blueprint make-things-speedy Change-Id: Ie812abfbeca97372be05bc13e5c1059278fbbf4c
* | Merge "Executors come in via options config, not keyword arguments"Jenkins2015-06-251-1/+1
|\ \
| * | Executors come in via options config, not keyword argumentsJoshua Harlow2015-05-111-1/+1
| | | | | | | | | | | | Change-Id: I5654b5db0db6b8e9884dae5cc285400edce2a698
* | | Split-off the additional retry states from the task statesJoshua Harlow2015-06-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split the states that are not task states (but are retry states) into there own additional set and then use that set and a new function to validate the transition at other locations in the code-base. This makes the transitions that are valid for tasks/retries easily viewable, more easy to read and understand, and more correct (instead of being a mix of task + retry atom transitions and states). Change-Id: I9515c19daf59a21e581f51e757ece2050f348214
* | | Merge "Remove all 'lock_utils' now that fasteners provides equivalents"Jenkins2015-06-151-5/+5
|\ \ \ | |_|/ |/| |
| * | Remove all 'lock_utils' now that fasteners provides equivalentsJoshua Harlow2015-06-041-5/+5
| | | | | | | | | | | | | | | | | | Depends-On: I442249783da4a6ae10c78b95e0b279409c95d2e6 Change-Id: I877928c858e8d6176d3f01ad9de2765104acf5c3
* | | Use shared '_check' function to check engine stagesJoshua Harlow2015-05-301-10/+13
|/ / | | | | | | Change-Id: I48e5efdb28ee834666ec1eca18f35f245de340d3
* | Expose action engine no reraising states constantsJoshua Harlow2015-05-111-1/+8
|/ | | | Change-Id: I65746fc7bc27f0b03e416eb6584df18bbc4a3053