python-guide
python-guide copied to clipboard
deployment anti patterns
http://hynek.me/articles/python-deployment-anti-patterns/
Interesting article. I'd like to know better why Fabric is not so good for deployment.
Without going too far afield (github comments probably aren't the best venue for this sort of discussion -- maybe I'll blog about it), the basic issue with it is that it's designed to execute commands. That may not sound so bad, but imagine you're managing a pool of hundreds (or thousands) of machines. If there is a failure in one of them during a run of fabric, you may not notice it; and depending on the type of failure, you may not be able to gracefully recover without serious manual intervention.
On the other hand tools like Puppet or Chef let you describe a desired state for a machine to be in (package foo at version X, code checked out from repository bar on branch Y or tag Z, etc). A deployment to a thousand machines is then "update github and wait a half hour" -- after that, all machines will be brought into sync in the same (new) state. Combined with proper monitoring, if one or a few machines become "corrupted" (from a configuration standpoint), you can simply throw them away and reinstall, knowing that they will ultimately be in the same state as all the others.
This requires adjusting the way you think about managing and deploying applications, but it's quite thrilling and very easy once you have accomplished the initial setup. It scales down well, too -- I manage a single server with 3 applications using Chef.
@dcrosta, do you consider that single server to be similarly 'disposable'?