SlideShare a Scribd company logo
DISQUS
                         Continuous Deployment Everything



                                    David Cramer
                                       @zeeg




Friday, April 29, 2011
Disclaimer: We don’t use Pylons




Friday, April 29, 2011
Continuous Deployment


           Shipping new code as soon
                  as it’s ready

                         (It’s really just super awesome buildbots)




Friday, April 29, 2011
Workflow




                  1. Developer commits code
                  2. CI server runs tests automatically
                         2.1.Build passes, code deploys
                         2.2.Build fails, block deploy
                  3. Developer tests feature on production




Friday, April 29, 2011
Pros                         Cons


                 •       Develop features         •   Culture Shock
                         incrementally            •   Stability depends on
                 •       Release frequently           test coverage
                 •       Less QA! (maybe)         •   Initial time
                                                      investment




                          We mostly just care about iteration and stability

Friday, April 29, 2011
Painless Development




Friday, April 29, 2011
Development



                  •      Production > Staging > CI > Dev
                         •   Automate testing of complicated
                             processes and architecture
                  •      Simple is arguably better than complete
                         •   Especially for local development
                  •      python setup.py {develop,test}
                  •      Use Puppet/Chef or build a simple
                         bootstrap.{py,sh}



Friday, April 29, 2011
Production            Staging
                         •    PostgreSQL   •   PostgreSQL
                         •    Memcache     •   Memcache
                         •    Redis        •   Redis
                         •    Solr         •   Solr
                         •    Apache       •   Apache
                         •    Nginx        •   Nginx
                         •    RabbitMQ     •   RabbitMQ


                             CI Server         Macbook

                         •    Memcache     •   PostgreSQL
                         •    PostgreSQL   •   Apache
                         •    Redis        •   Memcache
                         •    Solr         •   Redis
                         •    Apache       •   Solr
                         •    Nginx        •   Nginx
                         •    RabbitMQ     •   RabbitMQ


Friday, April 29, 2011
Bootstrapping Local



                  •      Simplify local setup
                         •   git clone dcramer@disqus:disqus.git
                         •   python setup.py develop
                         •   python manage.py runserver


                  •      Need to test dependancies?
                         •   virtualbox + vagrant up



