TorqueBox on OpenShift Express
We are pleased to announce that you can now run Ruby applications on top of TorqueBox with the free Red Hat OpenShift Express Platform-as-a-Service. OpenShift Express has supported Ruby applications for some time on Passenger but now you have the option of using TorqueBox for greater power and flexibility.
Try It Out
The most up-to-date instructions live in our torquebox-openshift-express repository but I've included the steps below to get up and running on OpenShift Express in a few minutes.
- Register for OpenShift Express
- Install OpenShift client gems -
gem install rhc
- Create a domain name -
rhc-create-domain -n mydomain -l username
- Create an AS7 application -
rhc-create-app -a myapp -t jbossas-7.0
- Convert the newly created Java application to Ruby for use with TorqueBox
ruby java_to_ruby.rbto convert your application
- Confirm changes and commit result - be sure to
git addthe new files
git add .openshift/config/modules
git add config.ru
git commit -am "Converted to TorqueBox"
git pushyour new Ruby application
- During this first push Express will download the necessary TorqueBox and JRuby installations then start your application
- Visit your new application at http://myapp-mydomain.rhcloud.com - if everything worked you should see an OpenShift splash page
- Edit your application and
git pushto deploy new changes
Once you get your sample application running check out the OpenShift Express User Guide and the Ruby on Rails Express Quickstart Guide to learn more about the OpenShift client tools (rhc-* commands) and how to deploy a Rails application.
For the curious, we piggyback on top of the JBoss AS7 support in
OpenShift Express by adding the TorqueBox modules and a JRuby
installation in a post-receive hook on the server. This hook is stored
inside your application's git repository at
.openshift/action_hooks/build if you'd like to take a peek.
We're running on JRuby 1.6.4 and a 2.x incremental build of TorqueBox. If you'd like to run a newer TorqueBox incremental build than the default one, just edit this post-receive hook and specify a higher build number found on our 2.x builds page.
We don't yet have messaging or STOMP support in OpenShift Express but will continue to work on adding support for the full TorqueBox stack. Memory is also quite constrained so you'll need to be careful when deploying applications that use multiple Ruby runtimes (jobs, services) that you don't run out of memory.
Even with these limitations TorqueBox still provides a lot of features and better performance compared to a vanilla Ruby application running on Passenger.
If you need the full power of TorqueBox, it will soon be available on OpenShift Flex without memory or feature constraints. We'll post more details once that happens.
Please try it out and give us your feedback!