SlideShare a Scribd company logo
DISQUS
                         Practicing Continuous Deployment



                                    David Cramer
                                       @zeeg




Saturday, March 10, 12
Shipping new code as soon
                 as it’s ready




Saturday, March 10, 12
Continuous Deployment




                         # Update the site every 5 minutes
                         */5 * * * * cd /www/example.com 
                                       && git pull 
                                       && service apache restart




Saturday, March 10, 12
Saturday, March 10, 12
When it’s ready




Saturday, March 10, 12
When is it ready?




                -        Reviewed by peers


                -        Passes automated tests


                -        Some level of QA




Saturday, March 10, 12
Focus on Stability and Iteration




Saturday, March 10, 12
Workflow


                          Review                  Commit




                         Integration             Failed Build




                          Deploy                 Reporting




                                                  Rollback




Saturday, March 10, 12
The Good
      -     Develop features
            incrementally
      -     Release frequently
      -     Smaller doses of QA
                                      The Bad
                                  -   Culture Shock
                                  -   Stability depends on
                                      test coverage
                                  -   Initial time investment

Saturday, March 10, 12
Keep Development Simple




Saturday, March 10, 12
Development




                -        Automate testing of complicated
                         processes and architecture
                -        Simple can be better than complete
                         -   Especially for local development
                -        python setup.py {develop,test}
                -        Puppet, Chef, Buildout, Fabric, etc.




Saturday, March 10, 12
Production                                 Staging
                                PostgreSQL                              PostgreSQL
                                Memcache                                Memcache
                                Redis                                   Redis
                                Solr                                    Solr
                                Apache                                  Apache
                                Nginx                                   Nginx
                                RabbitMQ                                RabbitMQ
                         (and 100 other painful-to-configure services)



                                CI Server                               Macbook
                                PostgreSQL                              PostgreSQL
                                Memcache                                Apache
                                Redis                                   Memcache
                                Solr                                    Redis
                                Apache                                  Solr
                                Nginx                                   Nginx
                                RabbitMQ                                RabbitMQ


Saturday, March 10, 12
Bootstrapping Local



                -        Simplify local setup
                         -   git clone dcramer@disqus:disqus.git
                         -   make
                         -   python manage.py runserver


                -        Need to test dependancies?
                         -   virtualbox + vagrant up



Saturday, March 10, 12
Progressive Rollout

                         We actively use early versions of features
                                   before public release




Saturday, March 10, 12
Deploy features to portions of a user base at a
                          time to ensure smooth, measurable releases




                                  https://github.com/disqus/gargoyle


Saturday, March 10, 12
•        Iterate quickly by hiding features
                •        Early adopters are free QA



                         from gargoyle import gargoyle

                         def my_view(request):
                             if gargoyle.is_active('awesome', request):
                                 return 'new happy version :D'
                             else:
                                 return 'old sad version :('




Saturday, March 10, 12
SWITCHES = {
                             # enable my_feature for 50%
                             'my_feature': range(0, 50),
                         }

                         def is_active(switch):
                             try:
                                  pct_range = SWITCHES[switch]
                             except KeyError:
                                  return False

                             ip_hash = sum([int(x) for x
                                            in ip_address.split('.')])

                             return (ip_hash % 100 in pct_range)




Saturday, March 10, 12
Review ALL the Commits




                            phabricator.org


Saturday, March 10, 12
Saturday, March 10, 12
Saturday, March 10, 12
Saturday, March 10, 12
Integration
                         (or as we like to call it)




Saturday, March 10, 12
Saturday, March 10, 12
Integration Requirements




                -        Developers must know when they’ve
                         broken something
                         -   IRC, Email, IM
                -        Support proper reporting
                         -   XUnit, Pylint, Coverage.py
                -        Painless setup
                         -   apt-get install jenkins *

                             https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu


Saturday, March 10, 12
Shortcomings


                -        False positives
                         -   Reporting isn't accurate
                         -   Services fail
                         -   Bad Tests
                -        Test coverage
                         -   Regressions on untested code
                -        Feedback delay
                         -   Integration tests vs Unit tests


