New version with Cap 2 tasks RubyGem; project site moved.

2 views
Skip to first unread message

Paul Dowman

unread,
Oct 7, 2007, 12:11:27 PM10/7/07
to ec2-on-rai...@googlegroups.com
There is now a RubyGem available with Capistrano 2 tasks to manage the server instance. Because of this (and other reasons) I have also moved the project site to RubyForge ( http://rubyforge.org/projects/ec2onrails/ ) from Google Code, the documentation will be updated soon.

In the meantime, the new image is ami-a3f91cca, and you can install the capistrano tasks with "sudo gem install ec2onrails". This is an experimental release, not thoroughly tested, don't consider it to be stable! I'm aiming for a stable 1.0 release soon.

A command to configure your rails app automatically would be nice (like the capify script) but in the meantime here are sample config files:
http://ec2onrails.rubyforge.org/svn/trunk/documentation/examples/
Note that the mongrel config file is no longer needed in the web app.

The image now has a new user named "admin" with sudo ability, and the server management tasks run as this user. New roles are automatically created, they are a copy of your :app, :db, and :web roles but they have the user changed from "app" to "admin".

Here is the current list of tasks:

Server config tasks. These run as the admin user. You can specify lists of gems and Ubuntu packages to be installed. The deploy_files task uploads files to the server (they will be owned by root). It's intended mainly for customized config files for new packages installed via the install_packages task.
ec2onrails:server:deploy_files
ec2onrails:server:set_timezone
ec2onrails:server:upgrade_gems
ec2onrails:server:upgrade_packages
ec2onrails:server:install_gems
ec2onrails:server:install
_packages
ec2onrails:server:upgrade_and_install_all
ec2onrails:server:restart_services

Database management tasks: archive and restore can operate on a different bucket from the regular mysql backup bucket. For example, I use this to restore the current production data (from the actual production backup bucket) onto a staging server that has the current production version of my app. I then deploy the new version which tests migrations exactly as they'll run on the production server.
ec2onrails:db:archive
ec2onrails:db:restore
ec2onrails:db:create
ec2onrails:db:drop
ec2onrails:db:recreate
ec2onrails:db:set_root_password

ec2onrails:setup
- This is a convenience task to get a new instance completely set up in one step, everything except deploying the app.

ec2onrails:restore_db_and_deploy
- Another convenience task to recreate the db, restore data to it from an s3 bucket and deploy the app, useful to set up a staging server.

I'll be adding more tasks, let me know what types of things you need to customize and I'll try to cover the common scenarios. The main thing I want to add is tasks to manage EC2 instances, there are libraries of cap tasks that I can use for this, like Capsize (which hasn't released a gem yet).

The gem assumes a matching version of the server image, so the current gem, v0.9.3, will only work with v0.9.3 of the server image. Soon there will be cap tasks to automatically launch the current version.

Also, the server now includes the brand-new Rails 1.2.4.

I'm going to be focusing on the ability to run with multiple images now, this will involve some load testing and evaluation of other options for http proxying, then I'm aiming for a stable 1.0 release.

Paul

(Please reply to ec2-on-rai...@googlegroups.com)

Reply all
Reply to author
Forward
0 new messages