David Heinemeier Hansson
2005-Oct-19 19:48 UTC
[ANN] Introducing SwitchTower: Distributed deployment for Rails
SwitchTower is a utility for executing commands in parallel on multiple machines. It lets you (among many other things) deploy distributed applications with a single command. When your application is young you may be deploying it to a single machine, which runs the web server, app server, and database all together. In this situation, deploying manually is not unbearably painful. But as your application grows you may find yourself needing to deploy your application to two web servers, four app servers, and two database servers, atomically. This is where SwitchTower steps in as a pain-killer. *Getting Started* Suppose you have an existing Rails application that you want to deploy to a cluster of machines. SwitchTower attempts to make the entire process as painless as possible: * Install SwitchTower. This is as simple as @gem install switchtower@. * Decorate your application with the necessary SwitchTower files. Just do @switchtower --apply-to /path/to/your/app@. * Tell SwitchTower where your application code sits and what machines it should deploy to. Just edit @config/deploy.rb@ and fill in the blanks. * Set up your machines so they are ready to receive your application. It''s as easy as @rake remote_exec ACTION=setup@. * Lastly, deploy your application! Just type @rake deploy@ and let the good times roll. *Other Capabilities* In addition to simply moving your application to the various boxes, SwitchTower attempts to make the task of maintaining your deployment simpler. Suppose something goes wrong while checking out your code--SwitchTower will detect that and roll back the change, _on all deployed machines_. This means it is much harder to wind up with your application out of sync on the various boxes. Other things SwitchTower can do, out of the box: * Database migrations on your production database * Enable/disable the web interface (only works with Apache currently) * Restart your application on the application servers SwitchTower also makes it very simple to override and extend the standard tasks, and to write your own. The tasks use a simple language similar to Rake that allows you to automate many different tasks. *More Information* Want to know more about SwitchTower? There''s an entire user manual full of useful tidbits at http://manuals.rubyonrails.com/read/book/17. -- David Heinemeier Hansson http://www.loudthinking.com -- Broadcasting Brain http://www.basecamphq.com -- Online project management http://www.backpackit.com -- Personal information manager http://www.rubyonrails.com -- Web-application framework
Ryan Carver
2005-Oct-19 20:05 UTC
Re: [ANN] Introducing SwitchTower: Distributed deployment for Rails
We did your first switchtower deployment a few days ago. it ruled. less than 20 seconds of downtime for a deployment to 6 machines, involving both db migrations and stopping/starting a set of background processes. And, that downtime was covered by a customized "we''ll be back soon" page. very, very nice - Ryan www.measuremap.com On Oct 19, 2005, at 12:48 PM, David Heinemeier Hansson wrote:> SwitchTower is a utility for executing commands in parallel on > multiple machines. It lets you (among many other things) deploy > distributed applications with a single command. > > When your application is young you may be deploying it to a single > machine, which runs the web server, app server, and database all > together. In this situation, deploying manually is not unbearably > painful. But as your application grows you may find yourself needing > to deploy your application to two web servers, four app servers, and > two database servers, atomically. This is where SwitchTower steps in > as a pain-killer. > > *Getting Started* > > Suppose you have an existing Rails application that you want to deploy > to a cluster of machines. SwitchTower attempts to make the entire > process as painless as possible: > > * Install SwitchTower. This is as simple as @gem install switchtower@. > * Decorate your application with the necessary SwitchTower files. Just > do @switchtower --apply-to /path/to/your/app@. > * Tell SwitchTower where your application code sits and what machines > it should deploy to. Just edit @config/deploy.rb@ and fill in the > blanks. > * Set up your machines so they are ready to receive your application. > It''s as easy as @rake remote_exec ACTION=setup@. > * Lastly, deploy your application! Just type @rake deploy@ and let the > good times roll. > > *Other Capabilities* > > In addition to simply moving your application to the various boxes, > SwitchTower attempts to make the task of maintaining your deployment > simpler. Suppose something goes wrong while checking out your > code--SwitchTower will detect that and roll back the change, _on all > deployed machines_. This means it is much harder to wind up with your > application out of sync on the various boxes. > > Other things SwitchTower can do, out of the box: > > * Database migrations on your production database > * Enable/disable the web interface (only works with Apache currently) > * Restart your application on the application servers > > SwitchTower also makes it very simple to override and extend the > standard tasks, and to write your own. The tasks use a simple language > similar to Rake that allows you to automate many different tasks. > > *More Information* > > Want to know more about SwitchTower? There''s an entire user manual > full of useful tidbits at http://manuals.rubyonrails.com/read/book/17. > > -- > David Heinemeier Hansson > http://www.loudthinking.com -- Broadcasting Brain > http://www.basecamphq.com -- Online project management > http://www.backpackit.com -- Personal information manager > http://www.rubyonrails.com -- Web-application framework > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Jeremy Kemper
2005-Oct-19 20:54 UTC
Re: [ANN] Introducing SwitchTower: Distributed deployment for Rails
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Oct 19, 2005, at 1:05 PM, Ryan Carver wrote:> We did your first switchtower deployment a few days ago. it ruled. > > less than 20 seconds of downtime for a deployment to 6 machines, > involving both db migrations and stopping/starting a set of > background processes. And, that downtime was covered by a > customized "we''ll be back soon" page. > > very, very niceDoes it scale? Best, jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (Darwin) iD8DBQFDVrKeAQHALep9HFYRAsd7AKDBXcCGNuwJ2ff+09AlTyeEnWMfKQCfWM/G v8pMs+Dvo5EAuRikorCkdf0=L/vp -----END PGP SIGNATURE-----