Saturday, March 10, 12
Fixing False Positives




                -        Re-run tests several times on a failure


                -        Report continually failing tests


                -        Replace external service tests with a
                         functional test suite




Saturday, March 10, 12
Maintaining Coverage




                -        Raise awareness with reporting
                         -   Fail/alert when coverage drops on a build
                -        Commit tests with code
                         -   Coverage against commit diff for
                             untested regressions
                -        Utilize code review




Saturday, March 10, 12
Speeding Up Tests




                -        Write true unit tests
                         -   vs slower integration tests
                -        Mock external services
                -        Distributed and parallel testing
                         -   Matrix builds




Saturday, March 10, 12
Reporting




Saturday, March 10, 12
<You> Why is mongodb-1 down?




             <Ops> It’s down? Must have crashed again

Saturday, March 10, 12
Meaningful Metrics




                -        Rate of traffic (not just hits!)
                         -   Business vs system
                -        Response time (database, web)
                -        Exceptions
                -        Social media
                         -   Twitter




Saturday, March 10, 12
Graphite




                         (Trafficgraphite.wikidot.com
                                  across a cluster of servers)


Saturday, March 10, 12
Sentry




                         sentry.readthedocs.org


Saturday, March 10, 12
Wrap Up




Saturday, March 10, 12
Getting Started




                -        Package your app
                -        Value code review
                -        Ease deployment; fast rollbacks
                -        Setup automated tests
                -        Gather some easy metrics




Saturday, March 10, 12
Going Further




                -        Build an immune system
                         -   Automate deploys, rollbacks (maybe)
                -        Adjust to your culture
                         -   There is no “right way”
                -        SOA == great success




Saturday, March 10, 12
DISQUS
                          Questions?




                          psst, we’re hiring
                          disqus.com/jobs

Saturday, March 10, 12
References



                -        Gargoyle (feature switches)
                         https://github.com/disqus/gargoyle

                -        Sentry (log aggregation)
                         https://github.com/dcramer/sentry

                -        Jenkins CI (continuous integration)
                         http://jenkins-ci.org/

                -        Phabricator (code reviews, bug tracking)
                         https://phabricator.org

                -        Graphite (metrics)
                         http://graphite.wikidot.com/




                                              code.disqus.com
Saturday, March 10, 12

More Related Content

What's hot (20)

PDF
Groovy concurrency
Alex Miller
 
PDF
Memcached Study
nam kwangjin
 
PDF
Introduction to .Net Driver
DataStax Academy
 
KEY
Introduction to memcached
Jurriaan Persyn
 
PDF
Async and Non-blocking IO w/ JRuby
Joe Kutner
 
PDF
Caching In The Cloud
Alex Miller
 
PDF
Distributed system coordination by zookeeper and introduction to kazoo python...
Jimmy Lai
 
PDF
Spark / Mesos Cluster Optimization
ebiznext
 
PDF
Hazelcast
oztalip
 
PDF
[245] presto 내부구조 파헤치기
NAVER D2
 
ZIP
Above the clouds: introducing Akka
nartamonov
 
PPTX
JahiaOne - Performance Tuning
Jahia Solutions Group
 
PPTX
캐시 분산처리 인프라
Park Chunduck
 
PPTX
Hazelcast and MongoDB at Cloud CMS
uzquiano
 
PDF
Managing Postgres with Ansible
Gulcin Yildirim Jelinek
 
PDF
Caching reboot: javax.cache & Ehcache 3
Louis Jacomet
 
PDF
Scaling symfony apps
Matteo Moretti
 
PDF
Ehcache 3 @ BruJUG
Louis Jacomet
 
PPTX
Winter is coming? Not if ZooKeeper is there!
Joydeep Banik Roy
 
PPTX
Hazelcast Essentials
Rahul Gupta
 
Groovy concurrency
Alex Miller
 
Memcached Study
nam kwangjin
 
Introduction to .Net Driver
DataStax Academy
 
Introduction to memcached
Jurriaan Persyn
 
Async and Non-blocking IO w/ JRuby
Joe Kutner
 
Caching In The Cloud
Alex Miller
 
