Practical Technology

for practical people.

Juju: DevOps for Cloud Services


PORTLAND, OR: Canonical, Ubuntu Linux’s parent company, is trying to make Development/Operations (DevOps) on the cloud easy with its Juju framework. The Juju project has been around for a while, but frankly it wasn’t that impressive… until now. At a demo at the Open Source Conference (OSCON), Jorge Castro, a Canonical developer relations executive, and Mark Mims, a software engineer, showed that Juju is finally ready for cloud prime time.

As Castro explained, the main idea of Juju is to get rid of “metawork,” which Castro explains is “all the work you have to go through, such as setting the program up, before you can start using the program.” He gave an example of Subway, an Internet Relay Chat (IRC) client that’s rapidly gathering fans. When Subway first gained attention, its developer was flooded with requests – on how to install its back-engine DBMS, MongoDB. Anyone with time in service in IT has seen this kind of thing; sometimes it’s called “yak shaving.”

What Juju does is give developers and system administrators the tools needed, according to Castro, at the service level, not the machine level. “It’s an app get [the popular Debian/Ubuntu shell software install program] for the cloud,” he says.

Juju is not, Castro emphasizes, a replacement for tools such as Puppet and Chef, which automate machine configuration, so that every server has an identical software configuration and is running the correct services. No: Juju manages services not machines.

In particular, Juju can be used for Ubuntu services on the Amazon and OpenStack clouds, on bare metal via Management as a Service (MaaS), and locally with lxc, a virtual environment system. It’s also available as an experimental service on Microsoft’s Azure.

What Juju actually provides are charms. “These are shareable, re-usable, and repeatable expressions of DevOps best practices,” says Castro. “You can use them unmodified, or easily change and connect them to fit your needs. Deploying a charm is similar to installing a package on Ubuntu. Ask for it and it’s there; remove it and it’s completely gone.”

In the demonstration, Mims showed how by simply running the appropriate handful of charms he could set up a Hadoop, a clustered server program for managing big data, master and ten slaves, along with their operating systems and other dependencies, on the Amazon cloud. He didn’t need to worry about where the servers were or how to set them up; the charms took care of all of that.

This wasn’t just a demo, though. Castro said that Ubuntu “dog-foods” Juju all the time for its own cloud work.

Each charm contains the settings for each service and how each should be configured. While Juju is written in Python, its charms can be written in any language. You can write them in Python, Bash, Puppet script, whatever works for you. Once written and proved, you can then use them to bring up services and connect them together without worrying over the dirty details.

At this time, Canonical has about 90 charms available in its public charms repository, Juju Charms. Repository? Yes, continuing the apt-get analogy, Canonical made these cloud service set-up programs available to anyone with a Charm client. Currently there are charms to set up such popular cloud/server applications as CloudFoundry, Drupal, MySQL, Tomcat, and WordPress. These applications, in turn, all run on Ubuntu 12.04 instances on whatever your supported cloud of choice is. 

However, Juju can do more than automate setting up cloud services. You can use Juju to add relationships between applications. Castro says, “Juju lets you stick together services like Legos.”

For example, you can tell Hadoop to talk to a particular DBMS or set up a LAMP stack with the specific version of each program you want for your application. You can also use it to set up multiple instances with a single command. For instance:

juju add-unit -n20 hadoop-slavecluster

is all you need to set up twenty slave instances of Hadoop. In tests, Canonical has had up to 2,000 such instances invoked and running with Juju. (Of course, if you don’t want someone at your company setting up 2,000 instances, you can write the charm to limit the possible number of instances to a more sane 100.)

These charms can do more than just install and take down service instances. For example, one MySQL charm has three settings: running-level=fast, safe, unsafe. Fast is optimized for speed; safe is faster than a vanilla MySQL installation; and unsafe sets MySQL to run with the accelerator down and no brakes. You also can tune a charm to better meet your database needs.

Let’s say that you’re provisioning a service for Ruby on Rails programmers, a group of developers who are well-known for always wanting the newest possible version of their favorite tools. You can set up an appropriately crafted charm so that every time you start instances they automatically update to the freshest possible programs. On the flip side, you can use a generic charm that always invokes, say, the same version of MySQL.

The charms are all open source. If you make changes, you can submit the charm to Canonical for inclusion in the public repository, have your own repository on Canonical’s service, or just keep your versions in your own private Juju repository.

Juju is also relatively safe. When you call a charm from the Juju repository, the connection is made through Secure Socket Layer (SSL) connections.

I can see Juju making a cloud admin’s life much easier. By focusing on high-level services instead of low-level components it makes it a snap to set up not merely machines or specific images but unique combination of services.

The Canonical crew are the first to admit that there’s a lot more work to be done. This ranges from such broad areas as storage, where Juju really does very little at this point, to such specifics as the PostgreSQL charms needing much more work. Still, Juju is already very useful, the Canonical development team wants your help to make it even better, and, as Castro says, “Anything that makes metawork easier is good.”

A version of this story first appeared in HPIO

Leave a Reply