3 ms·
I use NetworkX rather unusually to parse Graphviz dot specification files in my devops pipeline tool, mazzle. They allow me to define infrastructure build inst
by samsquire 4y ago
I use NetworkX rather unusually to parse Graphviz dot specification files in my devops pipeline tool, mazzle.
They allow me to define infrastructure build instructions as a dot file that looks similar to this. It's similar to an advanced makefile.
This segment of the infrastructure specification sets a dependency on the bastion box, the vault AMI (Amazon Machine Image) and web server provisioned by terraform on the source AMI. Then it sets a dependency of uploading nodejs to the repository server and a dependency on dpkg scan packages. It also tells machines to join themselves to a Kubernetes cluster.
digraph G {
label="pipeline";
rankdir=TB;
"packer/source-ami*" -> { "terraform/bastion";
"packer/vault-ami*";
"terraform/web"
}
"terraform/bastion" -> "@repository-upload/nodejs_12.13.1_amd64"
"terraform/repository" -> "@repository-upload/nodejs_12.13.1_amd64"
"@repository-upload/nodejs_12.13.1_amd64" -> "@shell/dpkg-scanpackages"
"terraform/web" -> "@ansible/kubernetes-join";
"terraform/bastion" -> "@ansible/kubernetes-join";
"terraform/services" -> "@ansible/kubernetes-join";
"@ansible/kubernetes" -> "@ansible/kubernetes-join";
...
}
Graph formats are really flexible and compact and I would like to see them used for more things.
A topological search solves many problems.
https://devops-pipeline.com/ https://devops-pipeline.com/
- samsquire 4y agoI should add, I also use the resulting dependency graph to parallelise the build. So if there's two packer builds that do not depend on eachother, they can run in parallel since they are slow. https://github.com/samsquire/devops-schedule https://github.com/samsquire/devops-schedule https://github.com/samsquire/parallel-workers https://github.com/samsquire/parallel-workers
- VectorLock 4y agoNice I like the concept of turning around Graphviz dot files and turning them from an intermediate representation of visualization into the actual source of truth for the system. Cool idea.