Distributed system coordination by zookeeper and introduction to kazoo python...
Jimmy Lai
 
Spark / Mesos Cluster Optimization
ebiznext
 
Hazelcast
oztalip
 
[245] presto 내부구조 파헤치기
NAVER D2
 
Above the clouds: introducing Akka
nartamonov
 
JahiaOne - Performance Tuning
Jahia Solutions Group
 
캐시 분산처리 인프라
Park Chunduck
 
Hazelcast and MongoDB at Cloud CMS
uzquiano
 
Managing Postgres with Ansible
Gulcin Yildirim Jelinek
 
Caching reboot: javax.cache & Ehcache 3
Louis Jacomet
 
Scaling symfony apps
Matteo Moretti
 
Ehcache 3 @ BruJUG
Louis Jacomet
 
Winter is coming? Not if ZooKeeper is there!
Joydeep Banik Roy
 
Hazelcast Essentials
Rahul Gupta
 

Viewers also liked (19)

PDF
SFR Certification
Jackie Turley
 
PPTX
Seguridad de la Informacion
NFAG DTLF
 
PDF
18 TIPS TO-BE FOUNDERS
Andre Marquet
 
PDF
אילוצים וריסונים במלחמה מקומית - מלחמת לבנון השניה
Ishai Aloni
 
PDF
شهادة الماجستر
Saleem Abudayeh
 
PPTX
Things I Carry
Beth Kanter
 
PPT
Frraactioon
guest6b95dc2
 
PPTX
Research Design
Sandeep Singh Saini
 
PDF
Through the Lens of an iPhone: Charleston, SC
Paul Brown
 
PPTX
6 Healthy Mother's Day Gifts
Eason Chan
 
PDF
Mas loco que una cabra
Emilio Gil (unjubilado)
 
PPTX
Fitriana bakar tugas 1 so ii
fhitCharis
 
PPTX
Mobile application development |#Mobileapplicationdevelopment
Mobile App Developers India
 
PPTX
หน่วยที่ 9 ระบบเครือข่ายอินเทอร์เน็ต
Ta Khanittha
 
PPTX
How to Find a Good Work-Life Balance
Wording Well
 
PDF
Local Government Balances Security, Flexibility and Productivity with BlackBe...
BlackBerry
 
PDF
Perunapuu esittely 4
Miikka Leinonen
 
PPT
Towards a Grand Unified Theory of Systems Engineering (GUTSE)
Joseph KAsser
 
PDF
Social Media & Networking - The Evolving Workforce
Todd Wheatland
 
SFR Certification
Jackie Turley
 
Seguridad de la Informacion
NFAG DTLF
 
18 TIPS TO-BE FOUNDERS
Andre Marquet
 
אילוצים וריסונים במלחמה מקומית - מלחמת לבנון השניה
Ishai Aloni
 
شهادة الماجستر
Saleem Abudayeh
 
Things I Carry
Beth Kanter
 
Frraactioon
guest6b95dc2
 
Research Design
Sandeep Singh Saini
 
Through the Lens of an iPhone: Charleston, SC
Paul Brown
 
6 Healthy Mother's Day Gifts
Eason Chan
 
Mas loco que una cabra
Emilio Gil (unjubilado)
 
Fitriana bakar tugas 1 so ii
fhitCharis
 
Mobile application development |#Mobileapplicationdevelopment
Mobile App Developers India
 
หน่วยที่ 9 ระบบเครือข่ายอินเทอร์เน็ต
Ta Khanittha
 
How to Find a Good Work-Life Balance
Wording Well
 
Local Government Balances Security, Flexibility and Productivity with BlackBe...
BlackBerry
 
Perunapuu esittely 4
Miikka Leinonen
 
Towards a Grand Unified Theory of Systems Engineering (GUTSE)
Joseph KAsser
 
Social Media & Networking - The Evolving Workforce
Todd Wheatland
 
Ad

Similar to Practicing Continuous Deployment (20)

PDF
Continuous Deployment at Disqus (Pylons Minicon)
zeeg
 
PDF
Pitfalls of Continuous Deployment
zeeg
 
