Easy Deployment of Rack Applications with Juju
What is Juju?
Juju is a service orchestration management tool developed by Canonical. With Juju, it is easy to build entire environments on public clouds, such as Amazon Web Services and HP Cloud, as well as private clouds built on OpenStack or raw bare metal via MAAS.
Juju uses Charms—scripts that can be written in any language to deploy and configure services. There are over 100 services ready to deploy.
With Rack Charm, you can deploy your applications on Amazon EC2 in just a few minutes. Let me provide you some examples. All the examples are tested for Ubuntu 12.04 Precise Pangolin.
Getting started
Install Juju.
Run the command-line utility with no arguments to create a sample environment.
Configure your ~/.juju/environments.yaml
environment. See how to run services on your local machine via Linux containers in this documentation. Below is the Amazon EC2 example.
Bootstrap the environment.
Sinatra example with the html2haml
app
Deploy a web server.
Create a configuration file for Rack Charm. Let’s call it html2haml.yml.
Deploy Rack Charm with the config you have created in the previous step.
Relate the config to the web server.
Open the stack up to the outside world.
Find the nginx-passenger
instance’s public URL.
The Ruby-on-Rails v3.0 example
In Ruby on Rails, the process resembles the Sinatra deployment, but additionally, the PostgreSQL database is used.
Create the sample_rails.yml
config file.
Deploy the application and the web server.
Deploy PostgreSQL and relate it to the application.
Expose nginx-passenger
and find its public URL.
For more, check out the Juju documentation and the Juju GUI documentation. Juju GUI is a web interface you can deploy right into your environment. It lets you model and design the entire stack via a web browser, including integration with the Juju Charm Store.
Further reading
- Deploying the Discourse Discussion Platform with Juju Service Orchestration
- Deployment Tools for Cloud Foundry: BOSH vs. Juju Charms
- How to Implement Integration Tests for Juju Charms
About the author
Pavel Pachkovskij has experience in front- and back-end development of web applications. He is proficient in Ruby, Ruby on Rails, JavaScript, CSS, etc. Pavel also worked with relational databases, such as MySQL, MariaDB, PostgreSQL, as well as NoSQL solutions, such as MongoDB and Redis. Find him on GitHub.