SlideShare uma empresa Scribd logo
1 de 38
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Groovy concurrency
Groovy concurrencyGroovy concurrency
Groovy concurrencyAlex Miller
 
Introduction to .Net Driver
Introduction to .Net DriverIntroduction to .Net Driver
Introduction to .Net DriverDataStax Academy
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcachedJurriaan Persyn
 
Async and Non-blocking IO w/ JRuby
Async and Non-blocking IO w/ JRubyAsync and Non-blocking IO w/ JRuby
Async and Non-blocking IO w/ JRubyJoe Kutner
 
Caching In The Cloud
Caching In The CloudCaching In The Cloud
Caching In The CloudAlex Miller
 
Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...Jimmy Lai
 
Spark / Mesos Cluster Optimization
Spark / Mesos Cluster OptimizationSpark / Mesos Cluster Optimization
Spark / Mesos Cluster Optimizationebiznext
 
Hazelcast
HazelcastHazelcast
Hazelcastoztalip
 
[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기NAVER D2
 
Above the clouds: introducing Akka
Above the clouds: introducing AkkaAbove the clouds: introducing Akka
Above the clouds: introducing Akkanartamonov
 
캐시 분산처리 인프라
캐시 분산처리 인프라캐시 분산처리 인프라
캐시 분산처리 인프라Park Chunduck
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSuzquiano
 
Caching reboot: javax.cache & Ehcache 3
Caching reboot: javax.cache & Ehcache 3Caching reboot: javax.cache & Ehcache 3
Caching reboot: javax.cache & Ehcache 3Louis Jacomet
 
Winter is coming? Not if ZooKeeper is there!
Winter is coming? Not if ZooKeeper is there!Winter is coming? Not if ZooKeeper is there!
Winter is coming? Not if ZooKeeper is there!Joydeep Banik Roy
 
Hazelcast Essentials
Hazelcast EssentialsHazelcast Essentials
Hazelcast EssentialsRahul Gupta
 

Mais procurados (20)

Groovy concurrency
Groovy concurrencyGroovy concurrency
Groovy concurrency
 
Memcached Study
Memcached StudyMemcached Study
Memcached Study
 
Introduction to .Net Driver
Introduction to .Net DriverIntroduction to .Net Driver
Introduction to .Net Driver
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached
 
Async and Non-blocking IO w/ JRuby
Async and Non-blocking IO w/ JRubyAsync and Non-blocking IO w/ JRuby
Async and Non-blocking IO w/ JRuby
 
Caching In The Cloud
Caching In The CloudCaching In The Cloud
Caching In The Cloud
 
Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...
 
Spark / Mesos Cluster Optimization
Spark / Mesos Cluster OptimizationSpark / Mesos Cluster Optimization
Spark / Mesos Cluster Optimization
 
Hazelcast
HazelcastHazelcast
Hazelcast
 
[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기
 
Above the clouds: introducing Akka
Above the clouds: introducing AkkaAbove the clouds: introducing Akka
Above the clouds: introducing Akka
 
JahiaOne - Performance Tuning
JahiaOne - Performance TuningJahiaOne - Performance Tuning
JahiaOne - Performance Tuning
 
캐시 분산처리 인프라
캐시 분산처리 인프라캐시 분산처리 인프라
캐시 분산처리 인프라
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMS
 
Managing Postgres with Ansible
Managing Postgres with AnsibleManaging Postgres with Ansible
Managing Postgres with Ansible
 
Caching reboot: javax.cache & Ehcache 3
Caching reboot: javax.cache & Ehcache 3Caching reboot: javax.cache & Ehcache 3
Caching reboot: javax.cache & Ehcache 3
 
Scaling symfony apps
Scaling symfony appsScaling symfony apps
Scaling symfony apps
 
Ehcache 3 @ BruJUG
Ehcache 3 @ BruJUGEhcache 3 @ BruJUG
Ehcache 3 @ BruJUG
 
Winter is coming? Not if ZooKeeper is there!
Winter is coming? Not if ZooKeeper is there!Winter is coming? Not if ZooKeeper is there!
Winter is coming? Not if ZooKeeper is there!
 
Hazelcast Essentials
Hazelcast EssentialsHazelcast Essentials
Hazelcast Essentials
 

Destaque

Seguridad de la Informacion
Seguridad de la InformacionSeguridad de la Informacion
Seguridad de la InformacionNFAG DTLF
 
18 TIPS TO-BE FOUNDERS
18 TIPS TO-BE FOUNDERS18 TIPS TO-BE FOUNDERS
18 TIPS TO-BE FOUNDERSAndre Marquet
 
אילוצים וריסונים במלחמה מקומית - מלחמת לבנון השניה
אילוצים וריסונים במלחמה מקומית - מלחמת לבנון השניהאילוצים וריסונים במלחמה מקומית - מלחמת לבנון השניה
אילוצים וריסונים במלחמה מקומית - מלחמת לבנון השניהIshai Aloni
 
شهادة الماجستر
شهادة الماجسترشهادة الماجستر
شهادة الماجسترSaleem Abudayeh
 
Through the Lens of an iPhone: Charleston, SC
Through the Lens of an iPhone: Charleston, SCThrough the Lens of an iPhone: Charleston, SC
Through the Lens of an iPhone: Charleston, SCPaul Brown
 
6 Healthy Mother's Day Gifts
6 Healthy Mother's Day Gifts6 Healthy Mother's Day Gifts
6 Healthy Mother's Day GiftsEason Chan
 
Fitriana bakar tugas 1 so ii
Fitriana bakar tugas 1 so iiFitriana bakar tugas 1 so ii
Fitriana bakar tugas 1 so iifhitCharis
 
Mobile application development |#Mobileapplicationdevelopment
Mobile application development |#MobileapplicationdevelopmentMobile application development |#Mobileapplicationdevelopment
Mobile application development |#MobileapplicationdevelopmentMobile App Developers India
 
หน่วยที่ 9 ระบบเครือข่ายอินเทอร์เน็ต
หน่วยที่ 9 ระบบเครือข่ายอินเทอร์เน็ตหน่วยที่ 9 ระบบเครือข่ายอินเทอร์เน็ต
หน่วยที่ 9 ระบบเครือข่ายอินเทอร์เน็ตTa Khanittha
 
How to Find a Good Work-Life Balance
How to Find a Good Work-Life Balance How to Find a Good Work-Life Balance
How to Find a Good Work-Life Balance Wording Well
 
Local Government Balances Security, Flexibility and Productivity with BlackBe...
Local Government Balances Security, Flexibility and Productivity with BlackBe...Local Government Balances Security, Flexibility and Productivity with BlackBe...
Local Government Balances Security, Flexibility and Productivity with BlackBe...BlackBerry
 
Towards a Grand Unified Theory of Systems Engineering (GUTSE)
Towards a Grand Unified Theory of Systems Engineering (GUTSE)Towards a Grand Unified Theory of Systems Engineering (GUTSE)
Towards a Grand Unified Theory of Systems Engineering (GUTSE)Joseph KAsser
 
Social Media & Networking - The Evolving Workforce
Social Media & Networking - The Evolving WorkforceSocial Media & Networking - The Evolving Workforce
Social Media & Networking - The Evolving WorkforceTodd Wheatland
 

Destaque (19)

SFR Certification
SFR CertificationSFR Certification
SFR Certification
 
Seguridad de la Informacion
Seguridad de la InformacionSeguridad de la Informacion
Seguridad de la Informacion
 
18 TIPS TO-BE FOUNDERS
18 TIPS TO-BE FOUNDERS18 TIPS TO-BE FOUNDERS
18 TIPS TO-BE FOUNDERS
 
אילוצים וריסונים במלחמה מקומית - מלחמת לבנון השניה
אילוצים וריסונים במלחמה מקומית - מלחמת לבנון השניהאילוצים וריסונים במלחמה מקומית - מלחמת לבנון השניה
אילוצים וריסונים במלחמה מקומית - מלחמת לבנון השניה
 
شهادة الماجستر
شهادة الماجسترشهادة الماجستر
شهادة الماجستر
 
Things I Carry
Things I CarryThings I Carry
Things I Carry
 
Frraactioon
FrraactioonFrraactioon
Frraactioon
 
Research Design
Research DesignResearch Design
Research Design
 
Through the Lens of an iPhone: Charleston, SC
Through the Lens of an iPhone: Charleston, SCThrough the Lens of an iPhone: Charleston, SC
Through the Lens of an iPhone: Charleston, SC
 
6 Healthy Mother's Day Gifts
6 Healthy Mother's Day Gifts6 Healthy Mother's Day Gifts
6 Healthy Mother's Day Gifts
 
Mas loco que una cabra
Mas loco que una cabraMas loco que una cabra
Mas loco que una cabra
 
Fitriana bakar tugas 1 so ii
Fitriana bakar tugas 1 so iiFitriana bakar tugas 1 so ii
Fitriana bakar tugas 1 so ii
 
Mobile application development |#Mobileapplicationdevelopment
Mobile application development |#MobileapplicationdevelopmentMobile application development |#Mobileapplicationdevelopment
Mobile application development |#Mobileapplicationdevelopment
 
หน่วยที่ 9 ระบบเครือข่ายอินเทอร์เน็ต
หน่วยที่ 9 ระบบเครือข่ายอินเทอร์เน็ตหน่วยที่ 9 ระบบเครือข่ายอินเทอร์เน็ต
หน่วยที่ 9 ระบบเครือข่ายอินเทอร์เน็ต
 
How to Find a Good Work-Life Balance
How to Find a Good Work-Life Balance How to Find a Good Work-Life Balance
How to Find a Good Work-Life Balance
 
Local Government Balances Security, Flexibility and Productivity with BlackBe...
Local Government Balances Security, Flexibility and Productivity with BlackBe...Local Government Balances Security, Flexibility and Productivity with BlackBe...
Local Government Balances Security, Flexibility and Productivity with BlackBe...
 
Perunapuu esittely 4
Perunapuu esittely 4Perunapuu esittely 4
Perunapuu esittely 4
 
Towards a Grand Unified Theory of Systems Engineering (GUTSE)
Towards a Grand Unified Theory of Systems Engineering (GUTSE)Towards a Grand Unified Theory of Systems Engineering (GUTSE)
Towards a Grand Unified Theory of Systems Engineering (GUTSE)
 
Social Media & Networking - The Evolving Workforce
Social Media & Networking - The Evolving WorkforceSocial Media & Networking - The Evolving Workforce
Social Media & Networking - The Evolving Workforce
 

Semelhante a Practicing Continuous Deployment: Shipping New Code As Soon As It's Ready

Inside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private CloudInside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private CloudAtlassian
 
Improving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and UnicornImproving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and UnicornSimon Bagreev
 
Rabbitmq Boot System
Rabbitmq Boot SystemRabbitmq Boot System
Rabbitmq Boot SystemAlvaro Videla
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureHabeeb Rahman
 
Continuous Integration Testing in Django
Continuous Integration Testing in DjangoContinuous Integration Testing in Django
Continuous Integration Testing in DjangoKevin Harvey
 
Building and running cloud native cassandra
Building and running cloud native cassandraBuilding and running cloud native cassandra
Building and running cloud native cassandraVinay Kumar Chella
 
DataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With Jepsen
DataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With JepsenDataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With Jepsen
DataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With JepsenDataStax Academy
 
Testing Cassandra Guarantees under Diverse Failure Modes with Jepsen
Testing Cassandra Guarantees under Diverse Failure Modes with JepsenTesting Cassandra Guarantees under Diverse Failure Modes with Jepsen
Testing Cassandra Guarantees under Diverse Failure Modes with Jepsenjkni
 
Corwin on Containers
Corwin on ContainersCorwin on Containers
Corwin on ContainersCorwin Brown
 
Configuration Management and Salt
Configuration Management and SaltConfiguration Management and Salt
Configuration Management and Salt55020
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile InfrastructuresAntons Kranga
 
Islands: Puppet at Bulletproof Networks
Islands: Puppet at Bulletproof NetworksIslands: Puppet at Bulletproof Networks
Islands: Puppet at Bulletproof NetworksLindsay Holmwood
 
Eclipse con 2012 - Frictionless operations with Puppet - Luke Kanies
Eclipse con 2012 - Frictionless operations with Puppet - Luke KaniesEclipse con 2012 - Frictionless operations with Puppet - Luke Kanies
Eclipse con 2012 - Frictionless operations with Puppet - Luke KaniesPuppet
 
Writing & Sharing Great Modules on the Puppet Forge
Writing & Sharing Great Modules on the Puppet ForgeWriting & Sharing Great Modules on the Puppet Forge
Writing & Sharing Great Modules on the Puppet ForgePuppet
 
Puppet Conf 2012 - Managing Network Devices with Puppet
Puppet Conf 2012 - Managing Network Devices with PuppetPuppet Conf 2012 - Managing Network Devices with Puppet
Puppet Conf 2012 - Managing Network Devices with PuppetNan Liu
 
Scalability at GROU.PS
Scalability at GROU.PSScalability at GROU.PS
Scalability at GROU.PSesokullu
 
DrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performanceDrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performanceAshok Modi
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...Amazon Web Services
 

Semelhante a Practicing Continuous Deployment: Shipping New Code As Soon As It's Ready (20)

Inside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private CloudInside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private Cloud
 
Improving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and UnicornImproving Your Heroku App Performance with Asset CDN and Unicorn
Improving Your Heroku App Performance with Asset CDN and Unicorn
 
Dev Ops 101
Dev Ops 101Dev Ops 101
Dev Ops 101
 
Rabbitmq Boot System
Rabbitmq Boot SystemRabbitmq Boot System
Rabbitmq Boot System
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
 
Continuous Integration Testing in Django
Continuous Integration Testing in DjangoContinuous Integration Testing in Django
Continuous Integration Testing in Django
 
Building and running cloud native cassandra
Building and running cloud native cassandraBuilding and running cloud native cassandra
Building and running cloud native cassandra
 
Mcollective introduction
Mcollective introductionMcollective introduction
Mcollective introduction
 
DataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With Jepsen
DataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With JepsenDataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With Jepsen
DataStax: Testing Cassandra Guarantees Under Diverse Failure Modes With Jepsen
 
Testing Cassandra Guarantees under Diverse Failure Modes with Jepsen
Testing Cassandra Guarantees under Diverse Failure Modes with JepsenTesting Cassandra Guarantees under Diverse Failure Modes with Jepsen
Testing Cassandra Guarantees under Diverse Failure Modes with Jepsen
 
Corwin on Containers
Corwin on ContainersCorwin on Containers
Corwin on Containers
 
Configuration Management and Salt
Configuration Management and SaltConfiguration Management and Salt
Configuration Management and Salt
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile Infrastructures
 
Islands: Puppet at Bulletproof Networks
Islands: Puppet at Bulletproof NetworksIslands: Puppet at Bulletproof Networks
Islands: Puppet at Bulletproof Networks
 
Eclipse con 2012 - Frictionless operations with Puppet - Luke Kanies
Eclipse con 2012 - Frictionless operations with Puppet - Luke KaniesEclipse con 2012 - Frictionless operations with Puppet - Luke Kanies
Eclipse con 2012 - Frictionless operations with Puppet - Luke Kanies
 
Writing & Sharing Great Modules on the Puppet Forge
Writing & Sharing Great Modules on the Puppet ForgeWriting & Sharing Great Modules on the Puppet Forge
Writing & Sharing Great Modules on the Puppet Forge
 
Puppet Conf 2012 - Managing Network Devices with Puppet
Puppet Conf 2012 - Managing Network Devices with PuppetPuppet Conf 2012 - Managing Network Devices with Puppet
Puppet Conf 2012 - Managing Network Devices with Puppet
 
Scalability at GROU.PS
Scalability at GROU.PSScalability at GROU.PS
Scalability at GROU.PS
 
DrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performanceDrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performance
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
 

Mais de zeeg

Tools for Development and Debugging in Python
Tools for Development and Debugging in PythonTools for Development and Debugging in Python
Tools for Development and Debugging in Pythonzeeg
 
Pitfalls of Continuous Deployment
Pitfalls of Continuous DeploymentPitfalls of Continuous Deployment
Pitfalls of Continuous Deploymentzeeg
 
Building Scalable Web Apps
Building Scalable Web AppsBuilding Scalable Web Apps
Building Scalable Web Appszeeg
 
Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)zeeg
 
PyCon 2011 Scaling Disqus
PyCon 2011 Scaling DisqusPyCon 2011 Scaling Disqus
PyCon 2011 Scaling Disquszeeg
 
Sentry (SF Python, Feb)
Sentry (SF Python, Feb)Sentry (SF Python, Feb)
Sentry (SF Python, Feb)zeeg
 
Db tips & tricks django meetup
Db tips & tricks django meetupDb tips & tricks django meetup
Db tips & tricks django meetupzeeg
 

Mais de zeeg (7)

Tools for Development and Debugging in Python
Tools for Development and Debugging in PythonTools for Development and Debugging in Python
Tools for Development and Debugging in Python
 
Pitfalls of Continuous Deployment
Pitfalls of Continuous DeploymentPitfalls of Continuous Deployment
Pitfalls of Continuous Deployment
 
Building Scalable Web Apps
Building Scalable Web AppsBuilding Scalable Web Apps
Building Scalable Web Apps
 
Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)
 
PyCon 2011 Scaling Disqus
PyCon 2011 Scaling DisqusPyCon 2011 Scaling Disqus
PyCon 2011 Scaling Disqus
 
Sentry (SF Python, Feb)
Sentry (SF Python, Feb)Sentry (SF Python, Feb)
Sentry (SF Python, Feb)
 
Db tips & tricks django meetup
Db tips & tricks django meetupDb tips & tricks django meetup
Db tips & tricks django meetup
 

Último

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Último (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Practicing Continuous Deployment: Shipping New Code As Soon As It's Ready

  • 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