PDF
PyCon 2011 Scaling Disqus
zeeg
 
PDF
Jeff Lindsay: Building Public Infrastructure with Autosustainable Services
it-people
 
PDF
Automation - fabric, django and more
Ilian Iliev
 
PDF
Towards Continuous Deployment with Django
Roger Barnes
 
PDF
Complex Made Simple: Sleep Better With TorqueBox
Lance Ball
 
PDF
DevOps Introduction @Cegeka
dieterdm
 
PDF
PyCon talk: Deploy Python apps in 5 min with a PaaS
Appsembler
 
PPTX
Sv jug - mar 2013 - sl
CloudBees
 
PDF
Just In Time Scalability Agile Methods To Support Massive Growth Presentation
Long Nguyen
 
PDF
Django Bootstrapping with Ease
Concentric Sky
 
PDF
Summit 2013 spring rob hirschfeld migrations v1
rhirschfeld
 
PDF
Puppet and Telefonica R&D
Puppet
 
PDF
DevOps at ACCU 2012
Gavin Heavyside
 
PDF
Taming the Deployment Beast
Chris Cornutt
 
PDF
State of the Framework Address: Recent Developments in the Metasploit Framework
egypt
 
PDF
Open Source Toolchains to Manage Cloud Infrastructure
Mark Hinkle
 
PDF
San Jose Selenium Meetup 22 Mar 2012: The Restless Are Getting Native
Dante Briones
 
PDF
2011 June - Singapore GTUG presentation. App Engine program update + intro to Go
ikailan
 
Continuous Deployment at Disqus (Pylons Minicon)
zeeg
 
Pitfalls of Continuous Deployment
zeeg
 
PyCon 2011 Scaling Disqus
zeeg
 
Jeff Lindsay: Building Public Infrastructure with Autosustainable Services
it-people
 
Automation - fabric, django and more
Ilian Iliev
 
Towards Continuous Deployment with Django
Roger Barnes
 
Complex Made Simple: Sleep Better With TorqueBox
Lance Ball
 
DevOps Introduction @Cegeka
dieterdm
 
PyCon talk: Deploy Python apps in 5 min with a PaaS
Appsembler
 
Sv jug - mar 2013 - sl
CloudBees
 
Just In Time Scalability Agile Methods To Support Massive Growth Presentation
Long Nguyen
 
Django Bootstrapping with Ease
Concentric Sky
 
Summit 2013 spring rob hirschfeld migrations v1
rhirschfeld
 
Puppet and Telefonica R&D
Puppet
 
DevOps at ACCU 2012
Gavin Heavyside
 
Taming the Deployment Beast
Chris Cornutt
 
State of the Framework Address: Recent Developments in the Metasploit Framework
egypt
 
Open Source Toolchains to Manage Cloud Infrastructure
Mark Hinkle
 
San Jose Selenium Meetup 22 Mar 2012: The Restless Are Getting Native
Dante Briones
 
2011 June - Singapore GTUG presentation. App Engine program update + intro to Go
ikailan
 
Ad

Recently uploaded (20)

PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Digital Circuits, important subject in CS
contactparinay1
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 

