Musings on computers and software as I continue learning and sharing software development knowledge.

Friday, September 27, 2013

Enchanting cloud with juju !

Automating infrastructure is not a new thing, but doing so with the ease of setting up paas is still in its infancy. As an interesting solution to this, Cannonical has recently come out with a PAAS tool Juju that can easily setup, configure, provision, include and change master/slaves, provide continuous integration environment among other things. This tool has not come out from wild, but is currently in use: Juju and MaaS are the default deployers for Openstack. So all large Openstack deployments that are currently happening on Ubuntu use Juju and MaaS. Additionally Ubuntu One and other Ubuntu cloud services are all running on top of Juju.
Juju might sound similar to Puppet or Chef, but rather than just providing a server, this provides various services. Internal to each juju are different charms that call various programs and provide the infrastructure to the juju. The charms App Store contains charms on various services which can be used in the juju to solve a particular task. There are currently hundreds of different charms available - from databases to php/ruby/python servers to nosql and hadoop instances and a growing community of developers who customize and release their own customized charms.
One feature that is worth mentioning is the ability to create a traditional Paas such as CloudFoundary as a charm to run over juju.
For instance, here's the procedure to boot off a rails sever:juju deploy rails myapp --config sample-app.yml
(This yml file contains the url to the github repository containing the charm)juju deploy haproxyjuju add-relation haproxy myapp
Now the database can be created:juju deploy postgresqljuju add-relation postgresql:db myapp
then migrate the databasejuju ssh myapp/0 run rake db:migrate
Finally expose the proxyjuju expose haproxy
and view the status, which should provide you with the public urljuju status haproxy
The coolest feature now is to add/remove servers horizontally through gui or through command as:juju add-unit myapp juju remove-unit myapp
Currently, there is also a charm-championship taking place that encourages developers to take part in developing customized charms for various themes.
So what are you waiting for?
Jump right in at https://jujucharms.com to see it in action.