Recently, I was working on instrumenting one of our recurring cron jobs to send runtime duration data to Graphite. To test this locally, I would need Graphite installed. Here are three different ways one could accomplish that task.
We have an internal wiki page that lists out the steps required to install Graphite locally on OS X. Although we modified it slightly, we started from this gist from relaxdiego. It’s roughly 12 steps. Not difficult by any means, but 12 more steps added to the development environment setup.
- Less moving parts. No VMs or other tools to learn here.
- Every developer will have to repeat these 12 steps.
- Potential issues between different OS versions and environments.
I’ve used Vagrant in the past, so I tried to spin up a Vagrant image instead. I used a shell provisioner and I could get most of the way there. I couldn’t figure out how to invoke the syncdb command and create the Django admin user from the shell.
- Developers can spin up a vagrant box with Graphite pretty easily
- If you have Vagrant working, there shouldn’t be issues between OS or environments.
- More moving pieces. Developers now also need to have Vagrant and VM software installed.
- Developers need to be trained to use Vagrant (although this is fairly straightforward.)
- VM overhead would become an issue if we wanted to do this for other pieces of infrastructure.
We have no current plans to move to Docker in production in the short term, but perhaps getting more familiar with Docker in development would help us in the future. It had been a year since I last used Docker on OSX with boot2docker so I decided to give it another shot. I installed the new OS X tools and tried out the new Kitematic UI. I picked hopsoft’s graphite-statsd image and with a few clicks, the container was up and running.
- I have to say I was pretty impressed by how easy this felt. It did take me some time to poke around and figure out the port settings and configurations.
- I understand that on OSX, boot2docker and Kitematic both spin up VMs, but if we wanted to go this direction, we potentially could spin up multiple containers with the overhead of 1 VM.
- Requires installation of VM software and Kitematic.
- Docker paradigm is more advanced and requires developers to learn how to use it.
- I’m not sure how to simplify the configuration of private IP address created by Kitematic, maybe just an entry in /etc/hosts?
- We have no internal knowledge on managing, orchestrating, configuring Docker containers.
All three of these approaches are viable. My feeling is that in the short to medium term, we’ll start investing more of our time in this type of developer tooling to help standardize our development environments and get new developers up and running quicker.
It seems like we’ll start by trying to package our platform into one Vagrant VM, or a set of Docker containers(things like cassandra, redis, kafka, zookeeper, graphite, etc). The second step would be to figure out if Docker could make our local development experience better and more efficient.
Have a lot of experience in this area and want to help us make the internet free for the next billion? Reach out to us.