SlideShare a Scribd company logo
1 of 48
Download to read offline
Towards Continuous Deployment
         with Django

           Roger Barnes
           @mindsocket
     roger@mindsocket.com.au

       PyCon Australia 2012


                                1
Beer


          Adventure


        Photography


             Frisbee


   Web development


      Python/Django


Co-founder @ Arribaa


          BTech ICS

                   1997   1999   2001   2003   2005   2007   2009   2011
Concepts from other talks
●   The why
    –   Lean startups and customer discovery
    –   Do more with less
●   The how
    –   EC2 / provisioning
    –   Architecture
    –   Developing for cloud deployment
    –   Monitoring live web applications
    –   IaaS vs PaaS
What is continuous delivery*
"Rapid, incremental, low-risk delivery of high quality, valuable
new functionality to users through automation of the build,
testing and deployment process" - Jez Humble


         Deploying every good version of your software...
                    … or at least being able to


 "Minimising MTTBID (Mean Time to Bad Idea Detection)" – Etsy


                              * delivery == deployment for the purposes of this talk
More Than Technology
●   Technology - For automation
●   People - Cross-functional team, organised around
    product
●   Processes – Conventions and some glue that
    technology can't automate
Why
●   Fail fast, win fast - Build, Measure, Learn
●   Competitive advantage
●   Avoid YAGNI - do less
●   Less manual process, less risk
●   Real-time control
    –   Deploy on demand
    –   Decoupled deployment and release
    –   Self service environments
Continuous Delivery in Practice
●   Single path to production
●   Optimise for resilience
●   Get comfortable with being uncomfortable
●   Automate as much as possible
●   If it hurts, do it more often
●   Becomes natural, return on investment is fast/high
●   Lots of ways to do it, here's what I've done...
Develop Commit Build Stage Deploy Measure

                        Environments
●   Make dev/test/prod as similar as possible
    –   Full stack, no "./manage.py runserver"
    –   Some exceptions make sense. eg for development:
        ●   dummy email backend
        ●   dummy message broker
        ●   fewer threads/workers
        ●   less memory
        ●   less analytics instrumentation
Develop Commit Build Stage Deploy Measure

                Environments
        Dev/test virtualised using Vagrant


Create and configure lightweight, reproducible, and
       portable development environments


                 $ vagrant up
                 $ vagrant ssh
Develop Commit Build Stage Deploy Measure

                       Environments
Vagrantfile configures base image, provisioning,
        shared folders, forwarded ports
    Vagrant::Config.run do |config|
     config.vm.box = "precise64"
     config.vm.box_url = "http://files.vagrantup.com/precise64.box"

    config.vm.provision :puppet do |puppet|
     puppet.manifests_path = "puppet/vagrant-manifests"
     puppet.manifest_file = "dev.pp"
     puppet.module_path = "puppet/modules"
    end

     config.vm.forward_port 80, 8000
     config.vm.forward_port 3306, 3306
     config.vm.share_folder "arribaa", "/opt/django-projects/arribaa", ".."
    end
Develop Commit Build Stage Deploy Measure

                                Environments
●   Repeatable, versioned configuration
    –   Snowflake bad, phoenix good
    –   Puppet (masterless) for provisioning OS and services
    –   Fabric for scripted tasks, eg:
         ●   copy database from production
         ●   update requirements
         ●   migrate database
         ●   commit and push to repository
●   Anti-pattern
    –   Can't spin up new environment with one command
Develop Commit Build Stage Deploy Measure

 Development top level puppet config
include uwsgi
include statsd
include solr
include memcached
include rabbitmq                    Test configuration is the same
include nginx
include testing                           Production adds:
include arribaa                               backup
include arribaa::db_node                     monitoring
include arribaa::nginx
include arribaa::celery
Develop Commit Build Stage Deploy Measure

           Using Fabric with Vagrant
def vagrant():
    # get vagrant ssh setup
    vagrant_config = _get_vagrant_config()
    env.key_filename = vagrant_config['IdentityFile']
    env.hosts = ['%s:%s' % (vagrant_config['HostName'],
                            vagrant_config['Port'])]
    env.user = vagrant_config['User']

def _get_vagrant_config():
    with lcd('../vagrant'):
        result = local('vagrant ssh-config', capture=True)
    conf = {}
    for line in iter(result.splitlines()):
        parts = line.split()
        conf[parts[0]] = ' '.join(parts[1:])

   return conf




                                       Based on https://gist.github.com/1099132
Develop Commit Build Stage Deploy Measure

                         Dependencies
●   virtualenv – separate env for each app
●   pip – install dependencies into virtualenv
    –   use requirements file
    –   use explicit versions
         ●   for repository based dependencies, use commit id
         ●   or fork on github
Develop Commit Build Stage Deploy Measure

                       Dependencies
●   Using virtualenv and pip with fabric
env.site_dir = '/opt/django-projects/arribaa'
env.app_dir = '/opt/django-projects/arribaa/arribaa'
env.pip_file = 'requirements.txt'

def ve_run(command, func=run, base_dir=env.app_dir, *args, **kwargs):
  with cd(base_dir):
    with prefix("source /opt/virtualenvs/%s/bin/activate" % env.virtualenv):
      return func(command, *args, **kwargs)

def update_reqs():
  ve_run('pip install -r %s' % env.pip_file, base_dir=env.site_dir)
Develop Commit Build Stage Deploy Measure

                       Database migration
●   South
    –   Schema changes
    –   Data migrations
●   Deploy separate expand and contract operations, eg:
    –   Expand
        ●   add new column (update model, manage.py schemamigration …)
        ●   map from old column (manage.py datamigration …)
    –   Deploy
    –   Contract (optional)
        ●   remove old column ( update model, manage.py schemamigration …)
