Presented at Mini PyCon Malaysia 2014 (March 15)
DevOpsPython tools to get started
View Slide
DevOps is …“… development and operations teams workon software releases in tandem, rather thanthrowing code back and forth across a silo.”
Make no mistakeDevOps is a cultureIn [1]: “tools make a culture”Out [1]: False
Background
PerspectiveStartup culture, but tools are usefuleverywhere
CarousellP2P Marketplace AppiOS, Android(Web?)
Pony PoweredDjango + Django Rest Framework
Not too long ago1 Technical Co-founder!Edits code on production serverLive reload
Moments ago4 Engineers:iOS, Android, CTO,Backend + Infrastructure!Every engineer somewhat involved withBackend code
TODO• Deploy• MonitorMake it easy to:• Break thingsMake it difficult to:
Deployment
Deployment options- Fabric + git / svn /…!- Salt / Ansible / Chef!- Native packaging (.rpm, .deb)
Fabric (i)from fabric.api import env, run!hosts = [‘app.server.com’]!def deploy():run(“git pull && … ”)fabfile.py
Fabric (ii)$ fab deploy[app.server.com] run: git pull && …[app.server.com] out: [output]
Fabric: the good partsSimple, easy to start with!@parallel to speed upfor multiple servers
SaltConfiguration management,commonly used for serverprovisioning!Chef, Puppet, etc
Salt + Git
Fabric + Salt + Gitfab deploysalt “app*.server.com” …app1.server.com app2.server.com
Monitor and Control
Controlling processesTools: Supervisor, CircusAllows you to control and monitoryour app processes
Supervisor (i)[program:my_app]command=python my_app.py
Supervisor (ii)$ supervisorctl statusmy_app RUNNING pid 7910, uptime 01:36:44
Supervisor (iii)Supervisor exposes a XMLRPC interfaceAllows remote monitoring and control ofprocesses
Continuous Integration
Continuous IntegrationPopular CIs:Jenkins, TravisCI, CircleCI
http://buildbot.net/
Jenkins + Django
Automated Feedback
Done!• Deploy• MonitorMake it easy to:• Break thingsMake it difficult to:
All together now
Github WorkflowPull RequestContinuous IntegrationAutomatic Deployment
pull requestJenkins CI TestDeployment Report on Githubsalt[success] [fail]
Beyond PythonDockerVagrant Virtual Machines!(LXC) Containers!
Thanks!@victorneo(psst. we are looking for web devs)