by samsquire · 3y ago · 0 comments
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.
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/parallel-workers