Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Need advise for Django deployment on Amazon EC2 with Loadbalancers
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Lin Chuan  
View profile  
 More options May 18 2012, 11:03 am
From: Lin Chuan <linchuan.ch...@gmail.com>
Date: Fri, 18 May 2012 23:03:21 +0800
Local: Fri, May 18 2012 11:03 am
Subject: Re: [HackerspaceSG] Need advise for Django deployment on Amazon EC2 with Loadbalancers

The problem with "push" style solutions is that they are not indempotent,
which means that they would execute commands and scripts imperatively
without first checking whether or not they ought to do so.  This might
cause unintended side effects.

It is of course possible to write "if" checks virtually everywhere and
micromanage every script to check before execute like what python cuisine
does with its _ensure idiom but this approach can be quite hackish and
bulks up your fabric script significantly.

"Push only" approaches are fine for small scale stuff (2-10 servers), but
once you have a lot of servers, a push system will begin to show its
limits, unless of course you implement multiprocessing in your scripts.

"Pull" type solutions on the other hand are declarative (i.e. indempotent)
in nature, so no silly "if" checks everywhere; but the downside is that
they are much more complex and time consuming to implement .

Which is why people usually use a mix of push-and-pull in a real life
deployment.
*  Push-style scripts for provisioning application code and services.
*  Pull-type solutions for initial server configuration and configuration
file management (managing conf files for postgresql, memcached, task
server, web server, other specialised services with a conf file etc).

On Fri, May 18, 2012 at 10:50 PM, Benjamin Scherrey <proteus...@gmail.com>wrote:

> Martin we're doing much of what you describe, using fabric as I believe
> you are. Haven't found any "off the shelf" solutions. All our stuff is
> custom scripts which we try to implement is as functional (no side effect)
> a manner as we can which is challenging when dealing with real-world
> systems. I guess that's why they call it DevOps.

>  -- Ben

> On Fri, May 18, 2012 at 3:09 PM, Martin <martin.brochh...@googlemail.com>wrote:

>> Hi all,

>> has anyone on this list experience with deployments on the Amazon cloud?

>> Our stack is like this:

>> * Loadbalancer spawns AWI instances
>> * AWI instance has Django sites
>> * Each Django site hast the same PostgreSQL DB defined in their
>> local_settings
>> * The PostgreSQL is it's own small instance

>> What is the best practice to do a deployment? The best I could come up
>> with is the following:

>>    1. Tell the loadbalancer to stop autoscaling
>>    2. Kill all instances but one
>>    3. git pull on that last instance, run syncdb, migrate,
>>    collectstatic, makemessages, rebuild_index, etc.
>>    4. Deployment is done Kill fcgi processes on that last instance
>>    5. Create a snapshot of that last instance
>>    6. Tell the loadbalancer that new instances, from now on, can be
>>    created off of that new snapshot
>>    7. Allow the loadbalancer to do autoscaling again

>> Am I missing anything? Does anyone have experience with this? Is there a
>> better way to do it?

>> Many thanks in advance!

>> Kind regards,
>> Martin

>> --
>> Chat: http://hackerspace.sg/chat

>  --
> Chat: http://hackerspace.sg/chat

--
www.calvinx.com
Stalk me! @ www.twitter.com/calvinchengx

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.