Solid Python Deployments for Everybody by Hynek Schlawack

Afcfefa1f067d10bd021de0cc2e5e806?s=47 PyCon 2013
March 16, 2013
980

Solid Python Deployments for Everybody by Hynek Schlawack

Afcfefa1f067d10bd021de0cc2e5e806?s=128

PyCon 2013

March 16, 2013
Tweet

Transcript

  1. 2.
  2. 4.

    ?

  3. 5.
  4. 9.
  5. 12.
  6. 16.
  7. 19.
  8. 20.

    No!

  9. 21.
  10. 22.

    “Python 2.4 is not supported. It came out 8 years

    ago. That's older than Youtube. Upgrade.” — Kenneth Reitz
  11. 26.
  12. 27.
  13. 31.
  14. 32.

    Use virtualen $ virtualenv venv; . venv/bin/activate $ pip install

    pyramid requests $ py.test … $ pip freeze >requirements.txt … $ pip install -r requirements.txt
  15. 37.
  16. 38.
  17. 39.
  18. 41.
  19. 44.

    1. check out from VCS 2. create virtualenv 3. install

    dependencies 4. do whatever you want 5. package result 6. push to your repo
  20. 47.
  21. 50.
  22. 51.

    from … import Deployment def deb(branch=None): deploy = Deployment( 'whois',

    build_deps=['libpq-dev',], run_deps=['libpq5',]) deploy.prepare_app( branch=branch) deploy.build_deb()
  23. 52.
  24. 54.
  25. 55.

  26. 57.
  27. 58.

    prise-oriented features to to compare the two pet Open ource

    Puppet Enterprise ✔ ✔ ✔ Not easy at all. Solution
  28. 64.

    r t

  29. 65.
  30. 77.
  31. 81.

    Example: upstart $ cat /etc/init/yourapp.conf start on static-network-up stop on

    deconfiguring-networking respawn chdir /path/to/yourapp setuid yourapp exec /path/to/gunicorn_django settings.py $ start yourapp
  32. 86.
  33. 88.
  34. 91.

    $ cat settings.py … INSTALLED_APPS = ( … "gunicorn", )

    … $ manage.py run_gunicorn Easy t Set U : gunicorn
  35. 92.

    Easy t Set U : nginx location / { proxy_pass

    http://127.0.0.1:5000; } location /static/ { root /your/app/public/; }
  36. 93.
  37. 94.
  38. 95.
  39. 96.
  40. 97.
  41. 98.
  42. 100.