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

Deploying distributed software services to the ...

Deploying distributed software services to the cloud without breaking a sweat

From CodePaLOUsa 2011.

Susan Potter

March 03, 2011
Tweet

More Decks by Susan Potter

Other Decks in Programming

Transcript

  1. # finger $(whoami) Login: susan Name: Susan Potter Directory: /home/susan

    Shell: /bin/zsh On since Mon 29 Sep 1997 21:18 (GMT) on tty1 from :0 No mail on [email protected] Plan: twitter: @SusanPotter github: mbbx6spp
  2. # finger $(whoami) Login: susan Name: Susan Potter Directory: /home/susan

    Shell: /bin/zsh On since Mon 29 Sep 1997 21:18 (GMT) on tty1 from :0 No mail on [email protected] Plan: twitter: @SusanPotter github: mbbx6spp
  3. # finger $(whoami) Login: susan Name: Susan Potter Directory: /home/susan

    Shell: /bin/zsh On since Mon 29 Sep 1997 21:18 (GMT) on tty1 from :0 No mail on [email protected] Plan: twitter: @SusanPotter github: mbbx6spp
  4. # finger $(whoami) Login: susan Name: Susan Potter Directory: /home/susan

    Shell: /bin/zsh On since Mon 29 Sep 1997 21:18 (GMT) on tty1 from :0 No mail on [email protected] Plan: twitter: @SusanPotter github: mbbx6spp
  5. # finger $(whoami) Login: susan Name: Susan Potter Directory: /home/susan

    Shell: /bin/zsh On since Mon 29 Sep 1997 21:18 (GMT) on tty1 from :0 No mail on [email protected] Plan: twitter: @SusanPotter github: mbbx6spp
  6. Scope of Talk • Approaches • Best Practices • Pitfalls

    • Possibilities • (not) Chef vs Puppet
  7. Scope of Talk • Approaches • Best Practices • Pitfalls

    • Possibilities • (not) Chef vs Puppet • (not) Why Cloud?
  8. Scope of Talk • Approaches • Best Practices • Pitfalls

    • Possibilities • (not) Chef vs Puppet • (not) Why Cloud? • (not) Why DevOps?
  9. Scope of Talk • Approaches • Best Practices • Pitfalls

    • Possibilities • (not) Chef vs Puppet • (not) Why Cloud? • (not) Why DevOps? • (not) Which Delivery Model?
  10. Scope of Talk • Approaches • Best Practices • Pitfalls

    • Possibilities • (not) Chef vs Puppet • (not) Why Cloud? • (not) Why DevOps? • (not) Which Delivery Model? • (not) Release Management
  11. Scope of Talk • Approaches • Best Practices • Pitfalls

    • Possibilities • (not) Chef vs Puppet • (not) Why Cloud? • (not) Why DevOps? • (not) Which Delivery Model? • (not) Release Management • (not) Monitoring
  12. Cloud: Characteristics • Instant on-demand • Managed by others •

    Virtualized performance, reliability • Lack control predictability, reliability, quality
  13. Cloud: Characteristics • Instant on-demand • Managed by others •

    Pay as you go • Virtualized performance, reliability • Lack control predictability, reliability, quality
  14. Cloud: Characteristics • Instant on-demand • Managed by others •

    Pay as you go • Virtualized performance, reliability • Lack control predictability, reliability, quality • Pay as you go!
  15. DevOps: Definition [1/2] • Share responsibility across organizational boundaries •

    Invest in people by reducing finger pointing [togetherness] and human error [automation]
  16. DevOps: Definition [1/2] • Share responsibility across organizational boundaries •

    Invest in people by reducing finger pointing [togetherness] and human error [automation] • Manage infrastructure not priority queues of production issues
  17. DevOps: Definition [1/2] • Share responsibility across organizational boundaries •

    Invest in people by reducing finger pointing [togetherness] and human error [automation] • Manage infrastructure not priority queues of production issues • Make infrastructure predictable repeatable, testable, deterministic
  18. Deployment Pipeline: Prerequisites • Design for cloud e.g. decentralized, layered,

    parallelized, collaborating single purpose services, async I/O
  19. Deployment Pipeline: Prerequisites • Design for cloud e.g. decentralized, layered,

    parallelized, collaborating single purpose services, async I/O • Always-ready codebase buildable, testable, deployable
  20. Deployment Pipeline: Prerequisites • Design for cloud e.g. decentralized, layered,

    parallelized, collaborating single purpose services, async I/O • Always-ready codebase buildable, testable, deployable • Managed infrastructure read: SCM and consistent distribution to target nodes
  21. Deployment Pipeline: Prerequisites • Design for cloud e.g. decentralized, layered,

    parallelized, collaborating single purpose services, async I/O • Always-ready codebase buildable, testable, deployable • Managed infrastructure read: SCM and consistent distribution to target nodes • Expect [system] failure handle failures sensibly, policies for timeouts, etc
  22. Deployment Pipeline: Prerequisites • Design for cloud e.g. decentralized, layered,

    parallelized, collaborating single purpose services, async I/O • Always-ready codebase buildable, testable, deployable • Managed infrastructure read: SCM and consistent distribution to target nodes • Expect [system] failure handle failures sensibly, policies for timeouts, etc • Test early and often! outside-in development helps
  23. Deployment Pipeline: Prerequisites • Design for cloud e.g. decentralized, layered,

    parallelized, collaborating single purpose services, async I/O • Always-ready codebase buildable, testable, deployable • Managed infrastructure read: SCM and consistent distribution to target nodes • Expect [system] failure handle failures sensibly, policies for timeouts, etc • Test early and often! outside-in development helps • Build from the ground up layer infrastructure, inject configuration at boot/load time
  24. Deployment: Common Bottlenecks • Automation build, provision, configure, integrate •

    Distribution binaries, assets, configuration Figure: http://www.flickr.com/people/laenulfean/
  25. Deployment: Common Bottlenecks • Automation build, provision, configure, integrate •

    Distribution binaries, assets, configuration • Timeframe restricted window of time Figure: http://www.flickr.com/people/laenulfean/
  26. Deployment: Common Bottlenecks • Automation build, provision, configure, integrate •

    Distribution binaries, assets, configuration • Timeframe restricted window of time • Data schema updates, data migrations Figure: http://www.flickr.com/people/laenulfean/
  27. Automation Approaches Figure: http://www.flickr.com/people/krazydad/ • Full stack server-driven e.g. Chef/Knife,

    Puppet Master • Full stack client e.g. Chef Solo • Application-tier client e.g. Capistrano, Vlad the Deployer
  28. Automation Approaches Figure: http://www.flickr.com/people/krazydad/ • Full stack server-driven e.g. Chef/Knife,

    Puppet Master • Full stack client e.g. Chef Solo • Application-tier client e.g. Capistrano, Vlad the Deployer • Command & control e.g. Vertibrae (inactive), Nanite
  29. Distribution Approaches Figure: http://www.flickr.com/people/nsalt • Shared filesystem less security and

    reliability in community/public or across zones/regions • Pull from source control higher time variance as target nodes increase
  30. Distribution Approaches Figure: http://www.flickr.com/people/nsalt • Shared filesystem less security and

    reliability in community/public or across zones/regions • Pull from source control higher time variance as target nodes increase • Bittorrent or similar e.g. Twitter’s Murder
  31. Timeframe Approaches Figure: http://www.flickr.com/people/athenicsword • Hot upgrades e.g. Erlang/OTP appup/code_change/3

    • Rolling upgrades Software design considerations • Environment replacement Flip a switch, acceptance <-> production
  32. Data Approaches Figure: http://www.flickr.com/people/shanghaidaddy • Scriptable schema Alternative: NoSQL, but.

    . . • Automated migrations e.g. Rails’ Migrations • Sanity checks e.g. cherry picked, consistency checks
  33. Live by the meter. Die by the meter. [Workarounds] Figure:

    http://www.flickr.com/people/dirkjankraan/
  34. Possibilities • Dynamic resource allocation allocate based on load, time

    of day, day of week/month • Canary deployments (e.g. A/B testing)
  35. Possibilities • Dynamic resource allocation allocate based on load, time

    of day, day of week/month • Canary deployments (e.g. A/B testing) • Multi-region or multi-provider relocate based on time of day, failover