summaryrefslogtreecommitdiff
path: root/taskflow/engines/action_engine/compiler.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Quote string representations"5.0.0Zuul2022-06-131-1/+2
|\
| * Quote string representationsMichael Johnson2022-06-101-1/+2
| | | | | | | | | | | | | | | | networkx 2.8.3 will raise errors if certain characters, such as a colon, in the node names and the string is not quoted. This patch double quotes flow, node, and task string representations to make sure there are not issues with these characters occuring in the names. Story: 2010083 Change-Id: Ib0941cddf14dde5d6b9f97fe0224d6e6f3975226
* | Remove sixTakashi Kajinami2022-05-181-2/+1
|/ | | | | | | | 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
* Update TaskFlow for networkx 2.xMichael Johnson2019-10-181-3/+3
| | | | | | | | | | | 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
* Fix some misspellings in the function name and descriptionsPablo Iranzo Gómez2016-06-301-4/+4
| | | | Change-Id: I7e3451feb94b1f25b00c5e7b197bb6b527548306
* Refactor Atom/BaseTask/Task/Retry class hierarchyGreg Hill2016-02-181-1/+1
| | | | | | | | * Moved common argument mapping logic to Atom * Removed BaseTask * Removed duplicated logic from subclasses Change-Id: I275745adb80cecb0c35c1230eac76436bf3b0157
* Allow for alterations in decider 'area of influence'Joshua Harlow2016-01-091-16/+73
| | | | | | | | Christmas came early. Closes-Bug: #1479466 Change-Id: I931d826690c925f022dbfffe9afb7bf41345b1d0
* Merge "Use 'match_type' utility function instead of staticmethod"Jenkins2016-01-091-15/+11
|\
| * Use 'match_type' utility function instead of staticmethodJoshua Harlow2015-12-141-15/+11
| | | | | | | | | | | | | | | | The utility method allows for moving the logic of which item compiler handles which type to the main compiler class instead of having it in each per compiler instance. Change-Id: Iec578b846a879cbff40f2c50ce865eb260b073e8
* | Move all internal blather usage/calls to trace usage/callsJoshua Harlow2015-12-171-8/+8
|/ | | | Change-Id: I415a81d3b6b15b17a9a91cc2a0681c159172a4e1
* Move validation of compiled unit out of compiler1.25.0Joshua Harlow2015-11-201-15/+16
| | | | | | | | | | | | | 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
* Allow provided flow to be emptyJoshua Harlow2015-11-201-6/+0
| | | | | | | | If someone really wants to provide a flow to run that is empty that is there prerogative so it doesn't seem that valuable to blow up if they do this. Change-Id: I0ad89b0ade85a64f6ec107e2686454ef6dc97353
* Simplify flow action engine compilation1.22.0Joshua Harlow2015-10-011-176/+85
| | | | | | | | | | | | | | 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
* Show intermediary compilation(s) when BLATHER is enabledJoshua Harlow2015-08-021-13/+16
| | | | | | | | | This information can be useful for analyzing why/what is generated during each intermediary flow/subflow and task compilation call so include showing it when and only when the BLATHER level logging is on. Change-Id: I8e9508b8250533a4830fe78705d867139b1eab36
* Replace the tree 'pformat()' recursion with non-recursive variantJoshua Harlow2015-07-271-2/+3
| | | | | | | | | | | | | This adjusted variant creates the same output but is hopefully easier to understand and follow than the recursive version. This version is also not limited by the python stack limit which is a general good thing to avoid being limited by. It also adds a bunch of tests to make sure the format is as expected under various tree structures. Change-Id: I2ae42c7c1bf72794800929250bcf6ccbe658230b
* Remove all 'lock_utils' now that fasteners provides equivalentsJoshua Harlow2015-06-041-2/+3
| | | | | | Depends-On: I442249783da4a6ae10c78b95e0b279409c95d2e6 Change-Id: I877928c858e8d6176d3f01ad9de2765104acf5c3
* Merge "Use ordered[set/dict] to retain ordering"Jenkins2015-03-121-4/+13
|\
| * Use ordered[set/dict] to retain orderingJoshua Harlow2015-03-111-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using always using a set/dict which do not retain use a ordered set and a ordered dict for requires, optional, and provides and rebind mappings types so that the ordering of these containers is maintained later when they are used. These ordering can be useful depending on the atom type (such as in a map and reduce tasks). Partial-Bug: 1357117 Change-Id: I365d11bbba4aa221bc36ca15441acecf199b4d56
* | Specialize checking for overlapsJoshua Harlow2015-03-051-1/+11
| | | | | | | | | | | | | | | | | | | | | | When merging a child graph into it's parents graph we can specialize checking for overlaps to avoid some of overhead of the default subgraph algorithm (which builds a full graph, with edges) since we only care about the number of duplicate nodes (not needing a full subgraph with retained edges). Change-Id: Ib211460c58efca3ddb5a254da11aafe44716a639
* | Use compilation helper objectsJoshua Harlow2015-03-031-77/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using instance methods to perform the compilation of tasks and flows instead move the logic of those functions into tiny helper classes that just perform the compilation of specific types they handle. This makes it more easy to document and understand how a flow or task type is compiled down into a graph and a tree node (which may or may not be attached to a parent tree node). Change-Id: Ib74edcad44556a897a4300132066e89d97739814
* | Tweak functor used to find flatteners/storage routinesJoshua Harlow2015-03-021-21/+8
|/ | | | | | | | Make both of these finding functions use similar routines that the utility module now provides since the logic that both use can be shared. Change-Id: Ib941b99945d42f5c0d791e9b2a0696d0e62a2388
* Fix unused and conflicting variablesChangbin Liu2015-01-151-1/+1
| | | | | | | | Prefix '_' to denote unused variables Suffix '_' to avoid conflicting with Python built-in funcs Change-Id: I4e0d0b8f88e5c93222fbd7f8dc7cf626923f738e
* Use explict 'attr_dict' when adding provider->consumer edgeJoshua Harlow2014-12-111-5/+10
| | | | | | | | | | Instead of using the less explicit **kwarg support when adding an edge between a explicit producer and consumer use the 'attr_dict' keyword argument instead and use the constant defined the the flow module as the key into that dictionary (this also ensure that the key will be adjusted automatically if that key value ever changes). Change-Id: Ieeae83b984b7797320997c0c4cb4289eb1a837ee
* Properly handle and skip empty intermediary flowsJoshua Harlow2014-12-101-46/+234
| | | | | | | | | | | | Instead of linking nodes which have elements to predecessors which do not we should search backwards through the prior predecessors and link to one that does have nodes; this ensures that we do not create bad workflows when empty flows are injected. Fixes bug 1392650 Change-Id: Ic362ef3400f9c77e60ed07b0097e3427b999d1cd
* Add and use a new simple helper logging moduleJoshua Harlow2014-12-081-8/+8
| | | | | | | | | Add a new logging BLATHER level to easily allow its usage for messages that are below the normal DEBUG level such as compilation information and scope lookup info which can be very verbose in logs if always enabled. Change-Id: I828211403bd02bfd6777b10cdcfe58fb0637a52c
* Use constants for link metadata keysJoshua Harlow2014-10-181-9/+9
| | | | | | | | | | | | Instead of using strings (which can be easy to mistype and get wrong), provide a set of constants that can be used to attach and use these keys in flows and at compilation. This also helps make it more clear what the keys do and where they are used. Change-Id: I5283b27617961136a4582bbcfce4617f05e8dd1d
* Revamp the symbol lookup mechanismJoshua Harlow2014-09-081-92/+85
| | | | | | | | | | | | | | | | | | To complement the future changes in patterns we also want to allow the execution of patterns to be affected in a similar manner so that symbol lookup is no longer as confined as it was. This change adds in the following: - Symbol lookup by walking through an atoms contained scope/s. - Better error messaging when symbols are not found. - Adjusted & new tests (existing ones work). - Better logging of the symbol lookup mechanism (helpful during debugging, although it is very verbose...) Part of blueprint taskflow-improved-scoping Change-Id: Id921a4abd9bf2b7b5c5a762337f8e90e8f1fe194
* Merge "Increase usefulness of the retry component compile errors"Jenkins2014-06-291-2/+12
|\
| * Increase usefulness of the retry component compile errorsJoshua Harlow2014-06-091-2/+12
| | | | | | | | | | | | | | | | Adjust the descriptiveness of the errors raised when a retry atom is used in a flow or as the root item of a to help users understand why the error is raised. Change-Id: Ia3e13382d49e2225d48b2ae875061f92c211093c
* | Upgrade hacking version and fix some of the issuesJoshua Harlow2014-06-131-7/+8
|/ | | | | | | | | | | | | | | | | Update hacking to the new requirements version and fix about half of the new reported issues. The other hacking issues are for now ignored until fixed by adjusting our tox.ini file. This commit fixes the following new hacking errors: H405 - multi line docstring summary not separated with an empty line E265 - block comment should start with '# ' F402 - import 'endpoint' from line 21 shadowed by loop variable Change-Id: I6bae61591fb988cc17fa79e21cb5f1508d22781c
* Rename the graph analyzer to analyzerJoshua Harlow2014-06-031-5/+13
| | | | | | | | | | | | Adjust the graph analyzer to be a more generic compilation analyzer which analyzes compilation objects (which are now changed to be an object and not a named tuple) and provides utility functions ontop of that object. This helps it become possible to provide other useful analysis functions that are not directly tied to the execution graph component but can be provided ontop of other compilation components. Change-Id: I2ab08db4f566d5f329d7e79b1c50ed65aad9e4b3
* Move flattening to the action engine compilerJoshua Harlow2014-05-301-2/+158
| | | | | | | | Since flattening is only one way to compile a flow and nested flows and atoms into a compilation unit move this functionality into the engine module where it is used. Change-Id: Ifea6b56cf5f2a9c1d16acabfaae6f28aeb6534a0
* Create and use a new compilation moduleJoshua Harlow2014-05-211-0/+49
To allow compilation into an execution graph to be done via other methods than our pattern flattening concept create a module that defines what a compiler should do and what the expected return type from compilation of a atom/flow is and how it will be used by our existing engine types. Part of blueprint plug-engine Change-Id: I324172571f36a574195bcdeac71c6ec14cb11944