Develop Commit Build Stage Deploy Measure

              Database migration
●   Using South with fabric
def syncdb():
    ve_run("python manage.py syncdb --noinput --migrate")
Develop Commit Build Stage Deploy Measure

               Tying it all together
●   Update pip requirements on vagrant VM
    $ fab vagrant update_reqs
●   Run data migration on vagrant VM
    $ fab vagrant syncdb
Develop Commit Build Stage Deploy Measure

                    Source control
●   Pick one, learn it
●   Use tags to keep track of build status
●   Avoid long-lived branches
    –   or integrate them – more overhead
                                             ✔   application code
●   Tracks all code/documentation            ✔   deployment code
                                             ✔   provisioning code
                                             ✔   configuration code
                                             ✔   documentation
                                             ✗   not build artifacts
arribaa                Application code
├── apps               Django apps
│    └── ...
├── static             Django static files
│    └── ...
├── templates          Django templates
│    └── ...
├── fabfile.py         Fabric scripts
├── requirements.txt   Pip
└── ...
bin
└── jenkins.sh         Jenkins job
docs
└── ...
vagrant
├── Vagrantfile      Dev VM              config
└── puppet
    ├── modules      Puppet              modules
    │   ├── arribaa
    │   ├── backup
    │   ├── graphite
    │   ├── ...
    │   ├── uwsgi
    │   └── wget
    └── vagrant-manifests
        ├── dev.pp Puppet                dev
        ├── prod.pp Puppet               prod*
        └── test.pp Puppet               test
               * Not used by vagrant, but convenient to store here
Develop Commit Build Stage Deploy Measure

                      Automated Testing
●   Django’s test framework
●   Continuous Integration and Testing
    –   Jenkins
●   django-jenkins
    –   tests
    –   pylint
    –   coverage
    –   css/jslint
●   factory_boy instead of fixtures
Develop Commit Build Stage Deploy Measure

                      Test separation
●   Split up tests by type
●   Can parallelise, keeping test run times low
    –   < 20 minutes from commit to production
●   Unit tests first, faster feedback
●   Run tests on different triggers, keep some out of the main
    build
●   Etsy - Divide and Concur
    –   http://codeascraft.etsy.com/2011/04/20/divide-and-concur/
Develop Commit Build Stage Deploy Measure

                         Test separation
●   Unit
●   Functional/UI
    –   Selenium et al
●   Staging and production smoke tests
    –   Crawl URLs
    –   Load/performance testing
●   Flaky tests, Slow tests
    –   exclude from regular build, run on a separate schedule
Develop Commit Build Stage Deploy Measure

                         Test separation
   ●   How to do this with Django?
       –   Suites
       –   Custom test runner
       –   Other test systems (Nose has an attrib plugin)
   ●   My current solution
       –   Annotating tests, and adapted django-jenkins command

class TestBooking(TestCase):

   @pipelineTag ("unit")
   def test_when_lapsed(self):
       oldbooking = factories.BookingFactory.build(when=some_old_date)
       self.assertTrue(oldbooking.when_lapsed())
Develop Commit Build Stage Deploy Measure

                             Test separation
# Used to ignore tests
ignore = lambda test_item: None

def pipelineTag(*args):
    """
    Let a testcase run if any of the tags are in sys.argv and
    none of the tags match not-* in sys.argv.
    """
    # Abstain if we're not in a build pipeline (ie using django-jenkins)
    # or if no tag(s) specified
    if 'jenkins_pipeline' not in sys.argv or not any(['tagged-' in arg for arg in sys.argv]):
        return _id

    tags = args
    assert set(tags) < set(['unit', 'functional', 'flaky', 'slow', 'staging'])

    #Silently ignore if no matching tag
    if not any(['tagged-'+tag in sys.argv for tag in tags]):
        return ignore

    # Skip if "not-blah" tagged
    if any(['not-'+tag in sys.argv for tag in tags]):
        return skip('tagged: ' + ','.join([tag for tag in tags if 'not-'+tag in sys.argv]))

    # This test made it through
    return _id
Develop Commit Build Stage Deploy Measure

                        Build Pipeline
●   One pipeline
●   All developers feed start of pipeline via VCS (master)
    –   Improve policy of "don't deploy broken code"...
    –   ...with system where it's harder to deploy broken code
●   Jenkins Build Pipeline Plugin
    –   Series of dependant jobs, each runs different tests
    –   Feeds into pre-deploy staging job
    –   Successful staging job enables deploy job
Develop Commit Build Stage Deploy Measure

        Build Pipeline
   Currently simple linear flow
Develop Commit Build Stage Deploy Measure

                         Build Pipeline
●   Jenkins job – unit test stage:
    bash -ex ./bin/jenkins.sh tagged-unit not-flaky not-slow
●   jenkins.sh
    # Setup virtualenv, pip requirements, settings.py etc
    ...snip...
    cd $WORKSPACE/arribaa
    python manage.py clean_pyc
    python manage.py jenkins_pipeline "$@"
Develop Commit Build Stage Deploy Measure

                               Staging/QA Job
●   fab staging-deploy – very similar process to production deploy
●   Test run of production deployment using Fabric
    –   Deploy code and config to staging environment (Vagrant VM)
    –   Apply dependency updates
        ●   puppet config
        ●   pip requirements
    –   Copy database from production and run data migration
●   Should now have a deployed QA environment
●   Browser smoke tests – currently selenium
    –   Not using Django 1.4 LiveTestCase here, we have a full stack to play with
●   Tag successful build as deployable
Develop Commit Build Stage Deploy Measure

                   Deployment Strategies
