Hacker News new | past | comments | ask | show | jobs | submit login

As a python dev who deploys a lot of software, I found this article to be wonderfully helpful and informative, and a good reflection of current best practices.

Summary of the deployment tools mentioned:

  - Manage remote daemons with supervisord
    http://supervisord.org/    

  - Manage python packages with pip (and use `pip freeze`)
    http://pypi.python.org/pypi/pip
    http://www.pip-installer.org/en/latest/requirements.html

  - Manage production environments with virtualenv
    http://www.virtualenv.org/

  - Manage Configuration with puppet and/or chef
    http://puppetlabs.com/
    http://www.opscode.com/chef/

  - Automate local and remote sys admin tasks with Fabric
    http://fabfile.org
Other tips:

  - Don't restrict yourself to old Python versions to appease your tools / libs.

  - Strongly consider rolling your own DEB/RPMs for your Python application. 
Author also touted:

  - Celery for task management
    http://celeryproject.org/

  - Twisted for event-based python.
    http://twistedmatrix.com/trac/

  - nginx / gunicorn for your python web server stack
    http://www.nginx.com/
    http://gunicorn.org/



Chef requires Ruby programming. Puppet doesn't, but the core is obviously Ruby, and you extend it using Ruby.

You may possibly like my new project:

http://ansible.github.com

The core is Python but you can write modules in any language.


There is also cuisine, which brings chef-like functionality to fabric.

https://github.com/sebastien/cuisine


Thanks for that! We gave up on chef when one of their version updates failed to work with a prior version, both of which were the OS package defaults. Chef silently failed, no error message, nothing in the docs, nothing even in the source code. Had to do a fair bit of searching to find out why.

When open source projects like chef have nobody interested in even documenting much less testing backwards incompatibilities we move them to the bottom of our to-eval list.

This also illustrates a problem in article's blind enthusiasm for the latest revisions and libraries i.e., it dismisses the headaches this causes end-users, who often don't have staff or budget to fix whatever breaks during an upgrade. That said we are at least talking about python, which has had better release QA and backwards compatibility than perl, ruby or, gasp, php.


That said we are at least talking about python, which has had better release QA and backwards compatibility than perl....

I'm curious as to your experience here. I've found that Perl has by far the best backwards compatibility and release QA of the major dynamic languages. What did you encounter?


We don't use as much perl as we used to but the last upgrade issue was amavisd-new (a Spamassassin wrapper). Spamassassin has perl version issues every so often as well. NetDNS used to introduce new bugs about every 4th revision but seems to have been stable for the past couple of years. GNUmp3d and many audio libraries have non-perl revision-related, backwards-compatibility issues with some regularity.


That makes sense. XS components (compiled code which uses the Perl API) don't have binary backwards compatibility between major Perl releases.


The audio library incompatibilities were API changes. Amavisd's issues are not binary either but do seem mostly socket related.


Cool, I'm also investigating the python-based salt stack: http://saltstack.org/ for this purpose but it seems a bit heavy just starting out. Gonna try ansible next.


Currently deploying salt. Community is great, grains are easy to write, and the codebase is very clear. Can't recommend enough.


Yes to all of this and I'll throw in my two cents on our web server setup which is nginx + uwsgi (which has served remarkably well).


+1 to uWSGI and nginx. Now wsgi is built into nginx distribution, and uwsgi is gaining areputation for rock solid performance it's a nobrainer.


Likewise +1 to Nginx + uwsgi. In the various performance benchmarks* uwsgi beats gunicorn, and uwsgi comes bundled with Nginx now, so there's really no reason to bother with setting up gunicorn any more.

* http://www.peterbe.com/plog/fcgi-vs-gunicorn-vs-uwsgi http://nichol.as/benchmark-of-python-web-servers


Can you restart the uwsgi instance(s) without restarting nginx? That's a pretty significant benefit of gunicorn...


Yes, uwsgi instances run separately from nginx. The uwsgi nginx module simply speaks a binary protocol for reverse proxying rather than HTTP.


uwsgi comes bundles with Nginx? First I've heard of that. Very interesting.

Do you have any easy tutorials on getting Nginx + uwsgi set up?


The uwsgi upstream module has been bundled for a long time now.

Here is the doc from the uwsgi site: http://projects.unbit.it/uwsgi/wiki/RunOnNginx


I chose nginx and gevent after reading a blog post about py server performance. Anyone have any experience with these two?


I use gevent instead of twisted for event-based python. Gevent is a lot nicer to work with and doesn't make your code less readable in the way twisted does with its callbacks and errbacks. It's also a lot easier to do unit testing with gevent.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: