One of the first things I told our CEO when I joined as the first engineering hire was to buy every engineer a 15″ Macbook Pro. I wanted to have a consistent development environment for my team. I created a Google Doc and at first I ran through this How-To personally on every new machine for every new hire. The last 3 or 4 hires were given this doc on their first day and their setup time became part of the “How quickly can I setup my dev box” game. The record is 4 hours but he had most of the dependencies setup. The longest was two days.
It’s All Fun and Games Until Someone Upgrades
In the last 18 months, Apple has changed the processors, memory, and countless other aspects of the 15″ Macbook Pro. OSX has gone from Snow Leopard to Lion to Mountain Lion. Ruby has gone from 1.8.7 to 1.9.3, Rails has gone from 2.3 to 3.1, and I can’t keep track of all the versions of gems that have changed. The development world–it changes fast. How bad could it be, really? Well, I include 4 different manual “patches” in that doc of mine to make mysql work. The working patch depends on whether you have 32-bit or 64-bit OSX, your version of Xcode and mysql, whether you used a tarball or a dmg, whether you use mysql or mysql2 gem, etc. Lately, I just tell new hires to try everything until they find something that works. Even for packages installed via macports, certain version of ports don’t install properly. Some of these can be fixed by editing the portfile with information culled from the Interwebs. Other times, people just give up and use the homebrew version. This is us at 10 engineers.
Development and debugging can often lead to situations where you try to find what is different about a working scenario and a broken one. If a test passes on my machine but not on yours, I don’t want to say “it could be because you’re using Rails 2.3 vs 3.2 or Ruby 1.8.7 vs 1.9.2” or god-forbid “it could be because you’re using Windows”. Ideally, I would like to say “it’s because you forgot to pull the latest code” or “your custom configuration file is not consistent with mine”. The more differences between one environment and another means the more variables to consider–follow the rabbit down the hole.
Just as rvm helps engineers manage Ruby versions and bundler, Ruby gems, Vagrant helps engineers manage their entire development environment. With the concept of “boxes”, an engineering team can build Virtual Machine images to suit their every need. Want to onboard a new hire? Give then a computer and have them load your team’s starter box in 5 minutes. Want to roll out security updates to all 500 of your engineers? Script everything up using Chef or Puppet and have everyone download a new box. Want to test how your app would run in Ubuntu rather than Gentoo or OSX? I just did that while writing this post. When do I really need vagrant? For small teams (2-3), you’ll probably live without Vagrant. However, if you want peace of mind or plan to scale, check it out now.