shipping code sucks! ways to make it better€¦ · shipping code sucks! ways to make it better...

23
Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser

Upload: others

Post on 26-May-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

Shipping Code Sucks!Ways to Make it Better

Myles A. K. Steinhauser@masteinhauser

Page 2: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@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!

Page 3: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 3

Tools

● Chef– Puppet too!

● Vagrant– VirtualBox– VMware Fusion or Workstation

● Packer● Jenkins● Omnibus

Page 4: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@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

Page 5: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 5

Vagrant

● Consumes Vagrantfile– Defines

● VM Name● Network Interfaces● Box to use

● Written in Ruby– Distributed as Omnibus package

Page 6: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 6

Hypervisor

● VirtualBox– Open source, managed by Oracle

● VMware Fusion / Workstation– Closed

● Both used by Vagrant to run VMs

Page 7: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@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

Page 8: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@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

Page 9: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 9

Why all these Tools?

Page 10: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 10

This Buys us...

Stability

=

Scalability + Determinism

(Keep this concept in mind)

Page 11: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 11

This Buys Us...

● Developer Productivity● Less time setting up

– Developer Workstations– Lab Environment– “Works on My Machine!”– Debugging in the field

Page 12: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 12

Chef

● Recipes● Cookbooks

– Application Style

● Berkshelf● Environments● Chef Solo vs Chef Server

Page 13: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 13

Vagrant

● Downloads Boxes● Imports● Boots● Configures anything as needed● Keep in Git, “snapshot” environments

Page 14: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@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

Page 15: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@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

Page 16: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 16

Pets vs Cows

Something goes wrong with your:● Pet

– SSH in– Fix the problem manually

● Cows– Shoot it.

Page 17: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@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!

Page 18: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 18

Shipping to Customers

● With all of the previous– We have been treating our build pipeline and 

developers as...

CUSTOMERS

Page 19: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 19

Shipping to Customers

● We are now able to...– Downloadable VM Appliance

● VirtualBox● Vagrant● Xen● KVM

– EC2 image

Page 20: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 20

Shipping to Customers

● But we still cannot...– Incrementally upgrade

● Maybe!

Page 21: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 21

Omnibus

● “Easily create full­stack installers for your project across a variety of platforms.”

● Static Installation for Dynamic Dependencies– /opt/appname/deps

Page 22: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 22

Questions / Discussion

Shoot 'em at me!

Page 23: Shipping Code Sucks! Ways to Make it Better€¦ · Shipping Code Sucks! Ways to Make it Better Myles A. K. Steinhauser @masteinhauser. @masteinhauser 2 About Me ... – Helped build

@masteinhauser 23

Images● http://en.wikipedia.org/wiki/MV_Blue_Marlin