,

Mission Administration as Code with Graphviz

files image

tl;dr

My group and I even were the employ of graphviz and git to get hang of challenge administration tasks.

It has a range of advantages, including:

  • Asynchronous challenge updates (ie fewer conferences)
  • Improved updates for customers
  • Visualisation of complexity of challenge for stakeholders and group
  • Assumptions challenged. Progress is also measured the employ of git itself (eg log)

HackerNews Discussion right here

 

 

 

Background

Not too prolonged within the past I’ve had to preserve shut on some challenge administration tasks, managing engineering for a somewhat huge-scale challenge in a huge enterprise conserving a huge selection of employ circumstances and demands.

One of many ultimate challenges was how you may per chance maybe be ready to staunch the dependencies that desired to be overcome to get hang of the enterprise outcomes the stakeholders wished. Cries of ‘we appropriate need x’ had been answered by me with varying degrees of quality over and over, and customarily left the stakeholders unsatisfied.

Being a map engineer – and not a challenge supervisor – by background or coaching, I naturally extinct graphviz as a change to form dependency diagrams, and git to manipulate them.

The examples listed below are in supply right here and I welcome PRs and are basically basically basically based on the ‘challenge’ of getting bright for a vacation.

Uncomplicated

We inaugurate with an easy graph with about a dependencies:

digraph G {
 "Revel in Holiday" -> "E book tickets"
 "Revel in Holiday" -> "Pack suitcase evening sooner than"
 "Pack suitcase evening sooner than" -> "Rob files e book"
 "Pack suitcase evening sooner than" -> "Rob electrical converter"
}

The emboldening is mine for illustration; the file is evident text.

This file is also saved as easy.gv (.gv is for ‘graphviz’) and may per chance maybe per chance generate this graph as a .png even as you speed dot -Tpng easy.gv > easy.png:

easy

Having a watch closer at easy.gv:

digraph – Tells graphviz that right here’s a directed graph, ie the relationships be pleased a direction, indicated by the -> arrows. The arrow is also read as ‘is dependent on’.

Revel in Holiday is the title of a node. At any time when this node is referenced in future it is miles the ‘similar’ node. Within the case of Pack suitcase the evening sooner than you may per chance maybe be ready to ogle that two nodes depend upon it, and it is miles dependent on one. These relationships are expressed thru the arrows within the file.

The dot program is portion of the graphviz package. Other commands consist of neato, circo and others. Check man dot to read extra about them.

This reveals how easy it is to form an easy graph from a text file easily saved in git.

Layouts

That high-down structure is also a chunk restrictive to some eyes. If so, you may per chance maybe be ready to trade the structure by the employ of one other tell within the graphviz package. As an illustration, running neato -Tpng easy.gv > easy.png produces this graph:

simple_undirected

Say how:

  • Revel in holiday is now nearer the ‘centre’ of the graph
  • The nodes are overlapping (we’ll address this later)
  • The arrows be pleased shortened (we’ll address this later too)

Whenever you happen to’re fussy about your diagrams you may per chance maybe be ready to utilize a range of time fiddling with them treasure this, so it’s vital to get hang of a feel for what the a range of commands assemble.

Colours

We’re going to have the selection to get hang of extra challenge files correct into a node by colorizing the nodes. I assemble this with an easy plot of:

  • green = performed
  • orange = in development
  • crimson = not began

Here’s an as a lot as this level .gv file:

digraph G { 
 "EH" [label="Enjoy Holiday",color="red"] 
 "BT" [label="Book tickets",color="green"] 
 "PSNB" [label="Pack suitcase night before",color="red"] 
 "BGB" [label="Buy guide book",color="orange"] 
 "BEC" [label="Buy electric converter",color="orange"] 
 
 "EH" -> "BT" 
 "EH" -> "PSNB" 
 "PSNB" -> "BGB" 
 "PSNB" -> "BEC" 
}

Running the tell

dot -Tpng simple_colors.gv > simple_colors.png

on this ends in this graph:

simple_colors

Two issues be pleased modified right here. Referring to the paunchy description of the node can get hang of silly, so ‘Revel in holiday’ has been referenced with ‘EH’, and related to a ‘imprint’, and ‘color’.

"EH" [label="Enjoy Holiday",color="red"]

The nodes are outlined in this form on the tip, after which referred to with their relationships on the tip. All sorts of attributes are on hand.

Nodes

Similarly, you may per chance maybe be ready to trade the attributes of nodes within the graph, and their relationships in code.

I obtain that with a flowery graph with some text in every node, a rectangular node makes for greater  layouts. Also, I treasure to specify the gap between nodes, and forestall them from overlapping (two ‘problems’ we saw sooner than).

digraph G { 
 ranksep=2.0 
 nodesep=2.0 
 overlap="false" 
 
 node [color="black", shape="rectangle"] 
 
 "EH" [label="Enjoy Holiday",color="red"] 
 "BT" [label="Book tickets",color="green"] 
 "PSNB" [label="Pack suitcase night before",color="red"] 
 "BGB" [label="Buy guide book",color="orange"] 
 "BEC" [label="Buy electric converter",color="orange"] 
 
 "EH" -> "BT" 
 "EH" -> "PSNB" 
 "PSNB" -> "BGB" 
 "PSNB" -> "BEC" 
}

