Slide 1

Slide 1 text

DevOps Python tools to get started

Slide 2

Slide 2 text

DevOps is … “… development and operations teams work on software releases in tandem, rather than throwing code back and forth across a silo.”

Slide 3

Slide 3 text

Make no mistake DevOps is a culture In [1]: “tools make a culture” Out [1]: False

Slide 4

Slide 4 text

Background

Slide 5

Slide 5 text

Perspective Startup culture, but tools are useful everywhere

Slide 6

Slide 6 text

Carousell P2P Marketplace App iOS, Android (Web?)

Slide 7

Slide 7 text

Pony Powered Django + Django Rest Framework

Slide 8

Slide 8 text

Not too long ago 1 Technical Co-founder ! Edits code on production server Live reload

Slide 9

Slide 9 text

Moments ago 4 Engineers: iOS, Android, CTO, Backend + Infrastructure ! Every engineer somewhat involved with Backend code

Slide 10

Slide 10 text

TODO • Deploy • Monitor Make it easy to: • Break things Make it difficult to:

Slide 11

Slide 11 text

Deployment

Slide 12

Slide 12 text

Deployment options - Fabric + git / svn /… ! - Salt / Ansible / Chef ! - Native packaging (.rpm, .deb)

Slide 13

Slide 13 text

Fabric (i) from fabric.api import env, run ! hosts = [‘app.server.com’] ! def deploy(): run(“git pull && … ”) fabfile.py

Slide 14

Slide 14 text

Fabric (ii) $ fab deploy [app.server.com] run: git pull && … [app.server.com] out: [output]

Slide 15

Slide 15 text

Fabric: the good parts Simple, easy to start with ! @parallel to speed up for multiple servers

Slide 16

Slide 16 text

Salt Configuration management, commonly used for server provisioning ! Chef, Puppet, etc

Slide 17

Slide 17 text

Salt + Git

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

TODO • Deploy • Monitor Make it easy to: • Break things Make it difficult to:

Slide 20

Slide 20 text

Monitor and Control

Slide 21

Slide 21 text

Controlling processes Tools: Supervisor, Circus Allows you to control and monitor your app processes

Slide 22

Slide 22 text

Supervisor (i) [program:my_app] command=python my_app.py

Slide 23

Slide 23 text

Supervisor (ii) $ supervisorctl status my_app RUNNING pid 7910, uptime 01:36:44

Slide 24

Slide 24 text

Supervisor (iii) Supervisor exposes a XMLRPC interface Allows remote monitoring and control of processes

Slide 25

Slide 25 text

TODO • Deploy • Monitor Make it easy to: • Break things Make it difficult to:

Slide 26

Slide 26 text

Continuous Integration

Slide 27

Slide 27 text

Continuous Integration Popular CIs: Jenkins, TravisCI, CircleCI

Slide 28

Slide 28 text

http://buildbot.net/

Slide 29

Slide 29 text

Jenkins + Django

Slide 30

Slide 30 text

Automated Feedback

Slide 31

Slide 31 text

Done! • Deploy • Monitor Make it easy to: • Break things Make it difficult to:

Slide 32

Slide 32 text

All together now

Slide 33

Slide 33 text

Github Workflow Pull Request Continuous Integration Automatic Deployment

Slide 34

Slide 34 text

pull request Jenkins CI Test Deployment Report on Github salt [success] [fail]

Slide 35

Slide 35 text

Beyond Python Docker Vagrant Virtual Machines! (LXC) Containers!

Slide 36

Slide 36 text

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