Recently, I moved to New York City. As a new resident, I decided to take part in the NYC DeveloperWeek hackathon, where our team won the NetApp challenge. In this post, I’ll walk through the product we put together, and share how we built a CI/CD pipeline for quick, iterative product development under tight constraints.
The Problem: Have you ever lived or worked in a building where it’s a pain to configure the buzzer to forward to multiple roommates or coworkers? Imagine that a friend arrives and buzzes your number, which is set to forward to your roommate who is visiting South Africa, and has no cell service. If you’re running late, your friend is just stuck outside.
The Product: We built a PBX-style application that integrations with Zang, and forwards a buzzer to multiple numbers, and even allows your friend to use a PIN on his phone to gain entry.
The constraint: For the hackathon, we had to use hardware that had already been setup and allocated.
Building our Hackathon CI/CD Pipeline
Our newly-updated eBook walks you through incorporating containers into your CI/CD pipeline. Download today!
For the competition, we knew that we wanted our builds scalable from the start, and that each deployment would snapshot our entire data environment pre-deployment using NetApp ONTAP (a sponsor of the Hackathon, and a really nice group of folks); if any deployment had an issue, we could simply and quickly roll back.
Fortunately, I am a firm believer in building stateless, Docker container-ready, rebuildable architecture; I can’t go back to the world that existed before: no real CI/CD, lots of SSH-ing into other systems, or SCP-ing data from one place to another. Thankfully, today we have tools and strategies that can help us.
Here’s what we used:
Rancher: awesome tool for deploying containers with Kubernetes (or Cattle), just about anywhere
Drone: a great, simple CI tool with a stateless build mindset built on top of Docker
NetApp ONTAP: Scalable and resilient data management software
and the basic steps we took:
Turn the NetApp server into a Rancher host
Create a NetApp snapshot plugin for Drone
Create the CI/CD pipeline with snapshots baked in
Now, let’s take a closer look at these steps.
Turn a NetApp Server into a Rancher Host
Assuming that you’ve already got Rancher up and running, create a new environment by going to Infrastructure -> Hosts on the navigation bar. Using the Custom host option, use the provided command to register the host with Rancher. It should look something like this:
After a few minutes, you should see the host show up in Rancher, and you’ll have the freedom to deploy any containers to it.
Creating a NetApp snapshot plugin for Drone
Plugins for Drone are just simple Docker containers, with environment variable injected. This means you can use it in any build system you have. In this case, running a simple command (as follows) will create a snapshot of the data volume you just created:
In this case, you get a full snapshot prior to any deployments. This then makes rolling back to a prior snapshot pretty quick and easy.
Rancher makes it simple to build these in a mixed environment, and I can’t imagine living in a world where it’s not around. Drone helps create simple build and delivery pipelines, and NetApp helps with simple snapshots. This all translates beautifully to corporate environments, where things may need to be hosted in a private cloud.
At Pelo.tech, we’re working on the next versions of these concepts, which will allow for complete, self-hosted applications that are highly available, highly scalable, and updated with simple blue/green deployments. Reach out to us if you’re interested in learning more about us and what we do!
Joachim Hill-Grannec (@lindyblues) is a Partner at pelo.tech, which helps organizations improve their dev practices and culture. These days, you’ll also find him traveling around the world dancing at West Coast Swing events.