summaryrefslogtreecommitdiff
path: root/tools/state_graph.py
Commit message (Collapse)AuthorAgeFilesLines
* Use unittest.mock instead of mockHervé Beraud2021-04-271-1/+1
| | | | | | | | The mock third party library was needed for mock support in py2 runtimes. Since we now only support py36 and later, we can use the standard lib unittest.mock module instead. Change-Id: Ib169e3deb7ddb2bc93a206ebec4043552281aa7f
* Use automaton's converters/pydotJoshua Harlow2015-10-111-74/+55
| | | | | | | | | | | | This uses the automaton library's converters/pydot to generate the state machine diagram. It also regenerates the diagrams using this new code base. Depends-On: I968a15ebce839761d0a935ba6b22de64b3b7783c Change-Id: Ie59e093196d06c634378e4f4099f681b3c425aac
* Remove extra runner layer and just use use machine in engineJoshua Harlow2015-07-281-5/+5
| | | | | | | | | 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 "Replace internal fsm + table with automaton library"Jenkins2015-07-151-3/+5
|\
| * Replace internal fsm + table with automaton libraryJoshua Harlow2015-07-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | Instead of having our own inbuilt fsm and table library used to print the fsm states just use the newly created and released automaton that contains the same/similar code but as a released library that others can use and benefit from. Library @ http://pypi.python.org/pypi/automaton Change-Id: I1ca40a0805e704fbb37b0106c1831a7e45c6ad68
* | Retain atom 'revert' result (or failure)Joshua Harlow2015-07-101-1/+1
|/ | | | | | | | | 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
* Add support for conditional executionJoshua Harlow2015-07-011-5/+7
| | | | | | | | | | | | | | | To make it possible to alter the runtime flow via a simple conditional like structure make it possible to have the graph flow link function take a decider that is expected to be some callable that will decide (via a boolean return) whether the edge should actually be traversed when running. When a decider returns false; the affected + successors will be set into the IGNORE state and they will be exempt from future runtime and scheduling decisions. Part of blueprint taskflow-conditional-execution Change-Id: Iab0ee46f86d6b8e747911174d54a7295b3fa404d
* Merge "Refactor machine builder + runner into single unit"Jenkins2015-06-201-1/+1
|\
| * Refactor machine builder + runner into single unitJoshua Harlow2015-06-031-1/+1
| | | | | | | | | | | | | | | | | | There is really no need to seperate off the runner into a unit that builds a state-machine and then provides a tiny utility function, both of these can just be in the same class and code so that it is easier to understand/read. Change-Id: I18b97514e230451ef804a878a0edcea4d0b2ad20
* | Split-off the additional retry states from the task statesJoshua Harlow2015-06-181-9/+6
|/ | | | | | | | | | | | | | 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
* Add states generating venv and use pydot2Joshua Harlow2015-04-161-2/+3
| | | | | | | | Make it easier for others to create the states diagrams and use a non-broken pydot fork that is actually being maintained (pydot2). Change-Id: Ia16c53a513159a8f15c5d7c75e22553dc1273b37
* Add job states in docs + states in pythonJoshua Harlow2015-04-151-2/+11
| | | | Change-Id: I25af798974dbfe61e144b15056090084aa8ef6dd
* Add a WBE request state diagram + explanationJoshua Harlow2015-01-221-2/+17
| | | | | | | | To make it more clear what the WBE request states are and what they imply/mean add the appropriate documentation and diagram that explains it and its states/concepts. Change-Id: If25b5c6402aff6e294886cc6c5f248413183c4e4
* Use constants for runner state machine event namesJoshua Harlow2015-01-151-1/+8
| | | | | | | | | | | | Instead of using strings it is better if we can use constants (that may be the same/adjusted strings) and use those instead in the state machine used in the runner. The names are adjusted (and the state graph diagram and docstring) to reflect names that fit better with there intended meaning and usage. Change-Id: Iaf229d6e37730545ba9f2708d118697cb7145992
* Add edge labels for engine statesJoshua Harlow2014-12-211-2/+15
| | | | | | | | The engine state diagram benefits slightly from having the event labels that cause transitions to other states so we might as well include it in the generated diagram. Change-Id: I733eba1d2dc6386c7b7ce8930fbfd41e29cdb602
* Color some of the states depending on there meaningJoshua Harlow2014-09-201-4/+18
| | | | | | | | | | | | | Instead of just having black text color adjust some of the states text color depending on there type/name and highlight some as red, green, orange depending on there underlying meaning. Color names are from: http://www.graphviz.org/doc/info/colors.html Change-Id: I89f8f90837551a257936d254516ada6130e7b6da
* Update the state graph builder to use state machine typeJoshua Harlow2014-09-091-49/+73
| | | | | | | | | | | | | To build the state diagrams switch from using a custom algorithm that builds a state machine in a table to using our state machine class to build those same machines before translation into a dot diagram. This also allows us to use the state machine that already is being used in the action engine as the source of transitions to build the dot diagram with. Change-Id: I4a0d16a3fb7c620c2774b535ab952b5d5006e9e9
* Use the `state_graph.py` for all states diagramsJoshua Harlow2014-07-061-43/+94
| | | | | | | | | | | | | | | | | Switch to using the `state_graph.py` and dot output as the source of all of the state diagrams (this makes it easy for anyone to recreate them by just running the script in the tools directory). Also update the state diagram creator to have engine states as well as retry states and replaces all existing state diagrams with the updated prettified versions. Also adjusts some nits around wording and grammar that were encountered during this updating process. Change-Id: Ia783aed6c4136763e1e34cbd0b3e57ffb1109abe
* Add a directed graph type (new types module)Joshua Harlow2014-04-201-5/+3
| | | | | | | | | | | | | | | | Most of the utility graph functions we have can be connected to a directed graph class that itself derives (and adds on to) the networkx base class. Doing this allows for functionality that isn't exposed in networkx to be exposed in our subclass (which is a useful pattern to have). It also makes it possible (if ever needed) to replace the networkx usage in taskflow with something else if this ever becomes a major request. Change-Id: I0a825d5637236d7b5dbdbda0d426adb0183d5ba3
* Support several output formats in state_graph toolIvan A. Melnikov2013-10-171-17/+25
| | | | | | | | This commit adds -T aka --format option to state graph tool that can be used to specify output format. Supported values are 'dot', 'svg', 'svgz' and 'png'. Change-Id: I27a74b582726da24a1b05d4ffb72bde860fff417
* Add task state verificationJoshua Harlow2013-10-141-1/+9
| | | | Change-Id: I85abee2a1112ce1b9bb708cb9129f06c794f83b1
* Add state to dot->svg toolJoshua Harlow2013-10-071-0/+65
Add a helper tool that can convert the allowed state transitions into a dot graph which itself then converts it into a browser compatible svg file, which can then be looked at to have a pretty state diagram. Change-Id: I3cbbc75bd58182700ddc07f00395da5d1093a26c