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

Shipping Code Sucks, Ways to Make it Better

Shipping Code Sucks, Ways to Make it Better

We all know how bad a deployment can be, so what can we do to avoid the horror and increase our confidence?

Myles Steinhauser

November 02, 2013
Tweet

More Decks by Myles Steinhauser

Other Decks in Programming

Transcript

  1. @masteinhauser 2 About Me • Really, hardly anyone ever cares

    but if you insist... • Worked at Applied Data Consultants – Helped build a stable and reliable Real­Time Routing and Tracking SaaS – Dev and Ops, eventually shifted to Ops to help entire Company • Now at Stratus Technologies in Maynard, MA (Boston) – I am helping build an automated Disaster Recovery system for Fault­Tolerant and Highly­Available Vms – Automated Deployment of Dev/Prod environment to workstations, build pipeline and final QA team • Linux knowledge and do not know Windows well. Sorry! Onward!
  2. @masteinhauser 3 Tools • Chef – Puppet too! • Vagrant

    – VirtualBox – VMware Fusion or Workstation • Packer • Jenkins • Omnibus
  3. @masteinhauser 4 Let's talk about Chef, baby • Configuration Management

    – Installed Packaged – Their Configurations – 'Usable Documentation' • Write once, deploy (and debug) everywhere • System 'version' stored in Git, etc. • Automated Testing before deployment • Helps create Deterministic environments
  4. @masteinhauser 5 Vagrant • Consumes Vagrantfile – Defines • VM

    Name • Network Interfaces • Box to use • Written in Ruby – Distributed as Omnibus package
  5. @masteinhauser 6 Hypervisor • VirtualBox – Open source, managed by

    Oracle • VMware Fusion / Workstation – Closed • Both used by Vagrant to run VMs
  6. @masteinhauser 7 Packer • Consumes JSON template file • Installs

    OS – RHEL Family (CentOS, Fedora) • Kickstart – Ubuntu/Debian • Preseed • Builds VMs – Can build for AWS, VirtualBox, Vmware, Xen
  7. @masteinhauser 8 Jenkins • Continuous Integration – Per commit build

    execution – Run all Unit Tests – Artifact Builds and Storage • Continuous Deployment – Integration Tests – System Tests (hardware failures, etc) – Performance Tests
  8. @masteinhauser 11 This Buys Us... • Developer Productivity • Less

    time setting up – Developer Workstations – Lab Environment – “Works on My Machine!” – Debugging in the field
  9. @masteinhauser 12 Chef • Recipes • Cookbooks – Application Style

    • Berkshelf • Environments • Chef Solo vs Chef Server
  10. @masteinhauser 13 Vagrant • Downloads Boxes • Imports • Boots

    • Configures anything as needed • Keep in Git, “snapshot” environments
  11. @masteinhauser 14 Packer • Builders – Create a Machine on

    a Single Platform • Provisioners – Install and configure software within a running machine before exporting into 'golden image' • Post­Processors – Take the artifact of the above and create a new artifact
  12. @masteinhauser 15 Pets vs Cows • Originally coined by Randy

    Bias – If you are “into Cloud” you should follow him • Pets – brandon – Lindsay • Cattle – web01 – db006
  13. @masteinhauser 16 Pets vs Cows Something goes wrong with your:

    • Pet – SSH in – Fix the problem manually • Cows – Shoot it.
  14. @masteinhauser 17 What this buys us... • Stability – Scalability

    • Bring up new machines at any time • Immutable Infrastructure – This is great on cloud platforms! – Determinism • All machines and templates have been pre­tested • Failure modes are known beforehand – If not, add a test!
  15. @masteinhauser 18 Shipping to Customers • With all of the

    previous – We have been treating our build pipeline and developers as... CUSTOMERS
  16. @masteinhauser 19 Shipping to Customers • We are now able

    to... – Downloadable VM Appliance • VirtualBox • Vagrant • Xen • KVM – EC2 image
  17. @masteinhauser 21 Omnibus • “Easily create full­stack installers for your

    project across a variety of platforms.” • Static Installation for Dynamic Dependencies – /opt/appname/deps