Writing Drought is Over
My writing in 2017 and 2018 has been quite sparse, for good reason. Thankfully, this has ended and a raft of articles will be published soon. There were two reasons for the drought, one is personal which I won't talk about and the other which is technical. The technical impediment was of my own making.
This website is built with Middleman and rendered into static HTML files, then uploaded to CloudFront. I like the simplicity of it all, and writing in Ruby still makes me happy. It's also fast, secure and reliable.
…or so I thought it was reliable. In reality I had forgotten the key lesson of infrastructure and SRE: repeatable builds.
Enter Rubygem Upgrade Woes
Middleman is built on Ruby, and distributed as a gem through Rubygems. When I upgraded by Ruby (from 2.3 to 2.4) it also needed an upgrade of all the gems that Middleman uses. One of the gems would refuse to build its native extension and I hadn't the time or energy to figure it out. As a result, I was left with a broken build on my machine. I was still writing, but not publishing to CloudFront.
What I forgot is that if your application depends on libraries to be compiled and linked at runtime, that means there is a chance it may fail. If you are upgrading a lot, you are raising the probability of hitting failure. If your libraries are dynamically linked and shared, you could upgrade a gem for another application and break it for another application.
What you want to do as an SRE, infrastructure developer, or system administrator, is to reduce the amount of change between releases of your application. You also need to increase the isolation between different applications, so one application can't break the dependencies of another application (docker is useful here).
Where to Now?
I'm currently looking at replacements so I don't have Middleman breaking on me again. I'm looking at Hugo, which is built on Go and is distributed as a single statically-linked binary. This means I can embed the binary into my project and control the release/upgrade cycle so I don't break the project again.
The downside of using Hugo, from what I can tell, is that it enforces a different path for files, which would break existing bookmarks and search engine links. I'm hoping I can find a fix for this in Hugo to make it easier to migrate. If you already know the fix, let me know on Twitter.