Literate DevOps

As regular readers know, I’m a big fan of reproducible research. It makes it possible for anyone—even yourself—to reproduce all the steps of your research exactly as you performed it. A related concept, termed Literate DevOps by Howard Abrams, does the same thing for the building of deployment images.

The idea is that you can set up your system on a virtual machine and build the final system there. If you capture your steps as you go, you can then recreate the environment on the production server and perhaps recreate it on a virtual machine again to troubleshoot problems that come up during production.

There are tools such as puppet or chef that automate the deployment of systems and Abrams’ idea is that you use literate devops to build the recipes used by those tools. Abrams shows how to capture your steps, including the code, in an Org mode file. It’s possible to build the VM and then log into it from an Org mode code block. He shows how to you can arrange things so that the code blocks will be executed in the VM (or other external machine) right from an Org mode file on your local workstation. There’s a ton of interesting ideas in his post and it’s well worth a read.

Over at analogpixel there’s another nice post on the same subject that takes a slightly different approach. Rather than execute the code directly from Org mode, he uses the Org tangle command to export the code to files that can be executed later.

That post shows how to integrate the results into a puppet configuration so it’s worth reading as well. It’s an excellent alternate take on Abrams workflow.

Although these workflows aren’t really reproducible research, they share many of the same traits and can be used for the same purposes. Both authors mention that they can send the Org file (either natively or in an exported format) to colleagues to allow them to reproduce an environment or even to act as a go by for setting up other environments. If you’re doing DevOps type work, you should definitely take a look at these two posts.

This entry was posted in General and tagged , . Bookmark the permalink.