Friday, April 29, 2011
“Under Construction”



                  •      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 :('




Friday, April 29, 2011
Gargoyle

                         Deploy features to portions of a user base at a
                          time to ensure smooth, measurable releases




                          Being users of our product, we actively use
                         early versions of features before public release

Friday, April 29, 2011
Integration
                         (or as we like to call it)




Friday, April 29, 2011
Integration is Required




                         Deploy only when things wont break

Friday, April 29, 2011
Reporting is Critical




Friday, April 29, 2011
CI 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



Friday, April 29, 2011
Shortcomings


                  •      False positives lower awareness
                         •   Reporting isn't accurate
                         •   Services fail
                         •   Bad Tests
                  •      Not enough code coverage
                         •   Regressions on untested code
                  •      Test suite takes too long
                         •   Integration tests vs Unit tests


Friday, April 29, 2011
Fixing False Positives




                  •      Re-run tests several times on a failure
                  •      Report continually failing tests
                         •   Fix continually failing tests
                  •      Rely less on 3rd parties
                         •   Mock/Dingus




Friday, April 29, 2011
Maintaining Coverage




                  •      Raise awareness with reporting
                         •   Fail/alert when coverage drops on a build
                  •      Commit tests with code
                  •      Drive it into your culture




Friday, April 29, 2011
Speeding Up Tests




                  •      Write true unit tests
                         •   vs slower integration tests
                  •      Mock 3rd party APIs
                  •      Distributed and parallel testing
                         •   http://github.com/disqus/mule




Friday, April 29, 2011
Mule


                  •      Unstable (we’re working on it)
                  •      Mostly Django right now
                         •   Generic interfaces for unittest2
                  •      Works with multi-processing and Celery
                         •   More complex than normal Celery usage
                  •      Full XUnit integration
                  •      Simple workflow
                         •   mule test --runner="python manage.py
                             mule --worker $TEST"


Friday, April 29, 2011
Deploy (finally)




Friday, April 29, 2011
How DISQUS Does It




                  •      Incremental deploy with Fabric
                  •      Drop server from pool
                  •      Pull in requirements on each server
                         •   Isolated virtualenv’s built on each server
                  •      Push server back online




Friday, April 29, 2011
Challenges




                  •      PyPi works on server A, but not B
                  •      Scale, or lack of
                  •      CPU cost per server
                  •      Schema changes, data model changes
                  •      Backwards compatibility




Friday, April 29, 2011
PyPi is Down




                  •      http://github.com/disqus/chishop




Friday, April 29, 2011
Help, we have 100 servers!




                  •      Incremental (ours) vs Fanout
                  •      Push vs Pull
                         •   Twitter uses BitTorrent
                  •      Isolation vs Packaging (Complexity)




Friday, April 29, 2011
SQL Schema Changes
                  1. Add column (NULLable)
                  2. Add app code to fill column
                  3. Deploy
                  4. Backfill column
                  5. Add app code to read column
                  6. Deploy


                  Cached Data Changes

                  • Have a global version number
                  • Have a data model cache version
                    • maybe md5(cls.__dict__)?

Friday, April 29, 2011
DISQUS
                           Questions?




                           psst, we’re hiring
                          jobs@disqus.com

Friday, April 29, 2011
References




                  •      Mule (distributed test runner)
                         http://github.com/disqus/mule
                  •      Gargoyle (feature switches)
                         https://github.com/disqus/gargoyle
                  •      Jenkins CI
                         http://jenkins-ci.org/




                                                  code.disqus.com
Friday, April 29, 2011

More Related Content

PDF
Declare independence from your it department sysadmin skills for symfony dev...
PPTX
Maximize Your Production Effort (English)
PDF
Oscon2011 tutorial
PDF
Releasing To Production Every Week India
PPTX
Dd13.2013.milano.open ntf
PDF
Maven: from Scratch to Production (.pdf)
PDF
Story of Puppet @eBay Global Classifieds Group (eCG)
PPTX
PHP Unconference Continuous Integration
Declare independence from your it department sysadmin skills for symfony dev...
Maximize Your Production Effort (English)
Oscon2011 tutorial
Releasing To Production Every Week India
Dd13.2013.milano.open ntf
Maven: from Scratch to Production (.pdf)
Story of Puppet @eBay Global Classifieds Group (eCG)
PHP Unconference Continuous Integration

What's hot (18)

PDF
VA Smalltalk Update ESUG2014
PPTX
Puppet camp amsterdam
PPTX
Supersize your production pipe enjmin 2013 v1.1 hd
PPTX
10 things you need to know to deliver a successful Alfresco project
KEY
統合開発環境TOPPERS Builderのカスタマイズ法
PPTX
Continuous integration
PPTX
Basic Selenium Training
PDF
PHP, Cloud And Microsoft Symfony Live 2010
PDF
Build automation best practices
PDF
The Brave New World of Continuous Release - Baruch Sadogursky
PPTX
Build software like a bag of marbles, not a castle of LEGO®
PDF
UKLUG 2012 - XPages, Beyond the basics
PDF
Continuous delivery @åf consult
PDF
Spring Roo Add-On Development & Distribution
PPTX
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
PDF
Continuous delivery with Codeship
PDF
Dr. Strangelove, or how I learned to love plugin development
PPT
XPages -Beyond the Basics
VA Smalltalk Update ESUG2014
Puppet camp amsterdam
Supersize your production pipe enjmin 2013 v1.1 hd
10 things you need to know to deliver a successful Alfresco project
統合開発環境TOPPERS Builderのカスタマイズ法
Continuous integration
Basic Selenium Training
PHP, Cloud And Microsoft Symfony Live 2010
Build automation best practices
The Brave New World of Continuous Release - Baruch Sadogursky
Build software like a bag of marbles, not a castle of LEGO®
UKLUG 2012 - XPages, Beyond the basics
Continuous delivery @åf consult
Spring Roo Add-On Development & Distribution
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
Continuous delivery with Codeship
Dr. Strangelove, or how I learned to love plugin development
XPages -Beyond the Basics
Ad

Viewers also liked (20)

PDF
PyCon 2011 Scaling Disqus
KEY
2markit
PPT
Camp1
PPTX
Paragraphs and topic sentences
PPS
开始想你
PPT
幸福来不来
PPT
Grasas Y Lipidos1
ODT
Guia de blogger
PPT
Getting Started With School Net
PDF
Lezing TNT
PPS
Drets d'examen
PPT
Blog Ict2
PPTX
Click frog present2013-agecy2
PDF
MISIÓN INTERCULTURALIDAD - 1E-A
PPT
香港六合彩
PDF
Lecture 21
PPS
Niver Je - 26.10.07
PPS
CasóRio Tati - 23.06.07
ODP
Javaday 2007: skype4java
PyCon 2011 Scaling Disqus
2markit
Camp1
Paragraphs and topic sentences
开始想你
幸福来不来
Grasas Y Lipidos1
Guia de blogger
Getting Started With School Net
Lezing TNT
Drets d'examen
Blog Ict2
Click frog present2013-agecy2
MISIÓN INTERCULTURALIDAD - 1E-A
香港六合彩
Lecture 21
Niver Je - 26.10.07
CasóRio Tati - 23.06.07
Javaday 2007: skype4java
Ad

Similar to Continuous Deployment at Disqus (Pylons Minicon) (20)

PDF
Pitfalls of Continuous Deployment
PDF
PHPUnit & Continuous Integration: An Introduction
PDF
Are Your Tests Really Helping You?
PPTX
Test parallelization using Jenkins
PDF
Hadoop Summit 2013 : Continuous Integration on top of hadoop
PPTX
The Key Components of Adopting CI The OpenStack Way
PPTX
Running productioninstance 1-localcopy
PDF
How to stuff a 900 pound gorilla into a smartphone
ZIP
Introduction To Continuous Integration
PDF
Plone Testing Tools And Techniques
KEY
Continuous integration & deployment
PDF
Wordpress version control
ODP
Deploying your SaaS stack OnPrem
KEY
Continuous Delivery Using Jenkins
PPTX
Generalization in Auto-Testing. How we put what we had into new Technological...
PDF
Wilko Nienhaus - continuous delivery release the right thing, done right, at ...
PDF
Unified Deployment: Including the Mainframe in Enterprise DevOps
PDF
Testing Plug-in Architectures
PDF
Continuous delivery with Jenkins Enterprise and Deployit
PDF
Automated testing DrupalCamp in Asheville
Pitfalls of Continuous Deployment
PHPUnit & Continuous Integration: An Introduction
Are Your Tests Really Helping You?
Test parallelization using Jenkins
Hadoop Summit 2013 : Continuous Integration on top of hadoop
The Key Components of Adopting CI The OpenStack Way
Running productioninstance 1-localcopy
How to stuff a 900 pound gorilla into a smartphone
Introduction To Continuous Integration
Plone Testing Tools And Techniques
Continuous integration & deployment
Wordpress version control
Deploying your SaaS stack OnPrem
Continuous Delivery Using Jenkins
Generalization in Auto-Testing. How we put what we had into new Technological...
Wilko Nienhaus - continuous delivery release the right thing, done right, at ...
Unified Deployment: Including the Mainframe in Enterprise DevOps
Testing Plug-in Architectures
Continuous delivery with Jenkins Enterprise and Deployit
Automated testing DrupalCamp in Asheville

More from zeeg (6)

PDF
Practicing Continuous Deployment
PDF
Tools for Development and Debugging in Python
PDF
Building Scalable Web Apps
KEY
Sentry (SF Python, Feb)
KEY
DjangoCon 2010 Scaling Disqus
KEY
Db tips & tricks django meetup
Practicing Continuous Deployment
Tools for Development and Debugging in Python
Building Scalable Web Apps
Sentry (SF Python, Feb)
DjangoCon 2010 Scaling Disqus
Db tips & tricks django meetup

Recently uploaded (20)

PPTX
1. Introduction to Computer Programming.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Spectroscopy.pptx food analysis technology
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Getting Started with Data Integration: FME Form 101
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Approach and Philosophy of On baking technology
PPTX
Tartificialntelligence_presentation.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Mushroom cultivation and it's methods.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Encapsulation theory and applications.pdf
PDF
Empathic Computing: Creating Shared Understanding
1. Introduction to Computer Programming.pptx
Spectral efficient network and resource selection model in 5G networks
Spectroscopy.pptx food analysis technology
Assigned Numbers - 2025 - Bluetooth® Document
Getting Started with Data Integration: FME Form 101
Univ-Connecticut-ChatGPT-Presentaion.pdf
OMC Textile Division Presentation 2021.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Building Integrated photovoltaic BIPV_UPV.pdf
A comparative study of natural language inference in Swahili using monolingua...
Approach and Philosophy of On baking technology
Tartificialntelligence_presentation.pptx
Group 1 Presentation -Planning and Decision Making .pptx
MIND Revenue Release Quarter 2 2025 Press Release
Mushroom cultivation and it's methods.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Unlocking AI with Model Context Protocol (MCP)
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Encapsulation theory and applications.pdf
Empathic Computing: Creating Shared Understanding

Continuous Deployment at Disqus (Pylons Minicon)

  • 1. DISQUS Continuous Deployment Everything David Cramer @zeeg Friday, April 29, 2011
  • 2. Disclaimer: We don’t use Pylons Friday, April 29, 2011
  • 3. Continuous Deployment Shipping new code as soon as it’s ready (It’s really just super awesome buildbots) Friday, April 29, 2011
  • 4. Workflow 1. Developer commits code 2. CI server runs tests automatically 2.1.Build passes, code deploys 2.2.Build fails, block deploy 3. Developer tests feature on production Friday, April 29, 2011
  • 5. Pros Cons • Develop features • Culture Shock incrementally • Stability depends on • Release frequently test coverage • Less QA! (maybe) • Initial time investment We mostly just care about iteration and stability Friday, April 29, 2011
  • 7. Development • Production > Staging > CI > Dev • Automate testing of complicated processes and architecture • Simple is arguably better than complete • Especially for local development • python setup.py {develop,test} • Use Puppet/Chef or build a simple bootstrap.{py,sh} Friday, April 29, 2011
  • 8. Production Staging • PostgreSQL • PostgreSQL • Memcache • Memcache • Redis • Redis • Solr • Solr • Apache • Apache • Nginx • Nginx • RabbitMQ • RabbitMQ CI Server Macbook • Memcache • PostgreSQL • PostgreSQL • Apache • Redis • Memcache • Solr • Redis • Apache • Solr • Nginx • Nginx • RabbitMQ • RabbitMQ Friday, April 29, 2011
  • 9. Bootstrapping Local • Simplify local setup • git clone dcramer@disqus:disqus.git • python setup.py develop • python manage.py runserver • Need to test dependancies? • virtualbox + vagrant up Friday, April 29, 2011
  • 10. “Under Construction” • 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 :(' Friday, April 29, 2011
  • 11. Gargoyle Deploy features to portions of a user base at a time to ensure smooth, measurable releases Being users of our product, we actively use early versions of features before public release Friday, April 29, 2011
  • 12. Integration (or as we like to call it) Friday, April 29, 2011
  • 13. Integration is Required Deploy only when things wont break Friday, April 29, 2011
  • 15. CI 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 Friday, April 29, 2011
  • 16. Shortcomings • False positives lower awareness • Reporting isn't accurate • Services fail • Bad Tests • Not enough code coverage • Regressions on untested code • Test suite takes too long • Integration tests vs Unit tests Friday, April 29, 2011
  • 17. Fixing False Positives • Re-run tests several times on a failure • Report continually failing tests • Fix continually failing tests • Rely less on 3rd parties • Mock/Dingus Friday, April 29, 2011
  • 18. Maintaining Coverage • Raise awareness with reporting • Fail/alert when coverage drops on a build • Commit tests with code • Drive it into your culture Friday, April 29, 2011
  • 19. Speeding Up Tests • Write true unit tests • vs slower integration tests • Mock 3rd party APIs • Distributed and parallel testing • http://github.com/disqus/mule Friday, April 29, 2011
  • 20. Mule • Unstable (we’re working on it) • Mostly Django right now • Generic interfaces for unittest2 • Works with multi-processing and Celery • More complex than normal Celery usage • Full XUnit integration • Simple workflow • mule test --runner="python manage.py mule --worker $TEST" Friday, April 29, 2011
  • 22. How DISQUS Does It • Incremental deploy with Fabric • Drop server from pool • Pull in requirements on each server • Isolated virtualenv’s built on each server • Push server back online Friday, April 29, 2011
  • 23. Challenges • PyPi works on server A, but not B • Scale, or lack of • CPU cost per server • Schema changes, data model changes • Backwards compatibility Friday, April 29, 2011
  • 24. PyPi is Down • http://github.com/disqus/chishop Friday, April 29, 2011
  • 25. Help, we have 100 servers! • Incremental (ours) vs Fanout • Push vs Pull • Twitter uses BitTorrent • Isolation vs Packaging (Complexity) Friday, April 29, 2011
  • 26. SQL Schema Changes 1. Add column (NULLable) 2. Add app code to fill column 3. Deploy 4. Backfill column 5. Add app code to read column 6. Deploy Cached Data Changes • Have a global version number • Have a data model cache version • maybe md5(cls.__dict__)? Friday, April 29, 2011
  • 27. DISQUS Questions? psst, we’re hiring [email protected] Friday, April 29, 2011
  • 28. References • Mule (distributed test runner) http://github.com/disqus/mule • Gargoyle (feature switches) https://github.com/disqus/gargoyle • Jenkins CI http://jenkins-ci.org/ code.disqus.com Friday, April 29, 2011