An opportunity for JuJu - django deployment

Mark Mims mark.mims at canonical.com
Tue Nov 29 20:22:39 UTC 2011


On 11/29/2011 08:11 AM, Michael Nelson wrote:
> On Tue, Nov 29, 2011 at 3:23 PM, Gustavo Niemeyer
> <gustavo.niemeyer at canonical.com>  wrote:
>>> Here's an initial apache-django-wsgi charm deploying apps.ubuntu.com -
>>> the demo is using LXC:
>>>
>>> http://micknelson.wordpress.com/2011/11/22/a-generic-juju-charm-for-django-apps/
>> Wow, this is _awesome_ Michael.
>>
>> Have you been using this personally to deploy django apps, or is it
>> mostly in the experimental territory so far?
> Cool - thanks Gustavo. It's still in experimental territory atm as
> there is a bunch of assumptions it's currently making (listed on the
> blog post). If I get some time in the next weeks I'll remove those
> assumptions and add other bits (like supporting an interface for
> haproxy etc.)
integrating with reverse proxies...

add to metadata.yaml:
{{{
provides:
   website:
     interface: http
}}}

add hooks/website-relation-joined
{{{
#!/bin/sh
relation-set port=80 hostname=`unit-get private-address`
}}}

then haproxy or varnish can front your service... the first step in 
horizontally scaling your django app.  The proxies are pretty simplistic 
for now (no path-specific behaviors... it's all off of root), but it works.

This one simple step makes you look at your hooks a little 
differently... idempotency has new meaning when your app nodes 
create/migrates databases.  I was frankly shocked at how well this 
worked with rails.  By far the easiest story for horiz scaling a rails 
app I'd ever seen.  Really what sold me on juju at the time.

> -Michael
>
>> --
>> Gustavo Niemeyer
>> http://niemeyer.net
>> http://niemeyer.net/plus
>> http://niemeyer.net/twitter
>> http://niemeyer.net/blog
>>
>> -- I'm not absolutely sure of anything.
>


-- 
Mark Mims, Ph.D.
Canonical Ltd.
mark.mims at canonical.com
+1(512)981-6467




More information about the Juju mailing list