Skip to content

A tool for visualising the dependency graph of Salt states.

Notifications You must be signed in to change notification settings

genesis-matrix/flowstate

 
 

Repository files navigation

Introduction to FlowState (for Saltstack)

Purpose

FlowState is a tool for visualising the runtime dependency graph of a Salt highstate.

It takes the json output of state.show_highstate or state.show_sls from Salt and produces a program written in dot, which is a tool from Graphviz for defining an acyclic graph.

States are nodes and dependencies are edges. require and require_in are blue; watch and watch_in are red.

Some examples, with the dot programs rendered as png:

http:https://i.imgur.com/wETR0WG.png

http:https://i.imgur.com/LJ6ckzr.png

Usage

The tool expects the JSON output of show_highstate or show_sls over stdin. It outputs dot code representing the dependency graph. The dot code defines a single digraph called “states”.

For example, if you have a salt master running:

salt 'minion1' state.show_highstate --out json | flowstate

You can write the dot output to a file, or pipe it further into the `dot` tool from GraphViz. In this example, we produce a png called `output.png`:

 salt 'minion*' state.show_highstate --out json \
	| flowstate \
	| dot -Tpng -o output.png

The tool currently only supports rendering the output from one minion. If you give it output with two minions, it’ll report an error.

Installation

Install directly from PyPi:

pip install flowstate

Or clone this repository and use setup.py:

python setup.py install

Unfortunately, the version of the pydot package in PyPi doesn’t work in Python 2.7+. We’re working on getting this up to date. In the meantime, please use this fork to install the `pydot` package first:

https://github.com/nlhepler/pydot

dot

Most operating systems have a package for it, usually as part of GraphViz.

  • Debian / Ubuntu
    apt-get install graphviz
        
  • OSX with homebrew
    	brew install graphviz
        

Acknowledgements

About

A tool for visualising the dependency graph of Salt states.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.4%
  • Emacs Lisp 3.6%