Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DevOps: Python tools to get started

DevOps: Python tools to get started

Presented at Mini PyCon Malaysia 2014 (March 15)

Victor Neo

March 15, 2014
Tweet

More Decks by Victor Neo

Other Decks in Technology

Transcript

  1. DevOps Python tools to get started

  2. DevOps is … “… development and operations teams work on

    software releases in tandem, rather than throwing code back and forth across a silo.”
  3. Make no mistake DevOps is a culture In [1]: “tools

    make a culture” Out [1]: False
  4. Background

  5. Perspective Startup culture, but tools are useful everywhere

  6. Carousell P2P Marketplace App iOS, Android (Web?)

  7. Pony Powered Django + Django Rest Framework

  8. Not too long ago 1 Technical Co-founder ! Edits code

    on production server Live reload
  9. Moments ago 4 Engineers: iOS, Android, CTO, Backend + Infrastructure

    ! Every engineer somewhat involved with Backend code
  10. TODO • Deploy • Monitor Make it easy to: •

    Break things Make it difficult to:
  11. Deployment

  12. Deployment options - Fabric + git / svn /… !

    - Salt / Ansible / Chef ! - Native packaging (.rpm, .deb)
  13. Fabric (i) from fabric.api import env, run ! hosts =

    [‘app.server.com’] ! def deploy(): run(“git pull && … ”) fabfile.py
  14. Fabric (ii) $ fab deploy [app.server.com] run: git pull &&

    … [app.server.com] out: [output]
  15. Fabric: the good parts Simple, easy to start with !

    @parallel to speed up for multiple servers
  16. Salt Configuration management, commonly used for server provisioning ! Chef,

    Puppet, etc
  17. Salt + Git

  18. Fabric + Salt + Git fab deploy salt “app*.server.com” …

    app1.server.com app2.server.com
  19. TODO • Deploy • Monitor Make it easy to: •

    Break things Make it difficult to:
  20. Monitor and Control

  21. Controlling processes Tools: Supervisor, Circus Allows you to control and

    monitor your app processes
  22. Supervisor (i) [program:my_app] command=python my_app.py

  23. Supervisor (ii) $ supervisorctl status my_app RUNNING pid 7910, uptime

    01:36:44
  24. Supervisor (iii) Supervisor exposes a XMLRPC interface Allows remote monitoring

    and control of processes
  25. TODO • Deploy • Monitor Make it easy to: •

    Break things Make it difficult to:
  26. Continuous Integration

  27. Continuous Integration Popular CIs: Jenkins, TravisCI, CircleCI

  28. http://buildbot.net/

  29. Jenkins + Django

  30. Automated Feedback

  31. Done! • Deploy • Monitor Make it easy to: •

    Break things Make it difficult to:
  32. All together now

  33. Github Workflow Pull Request Continuous Integration Automatic Deployment

  34. pull request Jenkins CI Test Deployment Report on Github salt

    [success] [fail]
  35. Beyond Python Docker Vagrant Virtual Machines! (LXC) Containers!

  36. Thanks! @victorneo (psst. we are looking for web devs)