Imagine There’s No Server

It's easy if you try

Imagine you manage hundreds of heterogeneous servers, each requiring frequent independent deployments.  In addition, for each new service that’s developed, resources need to be provisioned and deployment scripts written.  All of this overhead adds up to significant developer time that could be better spent building new products and improving existing systems.

A few months ago, we identified a set of Apache open source projects, Aurora and Mesos, that would reduce and sometimes even eliminate this overhead.  Since then, we’ve begun transforming our infrastructure from many individually managed services, each with their own deployment processes and scripts, to a single platform: Aurora.  In doing so, we’ve contributed significantly to Aurora, and are excited to see a new major version released today that includes our contributions.  We’ve been running a parallel version in production for several months without issue and hope that other organizations can benefit from it as well.

 

There is no server: Aurora + Mesos

Aurora is a framework that runs on top of Mesos.  It allows scheduling of jobs (web servers, backend services, etc) onto a pool of servers.  Along with Mesos, Aurora abstracts away conventional per-machine resources such as CPU, RAM, and disk in a way that allows a job to simply request a certain amount of each; Aurora + Mesos will ensure it runs with the requested resources.

 

Don’t we need the server?

We run a heterogeneous environment (Java, Python, C++, etc.) and many of our applications have their own third party dependencies.  In its initial design, Aurora was intended to primarily run self-contained applications with few to no system dependencies.  Typically, the first step of a job would be to download the application and dependencies, then execute the application.

With our applications, it would be neither desirable nor feasible to install all of the dependencies for our applications on each Aurora machine, nor was it practical to have each application download its dependencies when it ran.  We realized that we needed to somehow package and isolate our applications in a different way than we had previously, and Aurora needed to support whatever system we chose.

 

There ought to be a better way…

We decided to use Docker to create containers for our applications.  Doing so allows us to easily isolate our applications, as well as package all of their dependencies into one unit of deployment.  Using Docker containers also helps us to streamline and standardize our deployment process– developers can simply push a new image to our Docker repository instead of having to write their own deployment scripts.

 

… so we built one.

The last challenge we had to solve was the most difficult one: Aurora had no first class support for running applications inside Docker containers.  After talking with the Aurora community, we learned that this had been a long-requested feature, but no one had taken on building it yet.  We decided to build it for ourselves, and then contribute it back to the project.  During development, we collaborated frequently with the Aurora community on design decisions and code reviews. We found them to be consistently helpful, not to mention an overall great group of people to work with.

With our enhancement, Aurora now has first class support for Docker containers.  Developers can now simply add a Docker image name to their Aurora job configuration and Aurora + Mesos will handle the rest: pulling the image, setting it up on the machine, and running it.  The results have been met with great feedback, both internally from our developers and externally from the Aurora community.  In many cases, our deployment times have gone from over an hour to minutes, with the added benefits of never having to write a deployment script again.

 

We hope you like it

Support for Docker in Aurora was merged into the main Aurora branch about two weeks ago, and today, it’s included in their major 0.7.0 release.  We’re all excited for this release, and hope to contribute more in the future.

Below you will find a video from a recent Bay Area Mesos User Group meeting at Twitter HQ explaining the use of Aurora and Mesos at TellApart.

 

 

Interested in helping us make future commits to this project? Check out our careers site.

 

Steve Niemitz is a Software Engineer at TellApart.