By including the ranksep and nodesep attributes, we are able to affect the structure of the graph by specifying the gap between nodes of their putrid within the hierarchy, and separation between them. Similarly, overlap prevents the convey we saw earlier with overlapping nodes.

The node line specifies the characteristics of the nodes – in this case rectangular and black by default.

Running the same dot tell as above ends in this graph:

simple_node

which is arguably uglier than outdated ones, but these changes lend a hand us as the graphs change into extra advanced.

More Advanced Graphs

Compiling this extra advanced graph with dot:

digraph G {
 ranksep=2.0
 nodesep=2.0
 overlap="false"

 node [color="black", shape="rectangle"]

 "EH" [label="ENJOY HOLIDAYnWe want to have a good time",color="red"]
 "BTOW" [label="Book time offnCheck with boss that time off is OK, put in system",color="red"]
 "BFR" [label="Book fancy restaurantnThe one overlooking the river",color="red"]
 "BPB" [label="Buy phrase booknThey don't speak English, so need to know how to book",color="red"]
 "BT" [label="Book ticketsnDo this using Expedia",color="green"]
 "PSNB" [label="Pack suitcase night beforenSuitcase in understairs cupboard",color="red"]
 "BGB" [label="Buy guide booknIdeally the Time Out one",color="orange"]
 "BEC" [label="Buy electric converternDon't want to get ripped off at airport",color="orange"]
 "GTS" [label="Go to the shopsnNeed to go to town",color="orange"]
 "GCG" [label="Get cash (GBP)nAbout 200 quid",color="green"]
 "GCD" [label="Get cash (DOLLARS)nFrom bureau de change under arches",color="orange"]
 
 "EH" -> "BT"
 "EH" -> "BFR"
 "EH" -> "BTOW"
 "BFR" -> "BPB"
 "BPB" -> "GTS"
 "BPB" -> "GCG"
 "EH" -> "PSNB"
 "EH" -> "GCD"
 "PSNB" -> "BGB"
 "BGB" -> "GTS"
 "PSNB" -> "BEC"
 "BGB" -> "GCG"
 "BEC" -> "GCG"
}

gives this graph:

advanced

And with neato:

complex1

You may per chance additionally ogle the graphs watch plenty of reckoning on which structure engine/binary you make employ of. Some can also mosey neatly together with your purpose greater than others.

Mission Planning with PRs

Now that you just be pleased a feel for graphing as code, you may per chance maybe be ready to envision these into git and portion them together with your group. In our group, every node represents a JIRA label, and reveals its ID and summary.

A huge edifying thing about right here is that challenge updates is also asynchronous. Cope with a range of people, I work with engineers internationally, and their skill to communicate updates by this capability reduces communication friction critically.

As an illustration, the a range of day we had a graph representing our subsequent portion of labor that was looking too heavy for one tear. In must calling a assembly and mosey over every line item, I appropriate requested him to update the graph file and elevate a PR for me to take a look at.

We then workshopped the changes over the PR, and most attention-grabbing discussed about a aspects over the mobile phone. Fewer conferences, and extra instruct material-rich discussions.

Floor Assumptions

Beyond fewer and extra vibrant conferences, one other wait on is the purpose recording of assumptions at some level of the group. Surprisingly customarily, I even be pleased stumbled on hidden dependencies thru this capability that had both not been fully understood or discussed.

It’s moreover surfaced extra items of labor required to be triumphant within the answer, which has resulted in increasingly extra distinct tickets being raised that snarl in self belief to the purpose solution. The discipline of coding these up helps power these into the starting up.

Happier Stakeholders

While internal the group, the determining of what desires to happen is clearer, stakeholders clamouring for updates are clearer on what’s blocking the outcomes they need.

One other wait on is an elevated self belief within the project. There’s a doc that’s readily understandable they are able to dig into within the event that they must search out out extra. However the indisputable truth that there’s a clear graph of dependencies customarily suffices to persuade people that issues are below administration.

Alternate Views

At closing, listed below are some alternate views of the same graph. We’ve already considered dot and neato. Listed below are the others. I’m not going to model them technically as I’ve read the man page definitions and am none the wiser. They employ words treasure ‘outerplanar’ and ‘power-directed’. Graph rendering is an pleasant affair.

circo

complex_circo

fdp

complex_fdp

twopi

complex_twopi

patchwork

complex_patchwork

Code

Is right here.

Whenever you happen to know extra than me about graphviz and be pleased any improvements/attention-grabbing tweaks/solutions then please contribute.


Writer is currently working on the 2nd model of Docker in Apply 

To find 39% off with the code: 39miell2

Read More

What do you think?

0 points
Upvote Downvote

Total votes: 0

Upvotes: 0

Upvotes percentage: 0.000000%

Downvotes: 0

Downvotes percentage: 0.000000%