CohesiveFT's Elastic Server platform is a web-based factory without all the noise and occasional grime. Inside the factory, you can create a server "blueprint" that is created from components in our library, or components you upload yourself. Your custom-assembled server can be deployed to a variety of virtualization and cloud environments. Did we mention the
Community Edition is free?
In this blog post,
Yan Pritzker is going to show you how to quickly get your Rails app from your local repo, or from
GitHub, up to Amazon EC2 in a few easy steps.
To make this post easy to follow, the first section will talk about turning your Rails application into a component in our library, and the second section will talk about how to use that component in an Elastic Server running in the cloud.
Part 1: Turning your Rails app into a component in Elastic ServerLog into
Elastic Server with your free community account and click on
My Packages under the Account tab.

Select Ruby on Rails from the Package type drop-down menu, and fill out the form with the name of your application. I'll be doing an example using my Working From Home application, a simple way to let coworkers know where you'll be on a particular day.

Click through to Step 2 to upload your application. Either use a zip or tarball you created locally, or if you use GitHub as your repository host, use a convenient url like http://github.com/your_login/your_project/zipball/branch_name to have Elastic Server grab your project directly from GitHub. Cool! Using GitHub makes it really easy to build new versions of your application as Elastic Server components.

Your package will begin building. This should take a minute or so.

If your application has special startup needs (such as running migrations to create the initial dataset), you may want to create a component to do this. Go back to creating a new package, and choose a Run On Boot script. This is a quick way to do boot-time configuration and maintenance for your Elastic Server.

Meanwhile, back at the My Packages screen, your packages should have finished building. Since we'd like to always take these two packages together, we'll connect them by creating a bundle.

The bundling process lets you select the packages you like and group them together. Use the Package Bundler view to select your packages from the My Packages tab, and place them in the cart. Then click the aptly titled, "Create The Bundle" button under the cart to, yes, create your bundle.


Once your bundle has been created, Elastic Server can assemble a server! You'll be taken to the page created for your bundle. Click the Add to Cart link to get it into your bundle cart and prepare to build a server. Note this Known Issue: We currently have a ten-minute delay before a package can actually be used in a server, which is not "as it should be." We're working tirelessly to make this issue go away, so thanks in advance for understanding.

Part 2: Assembling Your Elastic ServerSince we're building a Ruby on Rails server, we'll need to add components like Mongrel and Nginx or Apache and Passenger to our server. A great place to start is the Rails Community Portal, a special page that groups together the best Rails components available on Elastic Server. This page also has some instructions and a link to a Capistrano script that can help you deploy your apps directly to Elastic Servers running in the wild.

You could build a page just like this for your product, company, or team, but we'll get into that in another post :-) After picking the components you like from this page, we're ready to go to the configuration screen.

Important: Please note that in order to deploy your server to Amazon EC2, you'll need to add your AWS credentials on the cloud manager page. This page uses SSL for security and your credentials are stored in encrypted fields.
The configuration screen lets you name your server and pick a virtualization or cloud format. We'll be going straight to Amazon EC2 for this demo, but a great way to test your applications is to download a VMWare image and run it in VMWare Fusion for Mac or VMWare Player for Windows. Note on the left side we have a list of components going into this server. This information is always saved with every server you build, making it easy to recreate the same setup at any time, in any format you choose. No more having to rememember exactly what you tweaked to get your box to work :-)
When you click the build button, you'll be taken to the dashboard, which shows you the progress of your server. Depending on the amount of software going into your Elastic Server, the process may take from 5-15 minutes. When it's finished, you'll get an email with a link to your newly running Amazon EC2 Instance!
You can also check out the status of your instances at the cloud manager. This page provides easy access to your running instances, as well as a link back to the Elastic Server information, so that you always know what's running in a particular server. Just one thing left to do to launch our app!

Clicking on the Admin Console link on the cloud manager, or from your email, you'll be taken to your freshly minted Elastic Server running in the cloud. The web-based admin console, also known as Elastic Server Manager will prompt you to change the default admin password for security. Then, you'll be on to the services screen where you'll see an entry for Mongrel/Nginx or Apache/Passenger, or whatever configuration you've picked from the Rails portal.
Components in the Elastic Server library come with plugins called
rubberbands that enable components to provide their own configuration screens for the Elastic Server Manager. Imagine shipping your Elasticized Rails app with its own admin screen that makes it easy for your users to administer the server without knowing anything about Rails? We'll pause while you imagine...
To start and stop your Rails application, simply click the Start or Stop button next to the service. Congratulations, your Rails app is now running on port 9000! Don't forget that you can now easily start and stop more instances of the server using the cloud manager, and explore the Elastic Server Manager for more fun stuff like the ability to view your application's logs without ssh into the server.

And that is how you Elasticize your Rails app. Thanks for joining us. We welcome your feedback in the comments, or our friendly
support forums.