<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Rails Machine Blog</title>
    <link>http://blog.railsmachine.com/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>The Rails Machine blog, your source for news, announcements, thoughts, podcasts, and code from the Rails Machine team. </description>


    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/RailsMachine" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Return from the Ruby Hoedown</title>
      <description>&lt;p&gt;&lt;a href="http://twitter.com/jnewland"&gt;Jesse Newland&lt;/a&gt; and &lt;a href="http://twitter.com/wfarr"&gt;I&lt;/a&gt; are back from the 2009 &lt;a href="http://rubyhoedown.com"&gt;Ruby Hoedown&lt;/a&gt;, the South&amp;#8217;s regional Ruby conference. We both had a blast! The talks were all enjoyable and very informative, and we had an awesome time hanging out with folks like &lt;a href="http://twitter.com/jnunemaker"&gt;John Nunemaker&lt;/a&gt;, &lt;a href="http://twitter.com/orderedlist"&gt;Steve Smith&lt;/a&gt;, &lt;a href="http://twitter.com/maraby"&gt;Matt Todd&lt;/a&gt;, and many, many others.&lt;/p&gt;


	&lt;p&gt;It was great seeing all of you there who did come by and say &amp;#8220;Hi&amp;#8221; at some point this weekend&amp;#8212;we hope you enjoyed the conference (and your spiffy lanyards!) as much as we did.&lt;/p&gt;


	&lt;p&gt;The talks that really stuck out out in my mind were those given by &lt;a href="http://www.benmabey.com/"&gt;Ben Mabey&lt;/a&gt; (&lt;a href="http://benmabey.com/downloads/writing_software_not_code_with_cucumber.pdf"&gt;Writing Software, Not Code With Cucumber&lt;/a&gt;), &lt;a href="http://fallenrogue.com/"&gt;Leon Gersing&lt;/a&gt; (couldn&amp;#8217;t find a link to his slides, but it was on &lt;a href="http://www.appcelerator.com/"&gt;Appcelerator Titanium&lt;/a&gt;), and &lt;a href="http://onestepback.org/index.cgi"&gt;Jim Weirich&lt;/a&gt; (&lt;a href="http://github.com/jimweirich/presentation_source_control/tree/master"&gt;Source Control for People Who Don&amp;#8217;t Like Source Control&lt;/a&gt;). The talk on &lt;a href="http://timetobleed.com/ruby-hoedown-slides/"&gt;threading in Ruby 1.9&lt;/a&gt; was also really interesting&amp;#8212;it&amp;#8217;s definitely something we&amp;#8217;ll revisit when more people are using 1.9 (ie. right around the release of Rails 3.0). The lightning talks were particularly amusing, both for the fact that they&amp;#8217;re very impromptu and also because the speakers were given props to play with during their presentations. Anyone who was there can tell you all about the guy with the kazoo. All of the talks were very well done, and I&amp;#8217;d like to thank everyone who did speak this year for doing a great job.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;d like to read up on specifics of the talks themselves, take a look at &lt;a href="http://lylejohnson.name/blog/2009/08/31/ruby-hoedown-2009-wrap-up/"&gt;one of the first recaps&lt;/a&gt; I&amp;#8217;ve seen posted or at the &lt;a href="http://search.twitter.com/search?q=%23rubyhoedown"&gt;hashtag on twitter&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;While Jesse and I had a blast at the conference, I think I can speak for both of us when I say that I&amp;#8217;m glad to be back home, working on your rails machines to make sure you get the best experience possible.&lt;/p&gt; </description>
      <pubDate>Wed, 02 Sep 2009 13:54:00 GMT</pubDate>
      <guid>http://blog.railsmachine.com/articles/2009/09/02/return-from-the-ruby-hoedown/</guid>
      <link>http://blog.railsmachine.com/articles/2009/09/02/return-from-the-ruby-hoedown/</link>
    </item>

    <item>
      <title>Hoedown Bound</title>
      <description>&lt;p&gt;&lt;a href="http://twitter.com/jnewland"&gt;Jesse Newland&lt;/a&gt; and &lt;a href="http://twitter.com/wfarr"&gt;I&lt;/a&gt; are currently on our way up to Nashville for this year&amp;#8217;s &lt;a href="http://rubyhoedown.com/"&gt;Ruby Hoedown&lt;/a&gt;, the South&amp;#8217;s regional Ruby conference. We&amp;#8217;re both looking forward to good talks, demos, and of course hacking on some awesome stuff. We&amp;#8217;ll definitely be at the Smash-Up Derby, as well as a few other things in the area. For a list of things to do while in Nashville, we recommend taking a look at &lt;a href="http://bl.ogtastic.com/2009/7/17/nashville-hi-lites-for-the-ruby-hoedown"&gt;this list&lt;/a&gt; compiled by Rick Bradley.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re a customer, are interested in hosting at Rails Machine, or just want to ask us some questions, come find us (or hit us &lt;a href="http://twitter.com/railsmachine"&gt;@railsmachine&lt;/a&gt;) and we&amp;#8217;ll grab a beer and chat. And remember, our &amp;#8220;ask us anything&amp;#8221; support is always available in person!&lt;/p&gt;


	&lt;p&gt;We hope we&amp;#8217;ll see you there, but if we don&amp;#8217;t, we hope you have a good time at the Hoedown!&lt;/p&gt; </description>
      <pubDate>Thu, 27 Aug 2009 11:33:00 GMT</pubDate>
      <guid>http://blog.railsmachine.com/articles/2009/08/27/hoedown-bound/</guid>
      <link>http://blog.railsmachine.com/articles/2009/08/27/hoedown-bound/</link>
    </item>

    <item>
      <title>Free Scout Monitoring for Customers!</title>
      <description>&lt;p&gt;We are excited to announce that &lt;a href="http://scoutapp.com"&gt;Scout&lt;/a&gt; monitoring is now available for free (via a $14 off coupon) to all Rails Machine customers. Created by our pals at &lt;a href="http://highgroove.com/"&gt;Highgroove Studios&lt;/a&gt;, Scout was recently updated with a slew of awesome &lt;a href="http://blog.scoutapp.com/articles/2009/05/26/deep-rails-instrumentation"&gt;new features&lt;/a&gt; including deep Rails instrumentation, triggers, and a more robust agent. With Scout&amp;#8217;s extensible plugin system, you can monitor any data that you want and track any trends over time. We&amp;#8217;re big fans of the plugin system for catching tricky issues that elude basic system health metrics. There are a number of community-supported plugins &lt;a href="http://scoutapp.com/plugin_urls"&gt;available&lt;/a&gt; for your own use.&lt;/p&gt;


	&lt;p&gt;If you are a customer of our &lt;a href="http://railsmachine.com/managed-hosting"&gt;Ruby on Rails managed hosting&lt;/a&gt; and not currently on Scout, we will be in touch and take care of it without worry. If you have a traditional account, then please request a coupon code via the &lt;a href="https://support.railsmachine.com/index.php?pg=request"&gt;support request form&lt;/a&gt;. This coupon code will provide $14 off any of Scout&amp;#8217;s &lt;a href="https://scoutapp.com/subscriptions"&gt;affordable plans&lt;/a&gt; ($7/server) if you need more than the Basic account. We even have a &lt;a href="http://github.com/railsmachine/moonshine_scout/tree/master"&gt;new plugin&lt;/a&gt; for &lt;a href="http://github.com/railsmachine/moonshine/tree/master"&gt;Moonshine&lt;/a&gt; for automating Scout&amp;#8217;s installation.&lt;/p&gt; </description>
      <pubDate>Thu, 25 Jun 2009 15:07:00 GMT</pubDate>
      <guid>http://blog.railsmachine.com/articles/2009/06/25/free-scout-monitoring-for-customers/</guid>
      <link>http://blog.railsmachine.com/articles/2009/06/25/free-scout-monitoring-for-customers/</link>
    </item>

    <item>
      <title>Ruby BigDecimal Security Vulnerability (CVE-2009-1904)</title>
      <description>&lt;p&gt;If you have a server at Rails Machine, please head over to the &lt;a href="http://status.railsmachine.com"&gt;Rails Machine Status Blog&lt;/a&gt; for &lt;a href="http://status.railsmachine.com/post/121171787/cve-2009-1904"&gt;our detailed take on the Ruby BigDecimal security vulnerability&lt;/a&gt; that was announced late last night.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re not already subscribed to our &lt;a href="http://status.railsmachine.com"&gt;Status Blog&lt;/a&gt;, now is an excellent time to do so. We post post news and updates about system, security, and network issues affecting multiple Rails Machine customers over there, and generally reserve this blog for other posts, such as &lt;a href="http://blog.railsmachine.com/articles/2009/06/04/rails-machine-is-hiring/"&gt;job postings&lt;/a&gt; and &lt;a href="http://blog.railsmachine.com/articles/2009/03/18/moonshine-what-burns-blue-makes-your-blues-go-away/"&gt;software&lt;/a&gt; &lt;a href="http://blog.railsmachine.com/articles/2009/05/06/moonshine-plugins-yo-dawg-i-put-a-plugin-in-your-plugin/"&gt;releases&lt;/a&gt;. Here&amp;#8217;s the &lt;span class="caps"&gt;RSS URL&lt;/span&gt; for the Status Blog:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&lt;code&gt;http://status.railsmachine.com/rss&lt;/code&gt;&lt;/p&gt;
	&lt;/blockquote&gt; </description>
      <pubDate>Wed, 10 Jun 2009 10:35:00 GMT</pubDate>
      <guid>http://blog.railsmachine.com/articles/2009/06/10/CVE-2009-1904/</guid>
      <link>http://blog.railsmachine.com/articles/2009/06/10/CVE-2009-1904/</link>
    </item>

    <item>
      <title>Rails Machine is Hiring</title>
      <description>&lt;p&gt;Love helping people with their Rails deployments? Come work for The Machine! Rails Machine is hiring a part-time or full-time Ruby on Rails Support Engineer in Atlanta, GA or the surrounding area.&lt;/p&gt;


	&lt;p&gt;As a Ruby on Rails Support Engineer, you would work with the existing Rails Machine team to:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Support existing customers&amp;#8217; Ruby on Rails deployments&lt;/li&gt;
		&lt;li&gt;Deploy new customers&amp;#8217; Ruby on Rails applications&lt;/li&gt;
		&lt;li&gt;Write documentation covering common problems&lt;/li&gt;
		&lt;li&gt;Write software to automate anything you do more than twice&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;In addition to the above work, which can all be performed from the comfort of your home office, your back patio, our &lt;a href="http://roamatlanta.com/"&gt;coworking space&lt;/a&gt;, or anywhere you can find &lt;em&gt;the internets&lt;/em&gt;, the following work will need to be occasionally performed onsite at our two Atlanta data centers.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Unbox, rack, cable, and configure new servers&lt;/li&gt;
		&lt;li&gt;Perform basic server maintenance (replace hard drives, etc)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;You should be comfortable with all of these things:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Linux&lt;/li&gt;
		&lt;li&gt;Ruby&lt;/li&gt;
		&lt;li&gt;Rails&lt;/li&gt;
		&lt;li&gt;Passenger&lt;/li&gt;
		&lt;li&gt;Mongrel&lt;/li&gt;
		&lt;li&gt;Apache&lt;/li&gt;
		&lt;li&gt;MySQL&lt;/li&gt;
		&lt;li&gt;Capistrano&lt;/li&gt;
		&lt;li&gt;Git&lt;/li&gt;
		&lt;li&gt;Subversion&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;You should be excited to learn about these things:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Xen&lt;/li&gt;
		&lt;li&gt;&lt;span class="caps"&gt;KVM&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;Nagios&lt;/li&gt;
		&lt;li&gt;&lt;span class="caps"&gt;LVS&lt;/span&gt;&lt;/li&gt;
		&lt;li&gt;Puppet&lt;/li&gt;
		&lt;li&gt;Moonshine&lt;/li&gt;
		&lt;li&gt;Sinatra&lt;/li&gt;
		&lt;li&gt;&lt;span class="caps"&gt;TDD&lt;/span&gt;/BDD with RSpec&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Rails Machine is a small business, so this will be anything but a boring job. We all wear many hats, but have a damn good time doing it. Oh, and if you like strange beers, that helps too, as we&amp;#8217;re running out of names for our servers.&lt;/p&gt;


	&lt;p&gt;If this sounds like fun to you, please send your resume, a link to your GitHub account, and a note explaining why you&amp;#8217;d be perfect for the job to &lt;a href="mailto:jesse@railsmachine.com"&gt;Jesse Newland&lt;/a&gt;. Thanks!&lt;/p&gt; </description>
      <pubDate>Thu, 04 Jun 2009 15:31:00 GMT</pubDate>
      <guid>http://blog.railsmachine.com/articles/2009/06/04/rails-machine-is-hiring/</guid>
      <link>http://blog.railsmachine.com/articles/2009/06/04/rails-machine-is-hiring/</link>
    </item>

    <item>
      <title>Moonshine Plugins: Yo dawg, I put a plugin in your plugin</title>
      <description>&lt;p&gt;We hope by now that you&amp;#8217;ve had a chance to check out &lt;a href="http://blog.railsmachine.com/articles/2009/03/18/moonshine-what-burns-blue-makes-your-blues-go-away/"&gt;Moonshine&lt;/a&gt; and maybe even give it a go on your own server. We&amp;#8217;ve been using Moonshine to deploy our customer&amp;#8217;s servers for a while now, and we&amp;#8217;ve started extracting little pieces of manifests into Moonshine plugins. I&amp;#8217;m going to show you how to add Moonshine plugins to your manifest, and give you the lowdown on writing your own.&lt;/p&gt;


	&lt;h2&gt;Installing and using plugins&lt;/h2&gt;


	&lt;p&gt;Moonshine plugins are installed just like any other Rails plugin:&lt;/p&gt;


&lt;pre&gt;
script/plugin install git://github.com/railsmachine/moonshine_ssh.git
&lt;/pre&gt;

	&lt;p&gt;Then add a few lines to your application&amp;#8217;s manifest- &lt;code&gt;app/manifest/application_manifest.rb&lt;/code&gt;, by default.&lt;/p&gt;


&lt;pre&gt;
configure( :ssh =&amp;gt; { :allow_users =&amp;gt; ['rails'] } )
plugin :ssh
recipe :ssh
&lt;/pre&gt;

	&lt;p&gt;Not all plugins will need to be configured before they&amp;#8217;re used and the recipe name doesn&amp;#8217;t need to be the same as the plugin name- in fact, a plugin could provide as many recipes as you like. The next time you deploy your application, Moonshine will run the recipes you specified from the installed plugins.&lt;/p&gt;


	&lt;h2&gt;Writing your own&lt;/h2&gt;


	&lt;p&gt;Now here&amp;#8217;s how you can really shine while you &amp;#8216;shine. If you&amp;#8217;ve added functionality in your manifest that you think others could use, create a new Moonshine plugin for it and put it up on github. Here&amp;#8217;s how we do it.&lt;/p&gt;


	&lt;h3&gt;Generate the plugin stub&lt;/h3&gt;


	&lt;p&gt;Start by running the plugin generator from your application directory. Just switch out &amp;#8220;ssh&amp;#8221; for 
whatever it is you&amp;#8217;re plugin-ifying.&lt;/p&gt;


&lt;pre&gt;
script/generate moonshine_plugin ssh
&lt;/pre&gt;

	&lt;p&gt;This creates the following structure in the &lt;code&gt;vendor/plugins&lt;/code&gt; directory of your app:&lt;/p&gt;


&lt;pre&gt;
  |--moonshine_ssh
     |-- README.rdoc
     |-- moonshine 
     |  `-- init.rb
     |-- lib
     |  `-- ssh.rb
     |-- spec
         |-- spec_helper.rb
         |-- ssh_spec.rb
&lt;/pre&gt;

	&lt;h3&gt;Add recipes&lt;/h3&gt;


	&lt;p&gt;The &lt;code&gt;lib/&lt;/code&gt; directory is where we&amp;#8217;ll put puppet recipes. For our &lt;span class="caps"&gt;SSH&lt;/span&gt; plugin we add this:&lt;/p&gt;


&lt;pre&gt;
def ssh(options = {})
  package 'ssh', :ensure =&amp;gt; :installed
  service 'ssh', :enable =&amp;gt; true, :ensure =&amp;gt; :running

  file '/etc/ssh/sshd_config',
    :mode =&amp;gt; '644',
    :content =&amp;gt; template(File.join(File.dirname(__FILE__), '..', 'templates', 'sshd_config'), binding),
    :require =&amp;gt; package('ssh'),
    :notify =&amp;gt; service('ssh')
end
&lt;/pre&gt;

	&lt;p&gt;This is straightforward- we&amp;#8217;re making sure that &lt;span class="caps"&gt;SSH&lt;/span&gt; is installed, that the service is running and will start on system boot. We&amp;#8217;ll create a &lt;code&gt;templates/&lt;/code&gt; directory with an &lt;span class="caps"&gt;ERB&lt;/span&gt; template called &lt;code&gt;sshd_config&lt;/code&gt;. It will be rendered and saved as &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt;. The &lt;span class="caps"&gt;SSH&lt;/span&gt; service will be notified to restart when it changes. The template will have lines like this sprinkled throughout:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;LoginGraceTime &amp;lt;%= options[:login_grace_time] || 30 %&amp;gt;
PermitRootLogin &amp;lt;%= options[:permit_root_login] || 'no' %&amp;gt;&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;The options come from our &lt;code&gt;configure&lt;/code&gt; line in the first example. If you recall, we defined a property called &lt;code&gt;:ssh&lt;/code&gt;, which we set to a hash. This hash will be passed to the &lt;code&gt;ssh&lt;/code&gt; recipe by Moonshine. This little convention helps keep the custom configuration of your server separate from its list of parts.&lt;/p&gt;


	&lt;h3&gt;Do the safety dance&lt;/h3&gt;


	&lt;p&gt;Now we&amp;#8217;ve got a working plugin that can manage your &lt;span class="caps"&gt;SSH&lt;/span&gt; settings. Just one thing- what if 
someone configured ssh like this?&lt;/p&gt;


&lt;pre&gt;
configure(:ssh =&amp;gt; {:port =&amp;gt; 'two'})  
&lt;/pre&gt; 

	&lt;p&gt;This clearly isn&amp;#8217;t valid and we don&amp;#8217;t want them to be locked out, so let&amp;#8217;s test the file before we update it.&lt;/p&gt;


&lt;pre&gt;
def ssh(options = {})
  package 'ssh', :ensure =&amp;gt; :installed
  service 'ssh', :enable =&amp;gt; true, :ensure =&amp;gt; :running

  file '/etc/ssh/sshd_config.new',
    :mode =&amp;gt; '644',
    :content =&amp;gt; template(File.join(File.dirname(__FILE__), '..', 'templates', 'sshd_config'), binding),
    :require =&amp;gt; package('ssh'),
    :notify =&amp;gt; exec('update_sshd_config')

  exec 'cp /etc/ssh/sshd_config.new /etc/ssh/sshd_config',
    :alias =&amp;gt; 'update_sshd_config'
    :onlyif =&amp;gt; '/usr/sbin/sshd -t -f /etc/ssh/sshd_config.new',
    :refreshonly =&amp;gt; true, # do nothing until notified
    :require =&amp;gt; file('/etc/ssh/sshd_config.new'),
    :notify =&amp;gt; service('ssh')
end
&lt;/pre&gt;

	&lt;p&gt;There you have it. We upload the new configuration to a temporary location and replace the previous one only if the syntax check returns 0. This plugin is ready to be put online for all to enjoy.&lt;/p&gt;


	&lt;h2&gt;The first plugins&lt;/h2&gt;


	&lt;p&gt;So far, we&amp;#8217;ve released plugins for managing &lt;a href="http://github.com/railsmachine/moonshine_iptables"&gt;iptables&lt;/a&gt;, &lt;a href="http://github.com/railsmachine/moonshine_ssh"&gt;&lt;span class="caps"&gt;SSH&lt;/span&gt;&lt;/a&gt;, 
and &lt;a href="http://github.com/railsmachine/moonshine_god"&gt;god&lt;/a&gt;. Look for more in the coming days. If you&amp;#8217;ve written one, let us know about it in the comments!&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Check out the list of plugins and add your own on the &lt;a href="http://wiki.github.com/railsmachine/moonshine/moonshine-plugins"&gt;plugin wiki page&lt;/a&gt;.&lt;/p&gt; </description>
      <pubDate>Wed, 06 May 2009 09:44:00 GMT</pubDate>
      <guid>http://blog.railsmachine.com/articles/2009/05/06/moonshine-plugins-yo-dawg-i-put-a-plugin-in-your-plugin/</guid>
      <link>http://blog.railsmachine.com/articles/2009/05/06/moonshine-plugins-yo-dawg-i-put-a-plugin-in-your-plugin/</link>
    </item>

    <item>
      <title>RailsConf 2009: Vegas Edition</title>
      <description>&lt;p&gt;If you&amp;#8217;re in Vegas for &lt;a href="http://railsconf.com/"&gt;RailsConf&lt;/a&gt;, we&amp;#8217;d love to meet you! &lt;a href="http://twitter.com/jnewland"&gt;Jesse Newland&lt;/a&gt; will hanging out in the Caboose Conf room during the day, hacking on &lt;a href="http://github.com/railsmachine/moonshine/tree/master"&gt;Moonshine&lt;/a&gt;. Feel free to drop by if you&amp;#8217;d like to learn more about Moonshine, chat about Rails deployment, or anything else. Remember: our &lt;a href="http://railsmachine.com/support"&gt;Ask Us Anything Support&lt;/a&gt; is always valid in person.&lt;/p&gt;


	&lt;p&gt;Oh, and if you&amp;#8217;re a Rails Machine customer, Jesse would love to buy you a beer. Just &lt;a href="http://twitter.com/jnewland"&gt;@jnewland&lt;/a&gt; him. Mmmm beer.&lt;/p&gt; </description>
      <pubDate>Mon, 04 May 2009 13:22:00 GMT</pubDate>
      <guid>http://blog.railsmachine.com/articles/2009/05/04/railsconf-2009-vegas-edition/</guid>
      <link>http://blog.railsmachine.com/articles/2009/05/04/railsconf-2009-vegas-edition/</link>
    </item>

    <item>
      <title>Moonshine: What burns blue makes your blues go away</title>
      <description>&lt;p&gt;We&amp;#8217;re happy to announce the release of &lt;a href="https://github.com/railsmachine/moonshine/"&gt;Moonshine&lt;/a&gt;, the system we&amp;#8217;re using to make the deployment and configuration management of our new customers&amp;#8217; Rails applications a no brainier. Moonshine combines all of the good parts of &lt;a href="http://reductivelabs.com/trac/puppet/"&gt;Puppet&lt;/a&gt;, &lt;a href="http://github.com/railsmachine/shadow_puppet"&gt;Shadow Puppet&lt;/a&gt; and &lt;a href="http://capify.org"&gt;Capistrano&lt;/a&gt; into an amazingly simple solution for deploying your Rails application.&lt;/p&gt;


	&lt;h3&gt;Look at all the choices I&amp;#8217;m not making&lt;/h3&gt;


	&lt;p&gt;One of the things that separates Moonshine from other solutions like Chef and Sprinkle is that out of the box, Moonshine comes with recipes for the same Ubuntu/Ruby Enterprise Edition/Apache/Passenger/MySQL stack that&amp;#8217;s in production use at Rails Machine. We&amp;#8217;re open sourcing this stack as a part of Moonshine for a couple reasons:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;To make it easier for Rails developers to deploy an application to &lt;strong&gt;any&lt;/strong&gt; host, not just Rails Machine.&lt;/li&gt;
		&lt;li&gt;To allow our customers to have a say in what they want in a Rails stack. If there&amp;#8217;s something missing or a choice we&amp;#8217;ve made that you don&amp;#8217;t agree with, fork &lt;a href="https://github.com/railsmachine/moonshine/"&gt;Moonshine&lt;/a&gt;, make your changes, and send us a pull request.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Since Rails Machine was founded in 2006, we&amp;#8217;ve been dedicated to making the deployment of Rails applications easier for our customers. With the release of Moonshine, we&amp;#8217;re taking that one step further by making Rails application deployment and configuration management easier for everyone!&lt;/p&gt;


	&lt;h3&gt;So, how do I get started?&lt;/h3&gt;


	&lt;p&gt;Moonshine is distributed as a Rails plugin. To get started with Moonshine, install this plugin and run the included generator:&lt;/p&gt;


&lt;pre&gt;
ruby script/plugin install git://github.com/railsmachine/moonshine.git
ruby script/generate moonshine
&lt;/pre&gt;

	&lt;p&gt;You&amp;#8217;ll notice a couple new files:&lt;/p&gt;


&lt;pre&gt;
app/manifests/application_manifest.rb
config/moonshine.yml
&lt;/pre&gt;

	&lt;p&gt;The first file is the &lt;code&gt;Moonshine::Manifest&lt;/code&gt; for your application. A Moonshine Manifest is a Ruby class that contains &lt;a href="http://railsmachine.github.com/shadow_puppet/classes/ShadowPuppet/Manifest.html"&gt;ShadowPuppet recipes&lt;/a&gt; &amp;#8211; essentially just instance methods &amp;#8211; that install packages, create configuration files, and run system commands. The manifest that&amp;#8217;s been generated for your application is actually subclass of &lt;code&gt;Moonshine::Manifest::Rails&lt;/code&gt;, which contains the entire Rails Machine production stack as recipes.&lt;/p&gt;


	&lt;p&gt;The second file is a hash serialized to &lt;span class="caps"&gt;YAML&lt;/span&gt; that contains the configuration for your application&amp;#8217;s deployment. You&amp;#8217;ll notice that this file contains variables you may be used to configuring in Capistrano &amp;#8211; the location of your source code repository, the user to execute commands on the server as, and the &lt;code&gt;deploy_to&lt;/code&gt; location on your server. Configure these just as you would in Capistrano &amp;#8211; this configuration hash will be available to both Capistrano and Moonshine.&lt;/p&gt;


	&lt;p&gt;If your application doesn&amp;#8217;t have any requirements in addition to the gems specified in your &lt;code&gt;config/environment.rb&lt;/code&gt; (you have specified all of your gem requirements using &lt;code&gt;config.gem&lt;/code&gt; calls, right? If not, stop reading and do this now), then you&amp;#8217;re ready to deploy your app!&lt;/p&gt;


	&lt;h3&gt;Deploying your Application with Moonshine&lt;/h3&gt;


	&lt;p&gt;Once you&amp;#8217;ve installed the Moonshine plugin, generated a manifest, configured Moonshine, and committed all of these changes to your repo, you&amp;#8217;re ready to deploy! To work with Moonshine, your server needs to satisfy these requirements:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Ubuntu 8.10&lt;/li&gt;
		&lt;li&gt;Has a user with &lt;code&gt;sudo&lt;/code&gt; privileges that can access your applications&amp;#8217; repository. (Moonshine uses &lt;code&gt;rails&lt;/code&gt; as the default user &amp;#8211; this is configurable in &lt;code&gt;config/moonshine.yml&lt;/code&gt;)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;This server doesn&amp;#8217;t need Ruby, MySQL, or anything installed on it. That&amp;#8217;s what Moonshine is for!&lt;/p&gt;


	&lt;p&gt;Once your server has been provisioned, &lt;code&gt;capify&lt;/code&gt; your application and replace the stock &lt;code&gt;config/deploy.rb&lt;/code&gt; with this one-liner:&lt;/p&gt;


&lt;pre&gt;
server "myubuntuserver.com", :app, :web, :db, :primary =&amp;gt; true
&lt;/pre&gt;

	&lt;p&gt;Once that&amp;#8217;s in place, run the following command:&lt;/p&gt;


&lt;pre&gt;
cap deploy:setup deploy
&lt;/pre&gt;

	&lt;p&gt;First, in the &lt;code&gt;deploy:setup&lt;/code&gt; task, Moonshine will install &lt;a href="http://www.rubyenterpriseedition.com/"&gt;Ruby Enterprise Edition&lt;/a&gt;, Git, and &lt;a href="http://github.com/railsmachine/shadow_puppet"&gt;Shadow Puppet&lt;/a&gt; and setup your &lt;code&gt;deploy_to&lt;/code&gt; directory. What happens next, during the &lt;code&gt;deploy&lt;/code&gt; task, is what makes Moonshine so awesome.&lt;/p&gt;


	&lt;p&gt;On the first deploy of your application, all requirements defined by recipes are installed, configuration files are created, and services started. In repeated tests on a Ubuntu 8.10 server running in VMWare, &lt;strong&gt;this first deploy takes between 10-15 minutes to install everything needed for a Rails application&lt;/strong&gt;. You read that right &amp;#8211; less than 15 minutes after running &lt;code&gt;cap deploy:setup deploy&lt;/code&gt; on a stock Ubuntu 8.10 server, your Rails app will be up and running.&lt;/p&gt;


	&lt;h3&gt;Idempotent Deployment&lt;/h3&gt;


	&lt;p&gt;On each and every deploy of your Rails application, your Moonshine Manifest is applied and verified. This means no more failed deploys because of a missing gem or package, and more importantly, &lt;strong&gt;you&amp;#8217;ll never have to &lt;span class="caps"&gt;SSH&lt;/span&gt; to your server to install a package again&lt;/strong&gt;.&lt;/p&gt;


	&lt;p&gt;For example, say you have a Rails app in production using Moonshine and you&amp;#8217;ve added file uploading using &lt;a href="http://github.com/thoughtbot/paperclip"&gt;Paperclip&lt;/a&gt;. After adding a &lt;code&gt;config.gems 'paperclip'&lt;/code&gt; line to &lt;code&gt;config/environment.rb&lt;/code&gt;, run &lt;code&gt;rake moonshine:gems&lt;/code&gt; to cache your gem dependencies, commit the changes to your repo, and then deploy. Moonshine will automatically install Paperclip and ImageMagick (!!!) during the deploy. Done. Awesome, right?&lt;/p&gt;


	&lt;h3&gt;Brew Your Own&lt;/h3&gt;


	&lt;p&gt;So the default Rails stack we&amp;#8217;ve included is just the tip of the iceberg. As we use Moonshine more and more at Rails Machine, we&amp;#8217;ll be adding built in support for things like Memcached to the recipes in &lt;code&gt;Moonshine::Manifest::Rails&lt;/code&gt;. And the &lt;a href="http://railsmachine.github.com/moonshine/classes/Moonshine/Manifest.html"&gt;plugin support&lt;/a&gt; in Moonshine makes it ridiculously easy for you to create reusable of recipes to share between apps, or even to include Moonshine recipes as a part of your plugin! If none of you beat me to it, I&amp;#8217;ll be forking &lt;a href="http://ts.freelancing-gods.com/"&gt;Thinking Sphinx&lt;/a&gt; and pouring some Moonshine on it pretty soon.&lt;/p&gt;


	&lt;h3&gt;Use the Source, Luke&lt;/h3&gt;


	&lt;p&gt;So what are you waiting for? The &lt;a href="http://github.com/railsmachine/moonshine/tree"&gt;source&lt;/a&gt; and &lt;a href="http://railsmachine.github.com/moonshine/"&gt;RDocs&lt;/a&gt; are up on GitHub &amp;#8211; go nuts.&lt;/p&gt;


	&lt;h3&gt;Moonshine at Rails Machine&lt;/h3&gt;


	&lt;p&gt;Moonshine is currently available for all customers of our &lt;a href="http://railsmachine.com/managed-hosting"&gt;Application Management&lt;/a&gt; services at Rails Machine. If you&amp;#8217;re an existing customer on a CentOS server and are interested in using Moonshine without the expert management, 24/7 monitoring, and proactive support that comes with our Application Management services, you will be able to redeploy to a new Ubuntu-based system very soon. Stay tuned!&lt;/p&gt; </description>
      <pubDate>Wed, 18 Mar 2009 11:25:00 GMT</pubDate>
      <guid>http://blog.railsmachine.com/articles/2009/03/18/moonshine-what-burns-blue-makes-your-blues-go-away/</guid>
      <link>http://blog.railsmachine.com/articles/2009/03/18/moonshine-what-burns-blue-makes-your-blues-go-away/</link>
    </item>

    <item>
      <title>Video and Slides from Acts as Conference</title>
      <description>&lt;p&gt;On Saturday, February 7th 2009, Dan Benjamin, Rails Machine Evangelist, gave the closing keynote at this year&amp;#8217;s &lt;a href="http://actsasconference.com/"&gt;Acts as Conference&lt;/a&gt; in Orlando Florida.&lt;/p&gt;


	&lt;p&gt;Both the video and slideshow are available for your viewing pleasure below.&lt;/p&gt;


	&lt;h3&gt;Slideshow&lt;/h3&gt;


&lt;div style="width:425px;text-align:left" id="__ss_1026177"&gt;&lt;a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/danbenjamin/acts-as-conference-keynote?type=powerpoint" title="Distraction, Attention, and Simplicity (Acts As Conference Keynote)"&gt;Distraction, Attention, and Simplicity (Acts As Conference Keynote)&lt;/a&gt;&lt;object style="margin:0px" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=aac2009-modified-1234561639934807-3&amp;#38;stripped_title=acts-as-conference-keynote" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=aac2009-modified-1234561639934807-3&amp;#38;stripped_title=acts-as-conference-keynote" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"&gt;View more &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/"&gt;presentations&lt;/a&gt; from &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/danbenjamin"&gt;danbenjamin&lt;/a&gt;. (tags: &lt;a style="text-decoration:underline;" href="http://slideshare.net/tag/dan"&gt;dan&lt;/a&gt; &lt;a style="text-decoration:underline;" href="http://slideshare.net/tag/benjamin"&gt;benjamin&lt;/a&gt;)&lt;/div&gt;&lt;/div&gt;

	&lt;h3&gt;Video&lt;/h3&gt;


&lt;embed src='http://aac2009.confreaks.com/player.swf' height='296' width='500' allowscriptaccess='always' allowfullscreen='true' flashvars='image=images%2F07-feb-2009-17-00-keynote-dan-benjamin-preview.jpg&amp;#38;file=http%3A%2F%2Faac2009.confreaks.com%2Fvideos%2F07-feb-2009-17-00-keynote-dan-benjamin-small.mp4&amp;#38;plugins=viral-1'/&gt; </description>
      <pubDate>Fri, 13 Feb 2009 16:57:00 GMT</pubDate>
      <guid>http://blog.railsmachine.com/articles/2009/02/13/video-and-slides-from-acts-as-conference/</guid>
      <link>http://blog.railsmachine.com/articles/2009/02/13/video-and-slides-from-acts-as-conference/</link>
    </item>

    <item>
      <title>Rails Deployment and Automation with ShadowPuppet and Capistrano</title>
      <description>&lt;p&gt;While our &lt;a href="http://blog.railsmachine.com/articles/2009/01/16/moonshine-configuration-management-and-deployment/"&gt;Moonshine&lt;/a&gt; is still distilling, I&amp;#8217;d like to present some examples of using existing automation tools to deploy Rails applications easily.&lt;/p&gt;


	&lt;h3&gt;Taskify&lt;/h3&gt;


	&lt;p&gt;When &lt;a href="http://weblog.jamisbuck.org/"&gt;Jamis Buck&lt;/a&gt; released Switchtower (now known as Capistrano) around 3 years ago, automated Rails deployment become standardized. It was a historic moment in Rails history. Since then, Capistrano has been used for a number of tasks beyond code deployment related to system configuration and automation. The &lt;em&gt;railsmachine&lt;/em&gt; gem provides tasks for configuring an application stack. However, our gem has always assumed that you were deploying against a &lt;em&gt;golden image&lt;/em&gt; (or &lt;a href="http://madstop.com/2009/02/04/golden-image-or-foil-ball/"&gt;foilball&lt;/a&gt;) and only addressed configuration. Other Capistrano-based projects took the additional step of automating calls to package installers to setup an empty machine. All of these projects provided a quick way to deploy a Rails application on a new server.  Despite their utility, the approach has a number of shortcomings: increased code complexity, not idempotent, difficult to model complex dependencies, only executable via cap, difficult to manage existing systems, etc. When all you have is Capistrano, everything looks like a cap task.&lt;/p&gt;


	&lt;h3&gt;Automate&lt;/h3&gt;


	&lt;p&gt;With the rise of the clouds, automation tools are getting a lot attention recently. Unbeknownst to most developers, sysadmins and operations folks have been using an automation tool called &lt;a href="http://reductivelabs.com/projects/puppet/"&gt;Puppet&lt;/a&gt; for the past few years. Puppet is written in Ruby and provides its own external &lt;span class="caps"&gt;DSL&lt;/span&gt; and services for managing infrastructure. In addition, the new, Puppet-inspired &lt;a href="http://wiki.opscode.com/display/chef/Home"&gt;Chef&lt;/a&gt; is helping spread the gospel of automation to Rails developers. More awareness is a good thing. Automation is a best practice that all Rails developers should add to their development process.&lt;/p&gt;


	&lt;h3&gt;Cheese and Crackers&lt;/h3&gt;


	&lt;p&gt;By using using Puppet with Capistrano, we can use the right tools for the right job. The issue of how to partition the work between the two tools has been been recently &lt;a href="http://www.agileweboperations.com/puppet-or-capistrano-use-the-right-tool-for-the-job/"&gt;discussed&lt;/a&gt; by Andrew Shafer of &lt;a href="http://www.reductivelabs.com/"&gt;Reductive Labs&lt;/a&gt;. Although I think we can push more onto Puppet then Andrew suggests, we both agree when Adam Jacob &lt;a href="http://osdir.com/ml/sysutils.puppet.user/2007-10/msg00073.html"&gt;writes&lt;/a&gt;: &lt;em&gt;Capistrano and Puppet go together like cheese and crackers&lt;/em&gt;.&lt;/p&gt;


	&lt;p&gt;One of our current goals is to easily integrate server automation into &lt;strong&gt;every&lt;/strong&gt; Rails deployment. The challenge is that existing tools are just frameworks and have no knowledge or opinion on deploying Rails applications. Some developers will take the time to learn the tools and others won&amp;#8217;t. This is understandable since spending time learning about automation frameworks is time not spent developing revenue-generating features.&lt;/p&gt;


	&lt;h3&gt;shadow_rails&lt;/h3&gt;


	&lt;p&gt;To jump start the process, I&amp;#8217;ve written an example called &lt;a href="http://github.com/wrecked/shadow_rails/tree/master"&gt;shadow_rails&lt;/a&gt; that can be used as a starting point for introducing automation into your existing deployment process. The code is written using &lt;a href="http://blog.railsmachine.com/articles/2009/01/27/introducing-shadowpuppet/"&gt;ShadowPuppet&lt;/a&gt; to install packages and configure the system. The tricky part is that Ruby-based automation tools require &amp;#8216;ruby&amp;#8217;. Therefore, there is a little bootstrapping script to install Ruby Enterprise Edition from source or the Ubuntu 8.10 ruby packages. In addition, shadow_rails installs Apache, MySQL, Passenger, and Rails. It configures Apache, creates your database, and sets up the Capistrano directories. From the comfort of your development box, you can go from nothingness to a deployed app in one command: &lt;code&gt;cap deploy:bootstrap deploy:migrations&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;This project is meant to help you get going with using automation and not the final word in deployment. To get started, read the &lt;span class="caps"&gt;README&lt;/span&gt; in the GitHub &lt;a href="http://github.com/wrecked/shadow_rails/tree/master"&gt;repository&lt;/a&gt;.  Clone and browse around the code to get familiar with the syntax. Fork the code and try to make it work for your application. There are even a few rspec examples written using ShadowFacter for those interested in exploring &lt;em&gt;behavior driven automation&lt;/em&gt;.&lt;/p&gt;


	&lt;p&gt;You&amp;#8217;ll need a fresh install of Ubuntu 8.10 with an admin user named &amp;#8216;rails&amp;#8217; and ssh installed. I highly recommend using a virtualization tool like &lt;a href="http://vmware.com/products/fusion/"&gt;VMware Fusion&lt;/a&gt; on &lt;span class="caps"&gt;OS X&lt;/span&gt; or &lt;a href="https://help.ubuntu.com/community/VMware/Player"&gt;VMware Player&lt;/a&gt; on Ubuntu for testing. Using snapshots and rollbacks, testing your manifest is super easy for both clean installs and existing ones as the manifest evolves.&lt;/p&gt;


	&lt;h3&gt;Feedback&lt;/h3&gt;


	&lt;p&gt;Please let me know what you think and ping me with any questions. If you are a Rails Machine customer and would like to try it on a new virtual machine, please &lt;a href="https://support.railsmachine.com/index.php?pg=request"&gt;submit&lt;/a&gt; a ticket.&lt;/p&gt; </description>
      <pubDate>Tue, 10 Feb 2009 16:41:00 GMT</pubDate>
      <guid>http://blog.railsmachine.com/articles/2009/02/10/rails-deployment-and-automation-with-shadowpuppet-and-capistrano/</guid>
      <link>http://blog.railsmachine.com/articles/2009/02/10/rails-deployment-and-automation-with-shadowpuppet-and-capistrano/</link>
    </item>


  </channel>
</rss>
