We’ve got some changes in Juju and the Juju ecosystem that have been landing this week.

Ian Booth announced the move of Juju core to github.com. You can find all our work at: https://github.com/juju.

Workflow instructions for contributing are available in the CONTRIBUTING file. Ian also adds:

Once the dust settles on the migration of juju-core, we’ll also be migrating various dependencies like goose, gwacl, gomaasapi and golxc.

You can find the code for Juju Core at: https://github.com/juju/juju

On a related note, we have a one way mirror of the Juju Charm Store as well: https://github.com/charms

You can combine these with Francesco Banconi’s git-deploy plugin to deploy right from github, as an example:

juju git-deploy charms/mysql

Hopefully 2-way syncing will be possible soon, stay tuned!

The following is a guest post by Ian Booth:

Juju has the ability to set up and change logging levels at a package level so that problems within a particular area can be better diagnosed. Recently there were some issues with containers (both kvm and lxc) started by the local provider transitioning from pending to started. We wanted to be able to inspect the sequence of commands Juju uses to start a container. Fortunately, the Juju code which starts lxc and kvm containers does log out the actual commands used to download the requisite image and start the container et al. The logging level used for this information is TRACE. By default, Juju machine agents log at the debug level, and this information can be seen when running ‘juju debug-log’. So unfortunately, this means the information we are interested in is not visible by default in the machine logs.

Luckily we can change the logging level used for particular packages so that the information is logged. This is done using the ‘logging-config’ attribute and can either be done at bootstrap:

juju bootstrap --logging-config=golxc=TRACE

or on a running system:

juju set-env logging-config=golxc=TRACE

As an aside, you can use:

juju get-env logging-config

to see what the current logging-config value is.

The logging-config value above turns on TRACE level dubugging for the golxc package, which is responsible for starting and managing lxc containers on behalf of Juju. For kvm containers, the package name is ‘kvm’.

We can use debug-log to look at the logging we have just enabled. As of 1.19 onwards, filtering can be used to just show what we are interested in. Run this command in a separate terminal:

juju debug-log --include-module=golxc

Now we can deploy a charm or use add-machine to initiate a new container. We can see the commands Juju issues to download the image and start the container. This allows us to see what parameters are passed in to the various lxc commands, and we could even manually run the commands if we wish, in order to reproduce and examine in more detail how the commands behave. An example of the logging information when adding TRACE level debugging to lxc startup looks like:

machine-0: 2014-05-27 04:28:39 TRACE golxc.run.lxc-start golxc.go:439 run: lxc-start [--daemon -n ian-local-machine-1 -c /var/lib/juju/containers/ian-local-machine-1/console.log -o
/var/lib/juju/containers/ian-local-machine-1/container.log -l DEBUG]
machine-0: 2014-05-27 04:28:40 TRACE golxc.run.lxc-ls golxc.go:439 run: lxc-ls [-1]
machine-0: 2014-05-27 04:28:41 TRACE golxc.run.lxc-ls golxc.go:451 run
successful output: ian-local-machine-1
machine-0: 2014-05-27 04:28:41 TRACE golxc.run.lxc-info golxc.go:439 run:
lxc-info [-n ian-local-machine-1]
machine-0: 2014-05-27 04:28:41 TRACE golxc.run.lxc-info golxc.go:451 run
successful output: Name: ian-local-machine-1
machine-0: 2014-05-27 04:28:45 TRACE golxc.run.lxc-start golxc.go:448 run failed
output: lxc-start: command get_cgroup failed to receive response
machine-0: 2014-05-27 04:29:45 TRACE golxc.run.lxc-ls golxc.go:439 run: lxc-ls [-1]
machine-0: 2014-05-27 04:29:45 TRACE golxc.run.lxc-ls golxc.go:451 run
successful output: ian-local-machine-1
machine-0: 2014-05-27 04:29:45 TRACE golxc.run.lxc-info golxc.go:439 run:
lxc-info [-n ian-local-machine-1]
machine-0: 2014-05-27 04:29:45 TRACE golxc.run.lxc-info golxc.go:451 run
successful output: Name: ian-local-machine-1

You can see that when logging the various commands execute, the format is cmd [arg arg arg]. So to run these manually leave out the []. You can also see that there was a problem starting the lxc container due to a cgroups issue. This error is shown in juju status, but often it’s useful to see what happens leading up to the error occurring.