Practicing Continuous Deployment

  • 1. DISQUS Practicing Continuous Deployment David Cramer @zeeg Saturday, March 10, 12
  • 2. Shipping new code as soon as it’s ready Saturday, March 10, 12
  • 3. Continuous Deployment # Update the site every 5 minutes */5 * * * * cd /www/example.com && git pull && service apache restart Saturday, March 10, 12
  • 6. When is it ready? - Reviewed by peers - Passes automated tests - Some level of QA Saturday, March 10, 12
  • 7. Focus on Stability and Iteration Saturday, March 10, 12
  • 8. Workflow Review Commit Integration Failed Build Deploy Reporting Rollback Saturday, March 10, 12
  • 9. The Good - Develop features incrementally - Release frequently - Smaller doses of QA The Bad - Culture Shock - Stability depends on test coverage - Initial time investment Saturday, March 10, 12
  • 11. Development - Automate testing of complicated processes and architecture - Simple can be better than complete - Especially for local development - python setup.py {develop,test} - Puppet, Chef, Buildout, Fabric, etc. Saturday, March 10, 12
  • 12. Production Staging PostgreSQL PostgreSQL Memcache Memcache Redis Redis Solr Solr Apache Apache Nginx Nginx RabbitMQ RabbitMQ (and 100 other painful-to-configure services) CI Server Macbook PostgreSQL PostgreSQL Memcache Apache Redis Memcache Solr Redis Apache Solr Nginx Nginx RabbitMQ RabbitMQ Saturday, March 10, 12
  • 13. Bootstrapping Local - Simplify local setup - git clone dcramer@disqus:disqus.git - make - python manage.py runserver - Need to test dependancies? - virtualbox + vagrant up Saturday, March 10, 12
  • 14. Progressive Rollout We actively use early versions of features before public release Saturday, March 10, 12
  • 15. Deploy features to portions of a user base at a time to ensure smooth, measurable releases https://github.com/disqus/gargoyle Saturday, March 10, 12
  • 16. Iterate quickly by hiding features • Early adopters are free QA from gargoyle import gargoyle def my_view(request): if gargoyle.is_active('awesome', request): return 'new happy version :D' else: return 'old sad version :(' Saturday, March 10, 12
  • 17. SWITCHES = { # enable my_feature for 50% 'my_feature': range(0, 50), } def is_active(switch): try: pct_range = SWITCHES[switch] except KeyError: return False ip_hash = sum([int(x) for x in ip_address.split('.')]) return (ip_hash % 100 in pct_range) Saturday, March 10, 12
  • 18. Review ALL the Commits phabricator.org Saturday, March 10, 12
  • 22. Integration (or as we like to call it) Saturday, March 10, 12
  • 24. Integration Requirements - Developers must know when they’ve broken something - IRC, Email, IM - Support proper reporting - XUnit, Pylint, Coverage.py - Painless setup - apt-get install jenkins * https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu Saturday, March 10, 12
  • 25. Shortcomings - False positives - Reporting isn't accurate - Services fail - Bad Tests - Test coverage - Regressions on untested code - Feedback delay - Integration tests vs Unit tests Saturday, March 10, 12
  • 26. Fixing False Positives - Re-run tests several times on a failure - Report continually failing tests - Replace external service tests with a functional test suite Saturday, March 10, 12
  • 27. Maintaining Coverage - Raise awareness with reporting - Fail/alert when coverage drops on a build - Commit tests with code - Coverage against commit diff for untested regressions - Utilize code review Saturday, March 10, 12
  • 28. Speeding Up Tests - Write true unit tests - vs slower integration tests - Mock external services - Distributed and parallel testing - Matrix builds Saturday, March 10, 12
  • 30. <You> Why is mongodb-1 down? <Ops> It’s down? Must have crashed again Saturday, March 10, 12
  • 31. Meaningful Metrics - Rate of traffic (not just hits!) - Business vs system - Response time (database, web) - Exceptions - Social media - Twitter Saturday, March 10, 12
  • 32. Graphite (Trafficgraphite.wikidot.com across a cluster of servers) Saturday, March 10, 12
  • 33. Sentry sentry.readthedocs.org Saturday, March 10, 12
  • 35. Getting Started - Package your app - Value code review - Ease deployment; fast rollbacks - Setup automated tests - Gather some easy metrics Saturday, March 10, 12
  • 36. Going Further - Build an immune system - Automate deploys, rollbacks (maybe) - Adjust to your culture - There is no “right way” - SOA == great success Saturday, March 10, 12
  • 37. DISQUS Questions? psst, we’re hiring disqus.com/jobs Saturday, March 10, 12
  • 38. References - Gargoyle (feature switches) https://github.com/disqus/gargoyle - Sentry (log aggregation) https://github.com/dcramer/sentry - Jenkins CI (continuous integration) http://jenkins-ci.org/ - Phabricator (code reviews, bug tracking) https://phabricator.org - Graphite (metrics) http://graphite.wikidot.com/ code.disqus.com Saturday, March 10, 12