We had alienth from Reddit hanging out during one of the Ubuntu Global Jams and he took a moment to hang out with us in #juju and tell us a little bit about how they deploy Reddit.
I started with the Reddit Installation instructions and found out some of the technology they use. Postgres, Cassandra, Rabbit, and memcached. Hey, we just so happen to have charms for those services.
Then I learned that they have an install script that installs reddit. Well, if this was charmed up we could do:
juju bootstrap
juju deploy reddit
juju deploy postgres
juju deploy cassandra
juju deploy memcached
juju deploy rabbitmq
Then relate them all to reddit, the hooks in the charm would then do what the installation instructions say for each service:
juju add-relation reddit postgres
juju add-relation reddit cassandra
juju add-relation reddit memcached
juju add-relation reddit rabbitmq
And then after all the instances have fired up you can just juju expose reddit
, which opens up the port, and then you just hit up the URL.
This would be an awesome charm for a bunch of reasons. First, we have existing charms for everything they need already, the magic would be in how to relate the services to the reddit charm. Theoretically we could juju add-unit cassandra
and that would just work. We’d need to test it to find out.
The other bit that is interesting is that if you see the comments in the script people are having small problems getting it to work. Things like “the script uses aptitude and that no longer works.” Well, if this was a charm it would just live in the juju charm store, where people can fix it (like they are already doing on github). But the difference between living in a github gist and the charm store is that we continuously automatically check every charm so we know it works, and it’s easily findable by any Ubuntu server user.
To me that is the best part about juju. Take our convenience scripts off of pastebins and into a place where we can keep them updated, tested, and deployable for everyone. I am hoping that someone takes Reddit and submits it into the juju Charm Contest so that we can make it rock.
Any takers? We’ve got a mirror of our charms on github if you want to take the gist and start charming it up. Here’s how you can get started if you are interested.