In summary, Juju’s configurable logging output can be used to help diagnose issues and understand what Juju is doing under the covers. It offers the ability to turn on extra logging when required, and it can be turned off again when no longer required.

For those of you using Vagrant we are now listing our Juju Vagrant boxes here:

For those of you on OSX and Windows this is a slick way to get Juju with the GUI out of the box deploying to containers for a nice local development resource. Here are the docs on how to use them if you are unfamiliar with Vagrant.

Just how popular is Ubuntu with Vagrant users? 7 out of the top 10!

And just a reminder that we’ll be using these tomorrow (Friday) during our charm school on using Juju with Vagrant, see you at 1500 EDT on #juju and http://ubuntuonair.com!

For the past cycle we have been working with IBM to bring Ubuntu 14.04 to the POWER8 architecture. For my part I’ve been working on helping get our collection of over 170 services to Just Work for this new set of Ubuntu users.

This week Mark Shuttleworth and Doug Balog (IBM) demoed how people would use a POWER8 machine. Since Ubuntu is supported, it comes with the same great tools for deploying and managing your software in the cloud. Using Juju we were able to fire up Hadoop with Ganglia monitoring, a SugarCRM site with MariaDB and memcached, and finally a Websphere Liberty application server serving a simple Pet Store:

No part of this demo is staged; I literally went from nothing to fully deployed in 178 seconds on a POWER8. Dynamic languages just work, and most things in the archive (that are not architecture specific) also just work; we recompiled the archive to ppc64le over the course of this cycle and if you’re using 14.04 you’re good to go.

For reference here’s the entire Juju demo as we did it from behind the curtain:

This is the power of Juju!

We’ve been trying to get our Java developer story in order, as it’s one of the areas where users have been telling us they’d like to see made easier to manage. We brought Matthew Bruzek on board, who will be focusing on our Java framework stuff.

Here’s his first cut, and it’s a big one. We now finally have an all emcompassing Apache Tomcat Charm. This charm allows you to develop your app on top of it as a subordinate charm and be able to deploy it. As an example, let’s deploy OpenMRS.

juju deploy tomcat7
juju deploy openmrs
juju deploy mysql
juju add-relation openmrs mysql
juju add-relation openmrs tomcat7
juju expose tomcat7

The magic happens when you relate openmrs to tomcat7, that installs OpenMRS in Tomcat, and then you’re good to go.

The charm contains a ton of options for you to check out, including deploying to Tomcat6 if that’s how you roll.

Those of you looking for “just shove my war file out there” can check out Robert Ayre’s j2ee-deployer charm. Here’s a blog post on how to use it.

That one is not in the charm store yet, but we’ll get to it!

Some good news for monitoring SaaS Fans, ServerDensity is now in the Juju Charm Store. This means that the ServerDensity agent is now available to tack onto any deployed service in your environment. We call this kind of charm a subordinate, here’s how you’d use it.

Let’s deploy a MongoDB Cluster:

juju-quickstart bundle:mongodb/cluster

This is a 13 node cluster, let’s add some monitoring! First we’ll deploy serverdensity, and then the crucial step, relating serverdensity to the service:

juju deploy serverdensity
juju add-relation mongos serverdensity

Now let’s tell ServerDensity that we want it to monitor Mongo and we need an API key since it’s a service that needs a key:

juju set serverdensity agentkey="Keyfromyourserverdensitycontrolpanel"
juju set serverdensity mongodb-server="ip of mongos node"
juju set serverdensity mongodb-dbstats=true

Now, why do I need to give it the ip of mongo’s node? Well, as v1 of this charm we’re setting this manually, but what we could do in the future is take care of those settings as soon as the relationship is made instead of making the user set those config values. But hey, why nitpick, monitoring a MongoDB cluster with 5 commands isn’t a bad place to start!

There are a bunch of configuration options for you to play with for service monitoring with Apache, MySQL, and RabbitMQ. When used standalone the charm will just do machine monitoring for whatever you related it to.

“Rick, I want you to fire up an empty cloud deployment”, said no boss ever.

The various teams who make up “The Ubuntu Server Team” work on various bits. Some work to make OpenStack easy to deploy, some work on packaging, some work on building images for all the public clouds we support. All this is fine and dandy, but at the end of the day, our users deploy things on top of Ubuntu Server, and these workloads are really what it’s all about.

