Rudy - v0.6 ALPHA

Rudy is a command-line development and deployment tool for Amazon Web Services. It helps you build and manage machines in EC2 by organizing them into groups of environments and roles. These are called machine groups. stage is the default environment and app is the default role. You can run multiple machines with the same role. These are called positions. Rudy also supports running machine groups across availability zones.

When you put all this together, you have a unique name for every machine. The default machine is:

        zone     env  role
         v        v    v   
   m-us-east-1b-stage-app-01
   ^                       ^
"machine"                position

All configuration is organized into the zones, environments, and roles that you specify (Rudy assumes positions are identical which is important for backups and scaling). And as you’d expect, the defaults can be changed too (in ~/.rudy/config). See below for usage examples.

NOTE: This is an ALPHA release. That means Rudy’s not ready for production use! See Alpha Warning.

Features

  • Single command startup and shutdown

  • Automatic disk creation. Define disks with a DSL and Rudy does the dirty work (creates EBS volume, attach to instance, format, and mount).

  • Supports any Amazon machine image (AMI) (Windows images should work but need more testing)

  • Complete command-line interface for EC2 (a replacement for Amazon’s API tools). See bin/rudy-ec2.

  • Basic command-line interface for SDB and S3 (create and delete buckets and volumes). See bin/rudy-sdb and bin/rudy-s3.

Installation

Step 1 of 2 (get Rudy on to your machine):

Via Rubygems, one of:

$ sudo gem install rudy
$ sudo gem install solutious-rudy --source http://gems.github.com/

or via download:

NOTE: If you are not installing via RubyGems, you need to make sure the dependencies are in your LOAD_PATH ($:). Ryan Tomayko wrote a gist[http://gist.github.com/54177] about it.

Step 2 of 2 (initialize your configuration):

$ rudy generate-config
  [edit ~/.rudy/config with your Amazon Web Services credentials]
$ rudy init

NOTE: You need an Amazon[http://aws.amazon.com/] account to use Rudy. Sign up for EC2[http://aws.amazon.com/ec2/], SimpleDB[http://aws.amazon.com/simpledb/], and S3[http://aws.amazon.com/s3/]

Example – Launch a Machine Group

Machine groups are named after the current environment and role. The default machine group is stage-app. In this example, Rudy will create the default machine group from scratch.

Note: Make sure your ~/.rudy/config contains your AWS credentials

We need to tell Rudy what this machine group should look like. We can generate a default machine configuration with this command:

$ rudy config --rudy > Rudyfile

This will generate a config file called Rudyfile which contains a default machines and routines configuration. The machine configuration describes the “physical” characteristics of your machine groups. The routine configuration describes what happens when you startup and shutdown a machine group (Rudy refers to these as routines).

We can launch the default machine group (stage-app) with this command:

$ rudy startup

You now have a new EC2 instance called m-us-east-1b-stage-app-01 to work with. You can log into it with:

$ rudy -u root ssh

The -u root tells Rudy to open a connection as the root user. If you create an account on that instance, you can login as that user too. When you don’t feel like paying for the instance you can run the following command to destroy it forever:

$ rudy shutdown

Dependencies:

Common Errors

  • "fingerprint ... does not match for 'ec2-11-22-33-44.compute-1.amazonaws.com,11.22.33.44'"

    • This means the host SSH key for that machine does not match your ~/.ssh/known_hosts file. Most EC2 images generate new host SSH keys on the first boot so is the most likely cause for this error message (it’s safe to continue). If this is not a new instance, you should tell Rudy not to continue and investigate manually.

  • "`require': no such file to load -- logger (LoadError)"

    • You’re probably running a mix of Rubygem and non-Rubygem libraries. Ryan Tomayko has you covered: gist.github.com/54177

  • "The request signature we calculated does not match the signature you provided."

    • Check that your Amazon Web Service access key and secret key are correct

  • "AWS was not able to validate the provided access credentials"

    • If it’s a new Amazon Account, you need to sign up for EC2, SDB, and S3.

Alpha Warning

Although Rudy has been well tested and is currently being used in production in a private beta, it’s not ready for general production use. There are a few things to keep in mind while Rudy is in alpha status.

  • If you already have private SSH keys, back them up. Rudy is quite safe but hasn’t been audited so backup your keys as a precaution.

  • If you’re running EC2 instances in production, create a new set of AWS credentials (access key and secret key) to use with Rudy. This will ensure that Rudy has no access to your production instances.

  • Rudy commands and APIs may change in later releases. This means that if you create an environment with an alpha release and later upgrade Rudy, some things may not work as expected.

More Info

Thanks

  • The Rilli.com team – for the initial use case, the ongoing feedback and support, and the good times!

    • Adam Bognar

    • Andrew Simpson

    • Caleb Buxton

    • Colin Brumelle

  • Everyone at Utrecht.rb

  • Jamis Buck for writing Net::SSH and friends.

Credits

License

See: LICENSE.txt