Work From Home to automated ChatOps: A story of Infrastructure Deployments

Work From Home to automated ChatOps: A story of Infrastructure Deployments

I recently participated in the HackOn Hackathon, a pan-India hackathon sponsored by some big names in the tech world: Google, GitHub, Elastic, IBM, Zulip, and Devfolio.

I was stuck at home due to the COVID-19 pandemic and wanted something fun to do when my friend Pragati (who was also my teammate for the hackathon) told me about HackOn. Naturally, we were in.

If you’d like to skip to the code directly, you can find the GitHub repository here.

The inspiration

We were initially brainstorming ideas, when I remembered something my dad had said. I’m interested in all things tech, which apparently includes anecdotes about corporate culture and happenings. One of these anecdotes involved the Operations head of the project my dad was working on.

The Ops head had apparently been stuck in a rural area with poor network connectivity, no corporate laptop, and only a smartphone with mobile data. Apparently, he’d walked some people through deploying cloud infra over a call, but let’s not digress.

This got us thinking; what if we could deploy cloud infra from a phone, just using a simple chat interface? This seemed to fit right in with the Zulip problem statement of the hackathon. And thus we got to work.

A bot takes shape

I’ve been interested in DevOps for years, and I knew right off the bat what I wanted to use for actually deploying the infra: Terraform. This awesome tool by HashiCorp works with every single cloud provider out there, effectively making this a universal deployment platform.

As for the interface, I was originally planning to go for a simple command-based bot, but Pragati suggested that we spice things up a bit by implementing NLP using DialogFlow.

I ended up writing the Terraform deployment configs, while Pragati worked on custom DialogFlow intents and entities. We wrapped this up together neatly in a Zulip bot written using their Python SDK.

The bot can understand natural language and take the necessary action. A demonstration video is available below.

Our HackOn experience

Both of us love participating in hackathons, so it’s no surprise that we enjoyed this one as well. We ended up learning new ways to collaborate when working remotely and had a blast actually testing it out. NLP/ChatOps is fun!

The primary communication channel (Telegram) chosen by the organizers was particularly convenient for me, considering I spend most of my time online there, so that’s another plus.

Seeing this confluence of talented developers in a single place was a bit overwhelming and frankly triggered my Impostor Syndrome, but we ended up chatting with everyone and even made a few friends along the way.

What’s next?

This project was intended as a fun little diversion, but we hadn’t actually anticipated how powerful it could be. Considering this now, we’ve made the project open source for other contributors, and are planning to actively maintain it (and make it viable for use in actual production environments).

Also, in the long run, we’d like to add a snazzy metrics dashboard, along with application monitoring using something like Sentry.

In our closing statement, we’d just like to say thank you to everyone who helped us out, and encourage people to go outside their comfort zone and take part in fun events like these.