Over the past two years it’s been increasingly obvious to us that orchestrating workloads is becoming one of the most important things we can help users with. What’s the point of an easy to use OpenStack installer if people can’t plop Hadoop, or Cassandra, or their Rails app right on top easily?

One part of this solution is our work on Juju, which makes orchestration simple; we can just manage deployments at the service level while not caring (too much) about individial instances. Some people wanted and needed things to be even highter level. “Look, I’ve got a pile of machines over here, I need a MongoDB cluster” and you don’t have the time! Or more increasingly, you know how to do all these steps, but need a way to make it portable so everyone else in your organization can benefit from your hard work.

So today we announced Juju Bundles. Technically, they’re very simple, it’s a yaml file that describes charms and their relationships to other charms. It can contain machine constraints, or any of the parameters you’d ship in a charm. That means deploying large swaths of services are now one command.

juju quickstart bundle:~charmers/mongodb/cluster
juju quickstart bundle:~charmers/hadoop/cluster
juju quickstart bundle:~charmers/mediawiki/scalable

There’s a 13 node 3 shard MongoDB cluster, a 7 node starter Hadoop cluster, and a 5 node Mediwiki. All of them can be horizontally scaled out of the box. juju add-unit -n10 hadoop-slavecluster and go to town. Not Bad!

Getting Started

If you’re on Ubuntu Rick has the info in his blog post, you basically:

sudo add-apt-repository ppa:juju/stable
sudo apt-get update
sudo apt-get install juju-quickstart

Then run one of the commands I mentioned:

juju quickstart bundle:~charmers/mongodb/cluster

Juju will then walk you through setting up an environment. Pick one. AWS, Microsoft Windows Azure, Joyent, HP Cloud, or your own OpenStack or laptop via LXC, then fill out your creds:

Now get a cup of coffee, or watch the console for the magic, maybe read the README.

Now go put that bad boy to work.

Quickstart is not yet available for OSX or Windows (we’re working on it), but if you want to play with it we’ve made a Vagrant box available for you to play with.

The Future

Over the course of the next few weeks as we ramp up to 14.04 we’ll be doing a few things. We’ll be tightening up the URLs to be easier to remember, so something like juju quickstart bundle:mongodb/cluster. Obviously we’d love to see more bundles from the community being submitted.

Check out the documentation for more, and for a more technical description of how bundles work check out Rick’s blog post. We also made a tutorial video on how to make and share your own bundles.

It’s that time of the year where elections are needed for 2 available moderator positions on Ask Ubuntu.

Here are the list of nominees, if you have 150 rep on the site you can cast a vote.

The primary closes in 3 days, after which the election begins. Please take the time to read the statements from each of the candidates and cast a vote!

One of the more annoying things about setting up cloud tools is copying and pasting your auth keys and strings into config files. Some people set variables, other have config files.

One thing we wanted to do in Juju is to make sure that people can generate the proper configs for their clouds, and that can be problematic with people copying and pasting snippets around, so behold, juju quickstart.

When invoked with juju quickstart -i we offer you fields to fill in for whatever you are deploying on:

And here’s the fields for a provider:

And here’s my favorite part, when a field is wrong or missing, it tells you!

This should help making it easier to get up and running.

Right before the holidays Robie Basak filed a Main Inclusion Report for nginx in Ubuntu. What does this mean? This means that nginx will sit alongside Apache in 14.04 with full security updates over the life of the release.

This is excellent news for those of you using stacks that tend to use nginx; increasing our support of nginx has been something many Ubuntu Server users have been telling me they’d like to see and it’s good to see us make some progress in this area.

All this is possible due to Thomas Ward; who has been rocking nginx in Ubuntu for a while now. Without his tireless efforts this couldn’t have been possible! He’s also maintaining PPAs for stable and development releases of nginx for every Ubuntu release since 10.04. What an excellent contribution to the community!

On the Juju front we have some charms that allow you to dynamically swap between Apache and nginx. Over the course of the year we’d like to see more charms have an option to use nginx. If you are interested in working on that, let me know.

UPDATE: Note that the MIR has been filed, technically it is not in main yet, and it must go through that process, but we’re confident that there won’t be major issues in time for 14.04.