Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Launch ec2 instances, pronto FORK
Ruby
branch: master

This branch is 7 commits ahead of adamwiggins:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
spec
.gitignore
README.rdoc
Rakefile
VERSION
jsumo.gemspec
sumo.gemspec

README.rdoc

You could run this entire park for up to three days with minimal staff. Do you think that kind of automation is easy? Or cheap? Do you know anyone who can network three connection machines and debug 2 million lines of code for what I bid for this job?

THIS IS A FORKED VERSION OF ADAM WIGGINS OF HEROKU' SUMO

Adds only the ability to execute a bash script specified by the

full_path_to_install_script

In the ~/.sumo/config.yml. Here's an example of an install script.

#!/bin/bash
sudo apt-get update -y
sudo apt-get autoremove -y
sudo apt-get install -y build-essential zlib1g-dev libssl-dev libreadline5-dev
sudo apt-get install -y postgresql libpq-dev
sudo apt-get install -y git-core vim-tiny memcached postgresql

Here's an example of my ~/.sumo/config.yml

---
  access_id: <your amazon access key id>
  access_secret: <your amazon secret access key>
  ami: ami-bb709dd2 # Ubuntu 9.10 Karmic Canonical from alestic.com
  availability_zone: us-east-1b
  user: ubuntu
  full_path_to_install_script: ~/.sumo/install.sh

The bin is also now “jsumo” instead of sumo so you can install locally as a different gem

  1. git clone git@github.com:jotto/sumo.git jsumo

  2. cd jsumo

  3. rake build

  4. gem install pkg/jsumo-0.2.3.gem

  5. jsumo launch

  6. jsumo install

  7. follow any of the original instructions below, just use jsumo instead of sumo

Tired of wrestling with server provisioning? Sumo!

Want to fire up a one-off EC2 instance, pronto? ec2-run-instances got you down? Try Sumo.

$ sumo launch
---> Launching instance...    i-4f809c26 (1.5s)
---> Acquiring hostname...    ec2-67-202-17-178.compute-1.amazonaws.com (26.7s)

Logging you in via ssh.  Type 'exit' or Ctrl-D to return to your local system.
------------------------------------------------------------------------------
Linux domU-12-31-39-04-31-37 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686
...
root@domU-12-31-39-04-31-37:~#

Later…

$ sumo terminate
ec2-67-202-17-178.compute-1.amazonaws.com scheduled for termination

You can manage multiple instances via “sumo list” and specifying hostname or instance id as arguments to the ssh or terminate commands.

Service installation with Chef

The launch command takes an argument, which is a server role (from roles/#{role}.json inside your cookbooks repo):

$ sumo launch redis
---> Launch instance...       i-b96c73d0 (1.3s)
---> Acquire hostname...      ec2-75-101-191-220.compute-1.amazonaws.com (36.1s)
---> Wait for ssh...          done (9.0s)
---> Bootstrap chef...        done (61.3s)
---> Setup redis...           done (11.9s)
---> Opening firewall...      ports 6379 (5.2s)

Your instance is exporting the following resources:
  Redis: redis://:8452cdd98f428c972f08@ec2-75-101-191-220.compute-1.amazonaws.com:6379/0

The instance can assume multiple roles if you like:

$ sumo launch redis,solr,couchdb

Setup

Dependencies:

$ sudo gem install amazon-ec2 thor

Then create ~/.sumo/config.yml containing:

---
access_id: <your amazon access key id>
access_secret: <your amazon secret access key>

Optional config you can include any of the following in your config.yml:

user: root
ami: ami-ed46a784
 availability_zone: us-east-1b
cookbooks_url: git://github.com/adamwiggins/chef-cookbooks.git

You'll need Bacon and Mocha if you want to run the specs, and Jewler if you want to create gems.

Managing volumes

Create and attach a volume to your running instance:

$ sumo create_volume
---> Create 5MB volume...     vol-8a9c6ae3 (1.1s)
$ sumo volumes
vol-8a9c6ae3    5MB  available
$ sumo attach
---> Attach vol-8a9c6ae3 to i-bc32cbd4 as /dev/sdc1... done (0.6s)

Log in to format and mount the volume:

$ sumo ssh
root@ip-10-251-122-175:~# mkfs.ext3 /dev/sdc1
mke2fs 1.41.4 (27-Jan-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
...
$ mkdir /myvol
$ mount /dev/sdc1 /myvol
$ echo "I'm going to persist to a volume" > /myvol/hello.txt

To detach from a running instance (perhaps so you can attach elsewhere):

$ sumo detatch
---> Detach vol-8a9c6ae3...   done (0.6s)

Destroy it if you no longer want the data stored on it:

$ sumo destroy_volume
---> Destroy volume...        done (0.8s)

Some details you might want to know

Sumo creates its own keypair named sumo, which is stored in ~/.ssh/keypair.pem. Amazon doesn't let you upload your own ssh public key, which is lame, so this is the best option for making the launch-and-connect process a single step.

It will also create an Amazon security group called sumo, so that it can lower the firewall for services you configure via cookbook roles.

If you run any production machines from your EC2 account, I recommend setting up a separate account for use with Sumo. It does not prompt for confirmation when terminating an instance or differentiate between instances started by it vs. instances started by other tools.

Anti-features

Sumo is not a cloud management tool, a monitor tool, or anything more than a way to get an instance up right quick. If you're looking for a way to manage a cluster of production instances, try one of these fine tools.

  • Pool Party

  • RightScale

  • Engine Yard Cloud

  • Cloudkick

Meta

Created by Adam Wiggins

Patches contributed by Orion Henry, Blake Mizerany, Jesse Newland, Gert Goet, and Tim Lossen

Released under the MIT License: www.opensource.org/licenses/mit-license.php

github.com/adamwiggins/sumo

Something went wrong with that request. Please try again.