●   Optimistic
    –   Deploy, reload services – some appservers handle this well
●   Blue/Green
    –   Parallel environments, 1 idle
    –   Idle environment gets new version
    –   Smoke tests and monitoring before switching over
●   Canary
    –   Take subset of app servers out of pool
    –   Deploy to subset
    –   Smoke tests and monitoring before deploying rest of cluster
●   Deploy whole new (app) server instance
    –   then rewire load-balancer
Develop Commit Build Stage Deploy Measure

     Deployment with Jenkins & Fabric



Using Git tags
     –   Set in Jenkins after successful staging run
     –   Used by deploy in Fabric
def pull():
  with cd(env.site_dir):
    run('git fetch')
    latest_tag = run('git describe --tags --match "ci-passed-staging-*" origin/master',
                     pty=False)
    run('git reset --hard refs/tags/%s' % latest_tag, pty=False)
Develop Commit Build Stage Deploy Measure




                    Tags set by build pipeline
Develop Commit Build Stage Deploy Measure

   Deployment with Jenkins & Fabric
Jenkins script:
  virtualenv -q /opt/virtualenvs/arribaa-jenkins
  source /opt/virtualenvs/arribaa-jenkins/bin/activate
  pip install -r requirements.txt
  pip install -r requirements-testing.txt
  cd $WORKSPACE/arribaa
  fab deploy
Develop Commit Build Stage Deploy Measure

     Deployment with Jenkins & Fabric
def deploy():
 dbbackup() # django-dbbackup – to dropbox
 changes = pull() # git fetch, git describe, git log, git reset
 apply_puppet() # puppet apply … prod.pp
 update_requirements() # pip install -r requirements.txt
 clean_pyc() # django-extensions command
 syncdb() # and –migrate (South)
 collectstatic()
 reload_uwsgi() # reload app server
 restart_celeryd() # bounce task server
 run('git tag -f ci-deployed && git push –tags') # tag deployed version
 send_email(changes) # send notification
Develop Commit Build Stage Deploy Measure

    Decoupling deployment and release
●   Feature flags vs feature branches
    –   Real time control with flags
    –   Cleanup/maint needed for flags
    –   Harder/slower to test different combinations in either case
●   Good for testing ideas (on/off, A/B, power users, QA etc)
●   Gargoyle
    –   includes optional admin interface
    –   selective criteria (%age of users, staff only, ...)
●   Alternative: Django Waffle
Develop Commit Build Stage Deploy Measure

                     Measurement
●   Eyes wide open
    –   Track system and user behaviour
●   Post-deployment
    –   Error, performance and behaviour heuristics
    –   Trend monitoring
    –   Goal conversion rates
Develop Commit Build Stage Deploy Measure

        Measurement
Develop Commit Build Stage Deploy Measure

  Measurement - Munin
Develop Commit Build Stage Deploy Measure
Develop Commit Build Stage Deploy Measure

                         Measurement
●   django-statsd, statsd and graphite
    –   page timing
    –   counters




             http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/
Rollback options
●   Level of automation
    –   Depends on risk aversion and complexity of environment
    –   12+ years of deployment, average 5 deployments per week,
        very very few actual rollbacks
●   Engineer around it
    –   lots of small changes → more likely to "roll-forward"
    –   staged deployment → minimise harm
●   Engineer for it
    –   avoid backwards incompatible data migrations
    –   tag deployments, keep previous versions handy
Rollback options


  "My deployment rollback strategy is
     like a car with no reverse gear.
      You can still go backwards,
   but you have to get out and push.
Knowing that makes you drive carefully."


                   - Me
Where to from here
                     Have an existing app with some gaps?
               Think about what's slowing you down the most
●   Suggested priorities
    –   Automated tests (Django built-in)
    –   Continuous integration (jenkins, django-jenkins)
    –   Measure all the things (sentry, statsd + graphite, new relic)
    –   Scripted database (South)
    –   Scripted deployment (fabric)
    –   Configuration management (puppet)
    –   Virtualised development (Vagrant)
    –   Test separation (test decorator, customise test runner)
    –   Feature flags (gargoyle)
Looking Forward
●   Better version pinning
●   Fully automated provisioning
●   Better test separation and parallelisation
●   Combined coverage results
●   Reduce dependence on external services
●   Make deployment more atomic
●   Staged rollouts to cluster – canary deployment
●   Make the "big red deploy button" big and red
Resources
●   Slides – http://slideshare.net/mindsocket/
●   Continuous delivery/deployment
    –   Continuous Delivery Primer - http://www.informit.com/articles/article.aspx?p=1641923
    –   Anatomy of the Deployment Pipeline - http://www.informit.com/articles/printerfriendly.aspx?p=1621865
    –   Code as Craft – Etsy http://codeascraft.etsy.com/
    –   Safe deploying on the cutting edge – Urban Airship http://lanyrd.com/2011/djangocon-us/shbqz/
●   Vagrant – http://vagrantup.com
●   Vagrant with Fabric - https://gist.github.com/1099132
●   Jenkins Build Pipeline Plugin -
    http://www.morethanseven.net/2011/03/20/A-continuous-deployment-example-setup.html
●   Git/fabric based rollback options
    –   http://dan.bravender.us/2012/5/11/git-based_fabric_deploys_are_awesome.html
    –   http://www.askthepony.com/blog/2011/07/setup-a-complete-django-server-deploy-rollback-%E2%80%93-all-in-one-
        powerful-script/
    –   http://lethain.com/deploying-django-with-fabric/
Thank You!




http://slideshare.net/mindsocket
                   Questions?

More Related Content

What's hot

Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suiteericholscher
 
