Jeff Dean's blog



Jeff DeanJeff Dean
Introducing AutoTagger - easy multi-stage deployment tagging with git
edit Posted by Jeff Dean on Monday March 30, 2009 at 12:32AM

AutoTagger is a gem that helps you automatically create a date-stamped tag for each stage of your deployment, and deploy from the last tag from the previous environment.

Let's say you have the following workflow:

  • Run all test on a Continuous Integration (CI) server
  • Deploy to a staging server
  • Deploy to a production server

You can use the autotag command to tag releases on your CI box, then use the capistrano tasks to auto-tag each release.

Jeff DeanJeff Dean
Speeding up slow Cruise Control response times
edit Posted by Jeff Dean on Tuesday March 10, 2009 at 03:52PM

We use Cruise Control on our Continuous Integration server and we have several ways of getting alerts about the status of the build, including email, RSS and the Cruise Control web interface.

Recently we noticed that the web interface and the rss feeds were taking very long to respond, on the order of 1 minute or more. After poking around, we realized that we had hundreds of serialized builds still on disk.

$ cd ~/OurCruiseDirectory/projects/OurProject 
$ rm -r build-*

Then, to make sure this doesn't happen again, we edited our OurCruiseDirectory/site_config.rb site_config.rb to decrease the number of builds we keep:

BuildReaper.number_of_builds_to_keep = 20

So it appears that the time Cruise Control responses take is directly proportional to the number of builds saved on the server.

Jeff DeanJeff Dean
New York Standup 3/4/2009
edit Posted by Jeff Dean on Thursday March 05, 2009 at 05:08PM

Interesting

While this has been mentioned before, naming an ActiveRecord association :target will cause infinite recursion. Especially lame if you are building an app for assassins or mobsters.

The tracker team upgraded to 2.2 and saw a big increase in the size of their mongrels, and much longer start-up times.

In an erector widget it appears that respond_to? checks arity. For example:

self.respond_to?("some_method") # => false
self.respond_to?("some_method", some_value) # => true

Jeff DeanJeff Dean
Moving from Subversion to Git
edit Posted by Jeff Dean on Thursday October 16, 2008 at 01:58AM

Moving from Subversion to Git

We recently moved our project from subversion to git, and so far the move has gone very smoothly. The following post will detail what we did to make the move.

Our setup

For this project there 2 pairs working and we have 6 machines and one hosted service:

  • Two Mac OSX workstations with IDEA
  • One continuous integration server running Cruise Control
  • A staging server running a 2-year old version of Ubuntu
  • A subversion server
  • A production server hosted on Engine Yard
  • A Github account with the ability to create private repositories

The goal was to have one pair continue to work while the migration from svn to git was happening.

Jeff DeanJeff Dean
New York Standup 10/9/2008
edit Posted by Jeff Dean on Thursday October 09, 2008 at 01:29PM

Helps

What is capistrano multistage?

  • A plugin that allows you to store environment-specific variables in different files, and specify a default environment
  • It's been on tracker for a while and seems to be stable
  • Other options are just specifying your environment-specific variables within separate tasks - keeping everything in one file

Jeff DeanJeff Dean
New York Standup 10/7/2008
edit Posted by Jeff Dean on Wednesday October 08, 2008 at 01:10PM

Interesting Things

When you specify a gem from a custom source, and it has dependencies on a separate source, you need to list both sources in geminstaller.yml.

This comes up when you are installing a gem from github and that gem depends on other gems from rubyforge. You can specify multiple sources by adding more --source attributes.

Jeff DeanJeff Dean
New York Standup 10/6/2008: Partial Counters
edit Posted by Jeff Dean on Monday October 06, 2008 at 01:27PM

Interesting Things

  • When using standard rails partials you always have a local variable named _counter. In previous versions of rails, the partial_counter variable was set to 0 when you passed an object, and set to 1 for the first item in a collection. Now it appears to start at 0 whether you pass an object or a collection.

  • Brian Takita has begun work on chaining doubles in RR

Other articles: