How to Automate, Super Mario Style!
Posted in — Jan 09, 2017
How do developers, and FINE developers in particular, get so darn much done? A little thing called automation, whereby routine, simple tasks are scripted to be performed as though commanded by robot overlords or pawns in a video game. Here, our trusty DevOps Engineer Charlie Pitikin gives you a glimpse into how it’s done at *Boss Level.***
I’m a DevOps engineer. So, I get to automate things all the time. And I love my work. It’s complicated, though. Automation software, or even hardware, seems overly complex. People are intimidated by this. Automating a workflow does have its challenges, but if you look at it like a video game, then everything changes.
*Level One. *
As you begin, you are greeted with a basic challenge: go somewhere and do something! For example, grab that mushroom and get a little life buffer. Ask yourself:
“What’s the minor repetitive task (goombas are everywhere, for example) that users are doing inefficiently?”**Level Two. ** Now that automation is doable, things get a bit more complicated. Introducing, “the turtles!” Those things can come back to bite you if you’re not careful. In the meantime, formulate a plan. Pick something to automate. Things like database backups and code reviews live in this level. Don’t over complicate this process. You don’t want to spend a lot of time debugging a failed automated backup. Use a script in the language of your choice. Drop your data into whatever format your database uses and then copy it to another server for safe keeping. Eventually, you’ll move to a backup rotation system or use tools like rsync, etc.
Level Three. **
Level three presents a new hope. But, you also have to contend with new threats. Watch out for that boomerang, the hammer-throwing turtles, and the lava pits! In this level you’ll work on automating application alerts and adding auto remediation. Formulate your game plan and assess the situation before jumping across the pit. Your app could be crazy large with moving parts and a harried infrastructure. What is the one piece you need to function? Next, find a simple tool or write a script that tells you when something goes wrong and/or how to restart the service. I like mmonit for these types of things. It is small, easy to configure, and has an array of checks.
All right, you’ve made it to Boss Level. Bowser is waiting in the castle for you to rescue that princess. It’s not going to be easy, but we have flattened gumbas, jumped over lava, and dodged squid to get here. The boss level is where things like Puppet, Jenkins, and Docker live. Take them one piece at a time, and start by reading the docs. Next, see what you can do. Test early and often; one wrong jump and you’ll need a 1-UP mushroom. If you want to use Puppet, add users, groups, and main files or directories. Or you can use Jenkins to build code and run unit tests. Then as you learn where those safe spots are, you can get more complicated. With just a smidge more effort, you’ll rescue the princess and go back to Peach castle, or wander around Toadstool village with no worries.