Test Driven Development with Puppet - PuppetConf 2014
Test Driven Development with Puppet - PuppetConf 2014Test Driven Development with Puppet - PuppetConf 2014
Test Driven Development with Puppet - PuppetConf 2014Puppet
 
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...Puppet
 
Test Driven Development with Puppet
Test Driven Development with Puppet Test Driven Development with Puppet
Test Driven Development with Puppet Puppet
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
 
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpecTest-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpecMartin Etmajer
 
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt LongLondon Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt LongOpenCredo
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony AppsPablo Godel
 
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test EverythingPortland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test EverythingPuppet
 
Puppet for SysAdmins
Puppet for SysAdminsPuppet for SysAdmins
Puppet for SysAdminsPuppet
 
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014Puppet
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Puppet
 
Django Deployment with Fabric
Django Deployment with FabricDjango Deployment with Fabric
Django Deployment with FabricJonas Nockert
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Puppet
 
Building JBoss AS 7 for Fedora
Building JBoss AS 7 for FedoraBuilding JBoss AS 7 for Fedora
Building JBoss AS 7 for Fedorawolfc71
 
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony AppsSymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony AppsPablo Godel
 
Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013Puppet
 
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013Puppet
 

What's hot (20)

Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suite
 
Test Driven Development with Puppet - PuppetConf 2014
Test Driven Development with Puppet - PuppetConf 2014Test Driven Development with Puppet - PuppetConf 2014
Test Driven Development with Puppet - PuppetConf 2014
 
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
 
Test Driven Development with Puppet
Test Driven Development with Puppet Test Driven Development with Puppet
Test Driven Development with Puppet
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpecTest-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
 
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt LongLondon Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
 
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test EverythingPortland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
 
Puppet for SysAdmins
Puppet for SysAdminsPuppet for SysAdmins
Puppet for SysAdmins
 
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
 
Django Deployment with Fabric
Django Deployment with FabricDjango Deployment with Fabric
Django Deployment with Fabric
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
 
Building JBoss AS 7 for Fedora
Building JBoss AS 7 for FedoraBuilding JBoss AS 7 for Fedora
Building JBoss AS 7 for Fedora
 
Rebooting a Cloud
Rebooting a CloudRebooting a Cloud
Rebooting a Cloud
 
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony AppsSymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
 
Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013
 
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
 

Viewers also liked

PyCon DE 2013 - Table Partitioning with Django
PyCon DE 2013 - Table Partitioning with DjangoPyCon DE 2013 - Table Partitioning with Django
PyCon DE 2013 - Table Partitioning with DjangoMax Tepkeev
 
Zero downtime deploys for Rails apps
Zero downtime deploys for Rails appsZero downtime deploys for Rails apps
Zero downtime deploys for Rails appspedrobelo
 
Flask and Paramiko for Python VA
Flask and Paramiko for Python VAFlask and Paramiko for Python VA
Flask and Paramiko for Python VAEnrique Valenzuela
 
Django rest framework in 20 minuten
Django rest framework in 20 minutenDjango rest framework in 20 minuten
Django rest framework in 20 minutenAndi Albrecht
 
Do more than one thing at the same time, the Python way
Do more than one thing at the same time, the Python wayDo more than one thing at the same time, the Python way
Do more than one thing at the same time, the Python wayJaime Buelta
 
Two scoops of Django - Security Best Practices
Two scoops of Django - Security Best PracticesTwo scoops of Django - Security Best Practices
Two scoops of Django - Security Best PracticesSpin Lai
 
Pythonic Deployment with Fabric 0.9
Pythonic Deployment with Fabric 0.9Pythonic Deployment with Fabric 0.9
Pythonic Deployment with Fabric 0.9Corey Oordt
 
Django REST Framework
Django REST FrameworkDjango REST Framework
Django REST FrameworkLoad Impact
 
Building a platform with Django, Docker, and Salt
Building a platform with Django, Docker, and SaltBuilding a platform with Django, Docker, and Salt
Building a platform with Django, Docker, and Saltbaremetal
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoTareque Hossain
 
Continuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and JenkinsContinuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and JenkinsFrancesco Bruni
 
Instruction set of 8085
Instruction set  of 8085Instruction set  of 8085
Instruction set of 8085shiji v r
 
Django개발은 PyCharm에서
Django개발은 PyCharm에서Django개발은 PyCharm에서
Django개발은 PyCharm에서Kyoung Up Jung
 
Scalable Django Architecture
Scalable Django ArchitectureScalable Django Architecture
Scalable Django ArchitectureRami Sayar
 
12 tips on Django Best Practices
12 tips on Django Best Practices12 tips on Django Best Practices
12 tips on Django Best PracticesDavid Arcos
 
간단한 블로그를 만들며 Django 이해하기
간단한 블로그를 만들며 Django 이해하기간단한 블로그를 만들며 Django 이해하기
간단한 블로그를 만들며 Django 이해하기Kyoung Up Jung
 
Django, 저는 이렇게 씁니다.
Django, 저는 이렇게 씁니다.Django, 저는 이렇게 씁니다.
Django, 저는 이렇게 씁니다.Kyoung Up Jung
 

Viewers also liked (20)

PyCon DE 2013 - Table Partitioning with Django
PyCon DE 2013 - Table Partitioning with DjangoPyCon DE 2013 - Table Partitioning with Django
PyCon DE 2013 - Table Partitioning with Django
 
Zero downtime deploys for Rails apps
Zero downtime deploys for Rails appsZero downtime deploys for Rails apps
Zero downtime deploys for Rails apps
 
Ansible on AWS
Ansible on AWSAnsible on AWS
Ansible on AWS
 
