Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Continious deployment at Flipkart

Continious deployment at Flipkart

Pankaj Kaushal

April 11, 2012
Tweet

More Decks by Pankaj Kaushal

Other Decks in Technology

Transcript

  1. 1 | Internal use only Continuous deployment at flipkart Pankaj

    Kaushal Photo credit: http://www.flickr.com/photos/bomb_tea/
  2. 2 | Internal use only Old school deployment Check out

    svn Point docroot to new svn Place copies on all servers One server at a time Check if it works
  3. 6 | Internal use only Deployments Module X is no

    longer working. Foostat widget is now displaying php instead of rendering html. All images are gone Blah blah tab shows sometimes and disappears sometimes I get blank screens I'm sure I deployed on all four servers Forgot to restart foo backend service If anything can go wrong, it will.
  4. 7 | Internal use only Discourage deployments in the interest

    of stability? or Allow deployments to happen as fast as they need to?
  5. 10 | Internal use only Flipkart deployment procedure Step1: svn

    copy -m “deploying to prod” trunk/ prod/2011-07-08-10:00/ Step2: there is no Step 2
  6. 13 | Internal use only 1. Continuous integration integrate frequently

    against a controlled source code repository Multiple integrations per day
  7. 15 | Internal use only 2. Multiple Environments Integration environments

    are replicas of production All components of the system are available Duplicate the production environment as much as you can
  8. 21 | Internal use only Continuous integration Is not a

    tool, neither is it the result of a tool It's a philosophy
  9. 22 | Internal use only You don't need lots of

    money or fancy tools We use a bunch of shell scripts to do this
  10. 27 | Internal use only Building with Continuous Integration Step1:

    check out trunk/mainline Step 2: build feature/ fix bug Step 3: Commit to mainline/trunk Step 4: Commit to eng/ Integration environment builds automatically
  11. 30 | Internal use only Integration Environments We have two

    integration environments ENG (Engineering) SB (Sandbox) Each with it's own svn branch ENG is on virtual machines
  12. 31 | Internal use only Each environment acts as a

    monitor to the repository Every time there is a commit against the repository Build server automatically checks out the sources initiates a build notifies the committer of the result of the build
  13. 34 | Internal use only @flipkart apt-get install whatever We

    leverage the debian package mangaer All software is installed using apt-get
  14. 35 | Internal use only @flipkart apt-get install whatever Automated

    builds make .deb .deb pushed to a repository (flipkart repo)
  15. 36 | Internal use only @flipkart apt-get install whatever Software

    dependencies Version information Allows rollbacks and prevents software mismatches
  16. 39 | Internal use only Continuous integration Integration Environments Package

    management Configuration Automated Builds and Deployments
  17. 40 | Internal use only Where is the booboo file?

    Many things together build a product Everything should be in the repository Source Code, Configuration, Database schemas
  18. 41 | Internal use only Can't find booboo Put everything

    in the repository not just code Everything you need to do a build should be in there test scripts properties files database schema install scripts third party libraries
  19. 45 | Internal use only Automated Builds Turning source code

    to a running system is complicated Typing strange commands is a waste of time
  20. 46 | Internal use only Automated deployments Multiple environments One

    to run commit tests (eng) One or more to run secondary tests (sandbox) Production Scripts that allow you to deploy the application into any environment easily Deployment procedure is the same everywhere
  21. 47 | Internal use only @flipkart fk-ops-build One Package that

    Has a config to describe environments Contains Build scripts for all packages for all env Monitors the svn tree for changes Build new packages automatically (or manually) Deploys new packages automatically (or manually)
  22. 49 | Internal use only Continuous Deployment Changes trickle down

    environments automatically Builds succeed in all test environments Elaborate test cases Automatically hit production
  23. 50 | Internal use only experiments Some teams use automated

    deployments till Sandbox Some teams use Teamcity to do integrated builds on every commit We can do continuous deployments till prod but we do not practice it in every project
  24. 51 | Internal use only Way forward Much tighter integration

    with test cases Environments as Rings ENG to do unit tests Sandbox to do smoke tests Functional tests before push to production