Flask and Paramiko for Python VA
Flask and Paramiko for Python VAFlask and Paramiko for Python VA
Flask and Paramiko for Python VA
 
Django rest framework in 20 minuten
Django rest framework in 20 minutenDjango rest framework in 20 minuten
Django rest framework in 20 minuten
 
Do more than one thing at the same time, the Python way
Do more than one thing at the same time, the Python wayDo more than one thing at the same time, the Python way
Do more than one thing at the same time, the Python way
 
Two scoops of Django - Security Best Practices
Two scoops of Django - Security Best PracticesTwo scoops of Django - Security Best Practices
Two scoops of Django - Security Best Practices
 
Pythonic Deployment with Fabric 0.9
Pythonic Deployment with Fabric 0.9Pythonic Deployment with Fabric 0.9
Pythonic Deployment with Fabric 0.9
 
Django REST Framework
Django REST FrameworkDjango REST Framework
Django REST Framework
 
Building a platform with Django, Docker, and Salt
Building a platform with Django, Docker, and SaltBuilding a platform with Django, Docker, and Salt
Building a platform with Django, Docker, and Salt
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with django
 
Django in the Real World
Django in the Real WorldDjango in the Real World
Django in the Real World
 
Continuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and JenkinsContinuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and Jenkins
 
Instruction set of 8085
Instruction set  of 8085Instruction set  of 8085
Instruction set of 8085
 
Scaling Django
Scaling DjangoScaling Django
Scaling Django
 
Django개발은 PyCharm에서
Django개발은 PyCharm에서Django개발은 PyCharm에서
Django개발은 PyCharm에서
 
Scalable Django Architecture
Scalable Django ArchitectureScalable Django Architecture
Scalable Django Architecture
 
12 tips on Django Best Practices
12 tips on Django Best Practices12 tips on Django Best Practices
12 tips on Django Best Practices
 
간단한 블로그를 만들며 Django 이해하기
간단한 블로그를 만들며 Django 이해하기간단한 블로그를 만들며 Django 이해하기
간단한 블로그를 만들며 Django 이해하기
 
Django, 저는 이렇게 씁니다.
Django, 저는 이렇게 씁니다.Django, 저는 이렇게 씁니다.
Django, 저는 이렇게 씁니다.
 

Similar to Towards Continuous Deployment with Django

Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at ScaleKris Buytaert
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationDavid Amend
 
Avoid the Vendor Lock-in Trap (with App Deployment)
Avoid the Vendor Lock-in Trap (with App Deployment)Avoid the Vendor Lock-in Trap (with App Deployment)
Avoid the Vendor Lock-in Trap (with App Deployment)Peter Bittner
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-wayRobert Lujo
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsGR8Conf
 
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?Dmitri Shiryaev
 
Continuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin StachniukContinuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin StachniukMarcinStachniuk
 
Testing Django APIs
Testing Django APIsTesting Django APIs
Testing Django APIstyomo4ka
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017MarcinStachniuk
 
Continuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applicationsContinuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applicationsEvgeniy Kuzmin
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture IntroductionHaiqi Chen
 
Continuous integration / continuous delivery
Continuous integration / continuous deliveryContinuous integration / continuous delivery
Continuous integration / continuous deliveryEatDog
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplateStanislav Petrov
 
VueJs Workshop
VueJs WorkshopVueJs Workshop
VueJs WorkshopUnfold UI
 
Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsNick Belhomme
 
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08Борис Зора
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers WorkshopJody Garnett
 
Continuous integration for open source distros v 3.0
Continuous integration for open source distros v 3.0Continuous integration for open source distros v 3.0
Continuous integration for open source distros v 3.0Sriram Narayanan
 
Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Deepak Garg
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13Fred Sauer
 

Similar to Towards Continuous Deployment with Django (20)

Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
 
Avoid the Vendor Lock-in Trap (with App Deployment)
Avoid the Vendor Lock-in Trap (with App Deployment)Avoid the Vendor Lock-in Trap (with App Deployment)
Avoid the Vendor Lock-in Trap (with App Deployment)
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
 
Continuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin StachniukContinuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin Stachniuk
 
Testing Django APIs
Testing Django APIsTesting Django APIs
Testing Django APIs
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
 
Continuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applicationsContinuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applications
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
 
Continuous integration / continuous delivery
Continuous integration / continuous deliveryContinuous integration / continuous delivery
Continuous integration / continuous delivery
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
 
VueJs Workshop
VueJs WorkshopVueJs Workshop
VueJs Workshop
 
Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance tests
 
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
Continuous Delivery with Jenkins declarative pipeline XPDays-2018-12-08
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
Continuous integration for open source distros v 3.0
Continuous integration for open source distros v 3.0Continuous integration for open source distros v 3.0
Continuous integration for open source distros v 3.0
 
Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
 

More from Roger Barnes

The life of a web request - techniques for measuring and improving Django app...
The life of a web request - techniques for measuring and improving Django app...The life of a web request - techniques for measuring and improving Django app...
The life of a web request - techniques for measuring and improving Django app...Roger Barnes
 
Building data flows with Celery and SQLAlchemy
Building data flows with Celery and SQLAlchemyBuilding data flows with Celery and SQLAlchemy
Building data flows with Celery and SQLAlchemyRoger Barnes
 
Introduction to SQL Alchemy - SyPy June 2013
Introduction to SQL Alchemy - SyPy June 2013Introduction to SQL Alchemy - SyPy June 2013
Introduction to SQL Alchemy - SyPy June 2013Roger Barnes
 
Poker, packets, pipes and Python
Poker, packets, pipes and PythonPoker, packets, pipes and Python
Poker, packets, pipes and PythonRoger Barnes
 
Scraping recalcitrant web sites with Python & Selenium
Scraping recalcitrant web sites with Python & SeleniumScraping recalcitrant web sites with Python & Selenium
Scraping recalcitrant web sites with Python & SeleniumRoger Barnes
 
Intro to Pinax: Kickstarting Your Django Apps
Intro to Pinax: Kickstarting Your Django AppsIntro to Pinax: Kickstarting Your Django Apps
Intro to Pinax: Kickstarting Your Django AppsRoger Barnes
 

More from Roger Barnes (6)

The life of a web request - techniques for measuring and improving Django app...
The life of a web request - techniques for measuring and improving Django app...The life of a web request - techniques for measuring and improving Django app...
The life of a web request - techniques for measuring and improving Django app...
 
Building data flows with Celery and SQLAlchemy
Building data flows with Celery and SQLAlchemyBuilding data flows with Celery and SQLAlchemy
Building data flows with Celery and SQLAlchemy
 
Introduction to SQL Alchemy - SyPy June 2013
Introduction to SQL Alchemy - SyPy June 2013Introduction to SQL Alchemy - SyPy June 2013
Introduction to SQL Alchemy - SyPy June 2013
 
Poker, packets, pipes and Python
Poker, packets, pipes and PythonPoker, packets, pipes and Python
Poker, packets, pipes and Python
 
Scraping recalcitrant web sites with Python & Selenium
Scraping recalcitrant web sites with Python & SeleniumScraping recalcitrant web sites with Python & Selenium
Scraping recalcitrant web sites with Python & Selenium
 
Intro to Pinax: Kickstarting Your Django Apps
Intro to Pinax: Kickstarting Your Django AppsIntro to Pinax: Kickstarting Your Django Apps
Intro to Pinax: Kickstarting Your Django Apps
 

Recently uploaded

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Recently uploaded (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

Towards Continuous Deployment with Django

  • 1. Towards Continuous Deployment with Django Roger Barnes @mindsocket roger@mindsocket.com.au PyCon Australia 2012 1
  • 2. Beer Adventure Photography Frisbee Web development Python/Django Co-founder @ Arribaa BTech ICS 1997 1999 2001 2003 2005 2007 2009 2011
  • 3. Concepts from other talks ● The why – Lean startups and customer discovery – Do more with less ● The how – EC2 / provisioning – Architecture – Developing for cloud deployment – Monitoring live web applications – IaaS vs PaaS
  • 4. What is continuous delivery* "Rapid, incremental, low-risk delivery of high quality, valuable new functionality to users through automation of the build, testing and deployment process" - Jez Humble Deploying every good version of your software... … or at least being able to "Minimising MTTBID (Mean Time to Bad Idea Detection)" – Etsy * delivery == deployment for the purposes of this talk
  • 5. More Than Technology ● Technology - For automation ● People - Cross-functional team, organised around product ● Processes – Conventions and some glue that technology can't automate
  • 6. Why ● Fail fast, win fast - Build, Measure, Learn ● Competitive advantage ● Avoid YAGNI - do less ● Less manual process, less risk ● Real-time control – Deploy on demand – Decoupled deployment and release – Self service environments
  • 7. Continuous Delivery in Practice ● Single path to production ● Optimise for resilience ● Get comfortable with being uncomfortable ● Automate as much as possible ● If it hurts, do it more often ● Becomes natural, return on investment is fast/high ● Lots of ways to do it, here's what I've done...
  • 8.
  • 9. Develop Commit Build Stage Deploy Measure Environments ● Make dev/test/prod as similar as possible – Full stack, no "./manage.py runserver" – Some exceptions make sense. eg for development: ● dummy email backend ● dummy message broker ● fewer threads/workers ● less memory ● less analytics instrumentation
  • 10. Develop Commit Build Stage Deploy Measure Environments Dev/test virtualised using Vagrant Create and configure lightweight, reproducible, and portable development environments $ vagrant up $ vagrant ssh
  • 11. Develop Commit Build Stage Deploy Measure Environments Vagrantfile configures base image, provisioning, shared folders, forwarded ports Vagrant::Config.run do |config| config.vm.box = "precise64" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.provision :puppet do |puppet| puppet.manifests_path = "puppet/vagrant-manifests" puppet.manifest_file = "dev.pp" puppet.module_path = "puppet/modules" end config.vm.forward_port 80, 8000 config.vm.forward_port 3306, 3306 config.vm.share_folder "arribaa", "/opt/django-projects/arribaa", ".." end
  • 12. Develop Commit Build Stage Deploy Measure Environments ● Repeatable, versioned configuration – Snowflake bad, phoenix good – Puppet (masterless) for provisioning OS and services – Fabric for scripted tasks, eg: ● copy database from production ● update requirements ● migrate database ● commit and push to repository ● Anti-pattern – Can't spin up new environment with one command
  • 13. Develop Commit Build Stage Deploy Measure Development top level puppet config include uwsgi include statsd include solr include memcached include rabbitmq Test configuration is the same include nginx include testing Production adds: include arribaa backup include arribaa::db_node monitoring include arribaa::nginx include arribaa::celery
  • 14. Develop Commit Build Stage Deploy Measure Using Fabric with Vagrant def vagrant(): # get vagrant ssh setup vagrant_config = _get_vagrant_config() env.key_filename = vagrant_config['IdentityFile'] env.hosts = ['%s:%s' % (vagrant_config['HostName'], vagrant_config['Port'])] env.user = vagrant_config['User'] def _get_vagrant_config(): with lcd('../vagrant'): result = local('vagrant ssh-config', capture=True) conf = {} for line in iter(result.splitlines()): parts = line.split() conf[parts[0]] = ' '.join(parts[1:]) return conf Based on https://gist.github.com/1099132
  • 15. Develop Commit Build Stage Deploy Measure Dependencies ● virtualenv – separate env for each app ● pip – install dependencies into virtualenv – use requirements file – use explicit versions ● for repository based dependencies, use commit id ● or fork on github
  • 16. Develop Commit Build Stage Deploy Measure Dependencies ● Using virtualenv and pip with fabric env.site_dir = '/opt/django-projects/arribaa' env.app_dir = '/opt/django-projects/arribaa/arribaa' env.pip_file = 'requirements.txt' def ve_run(command, func=run, base_dir=env.app_dir, *args, **kwargs): with cd(base_dir): with prefix("source /opt/virtualenvs/%s/bin/activate" % env.virtualenv): return func(command, *args, **kwargs) def update_reqs(): ve_run('pip install -r %s' % env.pip_file, base_dir=env.site_dir)
  • 17. Develop Commit Build Stage Deploy Measure Database migration ● South – Schema changes – Data migrations ● Deploy separate expand and contract operations, eg: – Expand ● add new column (update model, manage.py schemamigration …) ● map from old column (manage.py datamigration …) – Deploy – Contract (optional) ● remove old column ( update model, manage.py schemamigration …)
  • 18. Develop Commit Build Stage Deploy Measure Database migration ● Using South with fabric def syncdb(): ve_run("python manage.py syncdb --noinput --migrate")
  • 19. Develop Commit Build Stage Deploy Measure Tying it all together ● Update pip requirements on vagrant VM $ fab vagrant update_reqs ● Run data migration on vagrant VM $ fab vagrant syncdb
  • 20. Develop Commit Build Stage Deploy Measure Source control ● Pick one, learn it ● Use tags to keep track of build status ● Avoid long-lived branches – or integrate them – more overhead ✔ application code ● Tracks all code/documentation ✔ deployment code ✔ provisioning code ✔ configuration code ✔ documentation ✗ not build artifacts
  • 21. arribaa Application code ├── apps Django apps │ └── ... ├── static Django static files │ └── ... ├── templates Django templates │ └── ... ├── fabfile.py Fabric scripts ├── requirements.txt Pip └── ... bin └── jenkins.sh Jenkins job docs └── ...
  • 22. vagrant ├── Vagrantfile Dev VM config └── puppet ├── modules Puppet modules │ ├── arribaa │ ├── backup │ ├── graphite │ ├── ... │ ├── uwsgi │ └── wget └── vagrant-manifests ├── dev.pp Puppet dev ├── prod.pp Puppet prod* └── test.pp Puppet test * Not used by vagrant, but convenient to store here
  • 23. Develop Commit Build Stage Deploy Measure Automated Testing ● Django’s test framework ● Continuous Integration and Testing – Jenkins ● django-jenkins – tests – pylint – coverage – css/jslint ● factory_boy instead of fixtures
  • 24. Develop Commit Build Stage Deploy Measure Test separation ● Split up tests by type ● Can parallelise, keeping test run times low – < 20 minutes from commit to production ● Unit tests first, faster feedback ● Run tests on different triggers, keep some out of the main build ● Etsy - Divide and Concur – http://codeascraft.etsy.com/2011/04/20/divide-and-concur/
  • 25. Develop Commit Build Stage Deploy Measure Test separation ● Unit ● Functional/UI – Selenium et al ● Staging and production smoke tests – Crawl URLs – Load/performance testing ● Flaky tests, Slow tests – exclude from regular build, run on a separate schedule
  • 26. Develop Commit Build Stage Deploy Measure Test separation ● How to do this with Django? – Suites – Custom test runner – Other test systems (Nose has an attrib plugin) ● My current solution – Annotating tests, and adapted django-jenkins command class TestBooking(TestCase): @pipelineTag ("unit") def test_when_lapsed(self): oldbooking = factories.BookingFactory.build(when=some_old_date) self.assertTrue(oldbooking.when_lapsed())
  • 27. Develop Commit Build Stage Deploy Measure Test separation # Used to ignore tests ignore = lambda test_item: None def pipelineTag(*args): """ Let a testcase run if any of the tags are in sys.argv and none of the tags match not-* in sys.argv. """ # Abstain if we're not in a build pipeline (ie using django-jenkins) # or if no tag(s) specified if 'jenkins_pipeline' not in sys.argv or not any(['tagged-' in arg for arg in sys.argv]): return _id tags = args assert set(tags) < set(['unit', 'functional', 'flaky', 'slow', 'staging']) #Silently ignore if no matching tag if not any(['tagged-'+tag in sys.argv for tag in tags]): return ignore # Skip if "not-blah" tagged if any(['not-'+tag in sys.argv for tag in tags]): return skip('tagged: ' + ','.join([tag for tag in tags if 'not-'+tag in sys.argv])) # This test made it through return _id
  • 28. Develop Commit Build Stage Deploy Measure Build Pipeline ● One pipeline ● All developers feed start of pipeline via VCS (master) – Improve policy of "don't deploy broken code"... – ...with system where it's harder to deploy broken code ● Jenkins Build Pipeline Plugin – Series of dependant jobs, each runs different tests – Feeds into pre-deploy staging job – Successful staging job enables deploy job
  • 29. Develop Commit Build Stage Deploy Measure Build Pipeline Currently simple linear flow
  • 30. Develop Commit Build Stage Deploy Measure Build Pipeline ● Jenkins job – unit test stage: bash -ex ./bin/jenkins.sh tagged-unit not-flaky not-slow ● jenkins.sh # Setup virtualenv, pip requirements, settings.py etc ...snip... cd $WORKSPACE/arribaa python manage.py clean_pyc python manage.py jenkins_pipeline "$@"
  • 31. Develop Commit Build Stage Deploy Measure Staging/QA Job ● fab staging-deploy – very similar process to production deploy ● Test run of production deployment using Fabric – Deploy code and config to staging environment (Vagrant VM) – Apply dependency updates ● puppet config ● pip requirements – Copy database from production and run data migration ● Should now have a deployed QA environment ● Browser smoke tests – currently selenium – Not using Django 1.4 LiveTestCase here, we have a full stack to play with ● Tag successful build as deployable
  • 32. Develop Commit Build Stage Deploy Measure Deployment Strategies ● Optimistic – Deploy, reload services – some appservers handle this well ● Blue/Green – Parallel environments, 1 idle – Idle environment gets new version – Smoke tests and monitoring before switching over ● Canary – Take subset of app servers out of pool – Deploy to subset – Smoke tests and monitoring before deploying rest of cluster ● Deploy whole new (app) server instance – then rewire load-balancer
  • 33. Develop Commit Build Stage Deploy Measure Deployment with Jenkins & Fabric Using Git tags – Set in Jenkins after successful staging run – Used by deploy in Fabric def pull(): with cd(env.site_dir): run('git fetch') latest_tag = run('git describe --tags --match "ci-passed-staging-*" origin/master', pty=False) run('git reset --hard refs/tags/%s' % latest_tag, pty=False)
  • 34. Develop Commit Build Stage Deploy Measure Tags set by build pipeline
  • 35. Develop Commit Build Stage Deploy Measure Deployment with Jenkins & Fabric Jenkins script: virtualenv -q /opt/virtualenvs/arribaa-jenkins source /opt/virtualenvs/arribaa-jenkins/bin/activate pip install -r requirements.txt pip install -r requirements-testing.txt cd $WORKSPACE/arribaa fab deploy
  • 36. Develop Commit Build Stage Deploy Measure Deployment with Jenkins & Fabric def deploy(): dbbackup() # django-dbbackup – to dropbox changes = pull() # git fetch, git describe, git log, git reset apply_puppet() # puppet apply … prod.pp update_requirements() # pip install -r requirements.txt clean_pyc() # django-extensions command syncdb() # and –migrate (South) collectstatic() reload_uwsgi() # reload app server restart_celeryd() # bounce task server run('git tag -f ci-deployed && git push –tags') # tag deployed version send_email(changes) # send notification
  • 37. Develop Commit Build Stage Deploy Measure Decoupling deployment and release ● Feature flags vs feature branches – Real time control with flags – Cleanup/maint needed for flags – Harder/slower to test different combinations in either case ● Good for testing ideas (on/off, A/B, power users, QA etc) ● Gargoyle – includes optional admin interface – selective criteria (%age of users, staff only, ...) ● Alternative: Django Waffle
  • 38. Develop Commit Build Stage Deploy Measure Measurement ● Eyes wide open – Track system and user behaviour ● Post-deployment – Error, performance and behaviour heuristics – Trend monitoring – Goal conversion rates
  • 39. Develop Commit Build Stage Deploy Measure Measurement
  • 40. Develop Commit Build Stage Deploy Measure Measurement - Munin
  • 41. Develop Commit Build Stage Deploy Measure
  • 42. Develop Commit Build Stage Deploy Measure Measurement ● django-statsd, statsd and graphite – page timing – counters http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/
  • 43. Rollback options ● Level of automation – Depends on risk aversion and complexity of environment – 12+ years of deployment, average 5 deployments per week, very very few actual rollbacks ● Engineer around it – lots of small changes → more likely to "roll-forward" – staged deployment → minimise harm ● Engineer for it – avoid backwards incompatible data migrations – tag deployments, keep previous versions handy
  • 44. Rollback options "My deployment rollback strategy is like a car with no reverse gear. You can still go backwards, but you have to get out and push. Knowing that makes you drive carefully." - Me
  • 45. Where to from here Have an existing app with some gaps? Think about what's slowing you down the most ● Suggested priorities – Automated tests (Django built-in) – Continuous integration (jenkins, django-jenkins) – Measure all the things (sentry, statsd + graphite, new relic) – Scripted database (South) – Scripted deployment (fabric) – Configuration management (puppet) – Virtualised development (Vagrant) – Test separation (test decorator, customise test runner) – Feature flags (gargoyle)
  • 46. Looking Forward ● Better version pinning ● Fully automated provisioning ● Better test separation and parallelisation ● Combined coverage results ● Reduce dependence on external services ● Make deployment more atomic ● Staged rollouts to cluster – canary deployment ● Make the "big red deploy button" big and red
  • 47. Resources ● Slides – http://slideshare.net/mindsocket/ ● Continuous delivery/deployment – Continuous Delivery Primer - http://www.informit.com/articles/article.aspx?p=1641923 – Anatomy of the Deployment Pipeline - http://www.informit.com/articles/printerfriendly.aspx?p=1621865 – Code as Craft – Etsy http://codeascraft.etsy.com/ – Safe deploying on the cutting edge – Urban Airship http://lanyrd.com/2011/djangocon-us/shbqz/ ● Vagrant – http://vagrantup.com ● Vagrant with Fabric - https://gist.github.com/1099132 ● Jenkins Build Pipeline Plugin - http://www.morethanseven.net/2011/03/20/A-continuous-deployment-example-setup.html ● Git/fabric based rollback options – http://dan.bravender.us/2012/5/11/git-based_fabric_deploys_are_awesome.html – http://www.askthepony.com/blog/2011/07/setup-a-complete-django-server-deploy-rollback-%E2%80%93-all-in-one- powerful-script/ – http://lethain.com/deploying-django-with-fabric/