disband the deployment army - goto conference · releases large releases atmosphere of uncertainty...

60
DISBAND THE DEPLOYMENT ARMY Michael T. Nygard Relevance, Inc. www.thinkrelevance.com [email protected] @mtnygard © 2012 Michael T. Nygard, All Rights Reserved. Monday, May 21, 12

Upload: others

Post on 16-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

DISBAND THEDEPLOYMENT ARMY

Michael T. NygardRelevance, Inc.

www.thinkrelevance.com

[email protected] @mtnygard

© 2012 Michael T. Nygard, All Rights Reserved.

Monday, May 21, 12

Page 2: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Deployment Army

Monday, May 21, 12

Page 3: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Army Deployments(Hint: It’s An Antipattern)

InfrequentReleases

LargeReleases

Atmosphere of Uncertainty and

Risk

Ambiguous or Threatening Situations

Humans Adapt to Novel

SituationsDeployment

Army

High Cost of Deployment

D.A. Overcomes Obstacles

Monday, May 21, 12

Page 4: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

We want the benefits of agile development and continuous integration all the way to production.

Financial Success

Monday, May 21, 12

Page 5: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Financial Success

High Velocity /Short Cycles

More Deployments

We want the benefits of agile development and continuous integration all the way to production.

Monday, May 21, 12

Page 6: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

We must avoid financial losses due to downtime, bugs, noncompliance, and loss of reputation.Financial

Success

Monday, May 21, 12

Page 7: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Financial Success

Low Risk FewerDeployments

We must avoid financial losses due to downtime, bugs, noncompliance, and loss of reputation.

Monday, May 21, 12

Page 8: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Financial Success

Low Risk FewerDeployments

High Velocity /Short Cycles

More Deployments

Conflict

One goal.Two conflicting demands.

Monday, May 21, 12

Page 9: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Understanding Risk

Monday, May 21, 12

Page 10: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Understanding Risk

Expected losses fromundesirable events.

Monday, May 21, 12

Page 11: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Exposure

Annual Loss Expectancy (ALE)

Loss = Nevents × Perror × Cevent

Monday, May 21, 12

Page 12: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Exposure Example: Bug In Checkout

Perror Occurance 1 time in 108

Nevents Checkouts / Year 5.25 x 108

Cevent Average Lost Order €25

Loss Total losses per annum €131.40

Monday, May 21, 12

Page 13: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Categories Of Risk

Monday, May 21, 12

Page 14: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

1. Compliance Risk

2. Technical Risk

Categories Of Risk

Monday, May 21, 12

Page 15: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

1. Compliance Risk

2. Technical Risk

Categories Of Risk

Monday, May 21, 12

Page 16: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Compliance Risk

Certification

Regulatory approval

Third party testing

Commonly seen in:

Banking / finance

Health care

Aviation

Consumer Electronics

Monday, May 21, 12

Page 17: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Managing Compliance Risk

Deliver continuously to certification environment.

Rapidly detect noncompliant changes

Reduce time between validation cycles

Monday, May 21, 12

Page 18: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

1. Compliance Risk

2. Technical Risk

Categories Of Risk

Monday, May 21, 12

Page 19: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Managing Technical Risk

Monday, May 21, 12

Page 20: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Managing Technical Risk

Loss = Nevents × Perror × Cevent

Nevents will increase.

We can decrease Perror and Cevent.

Monday, May 21, 12

Page 21: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Reducing Risk Exposure

Batch Continuous

Nevents Low High

Perror High ?

Cevent High ?

Monday, May 21, 12

Page 22: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Sources Of Perror

Defects in code

Errors in assembly or packaging

Errors executing changes

Monday, May 21, 12

Page 23: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

accumulated risk

Monday, May 21, 12

Page 24: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

accumulated risk

accumulated risk

Monday, May 21, 12

Page 25: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Build Pipelines

Commit Build &Unit Test

Monday, May 21, 12

Page 26: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Build Pipelines

Commit Build &Unit Test

IntegrationTestQA Deploy

Staging Deploy

NFR TestProdDeploy

Monday, May 21, 12

Page 27: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Build Pipelines

Commit Build &Unit Test

IntegrationTestQA Deploy

Staging Deploy

NFR TestProdDeploy

Tag Repo

Tag RepoNotify Notify

NotifyNotify Tag Repo

Monday, May 21, 12

Page 28: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Reducing Build & Assembly Errors

Fast tests

Clean build servers from VCS

Clean build applications from VCS

Promote binaries, not sources

Deploy the same way everywhere

Monday, May 21, 12

Page 29: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Essential Practices

• Fast tests

• Never commit new work on a broken build

• Fail the build on slow tests

• Fail the build on violations: architecture, coding standards

• Involve Ops in creating deployment scripts

• Deploy from head of trunk

Monday, May 21, 12

Page 30: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Environment Requirements

• Package repository

• Tag the repo

• Logging

• Metrics

Monday, May 21, 12

Page 31: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Making Deployments Safe

Clean PoolDirty Pool

Load Balancer

CanaryReleasing

Monday, May 21, 12

Page 32: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Making Deployments Safe

Blue/GreenDeployments

Load Balancer

Green Environment Blue Environment

prod

PAF

Monday, May 21, 12

Page 33: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Load Balancer

Green Environment Blue Environment

prod

Making Deployments Safe

Blue/GreenDeployments

PAF

Monday, May 21, 12

Page 34: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Making Deployments Safe

All of these require zero downtime deployments.

Monday, May 21, 12

Page 35: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Zero Downtime Deployments

• Database migrations

• Schema shims

• Versioned identifiers for assets

• Protocol versioning

• Endpoint versioning

• Decoupled architecture

Monday, May 21, 12

Page 36: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Reducing Risk Exposure

Batch Continuous

Nevents Low High

Perror High Low

Cevent High ?

Monday, May 21, 12

Page 37: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Minimizing Cevent

1. Reduce time to detect (MTTD)

2. Reduce time to correct (MTTR)

3. Reduce scope of impact

These are all things that batched deployment does badly.

Monday, May 21, 12

Page 38: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Reduce Mean Time To Detection

Time to Detection

Confidence inValidity

Unit Tests

Integration Tests

UAT

Real Users

Monday, May 21, 12

Page 39: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Cult Of Charts

Mike Brittain, “Tracking Every Release”http://codeascraft.etsy.com/2010/12/08/track-every-release/

Monday, May 21, 12

Page 40: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Cult Of Charts

Ian Mapless, “Measure Anything, Measure Everything”http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/

Monday, May 21, 12

Page 41: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Charting EverythingServers

BespokeApplication

OS

Containers

Statsd

Graphite

InternalMonitoring

SystemMetrics

BusinessMetrics

DemandMetrics

Errors &Events

Wall-mountedDisplays

Dev & Ops Staff'sBrowsers

Product Owner'sBrowsers

DeploymentTools

ChangeEvents

External

Probes

Statsd

Monday, May 21, 12

Page 42: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Minimizing Cevent

1. Reduce time to detect (MTTD)

2. Reduce time to correct (MTTR)

3. Reduce scope of impact

Monday, May 21, 12

Page 43: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Factors In MTTR

1. Determine the problem

2. Fix the problem

3. Deploy the fix

Monday, May 21, 12

Page 44: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Minimizing Cevent

1. Reduce time to detect (MTTD)

2. Reduce time to correct (MTTR)

3. Reduce scope of impact

Monday, May 21, 12

Page 45: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Scope Of ImpactHow many users are exposed to the error?

Split testing

Dark launch

Feature flags

Remote control

Monday, May 21, 12

Page 46: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Scope Of ImpactHow far can the error propagate in the system?

Decoupled architecture

Bulkheads

Circuit breakers

Monday, May 21, 12

Page 47: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

one_big_app_3.2-SNAPSHOT.jar

Catalog

Cart/Checkout Search

User Account

RecommendationsOrderManagement

App1 AppN...

Load Balancer

Doomed.

Monday, May 21, 12

Page 48: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

one_big_app_3.2-SNAPSHOT.jar

Catalog

Cart/Checkout Search

User Account

RecommendationsOrderManagement

App1 AppN...

Load Balancer

one_big_app_3.3.jar

Catalog

Cart/Checkout Search

User Account

RecommendationsOrderManagement

CanaryPool1 CanaryPool2 Better.

Monday, May 21, 12

Page 49: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Good!catalog1 catalogN

Load Balancer

checkout-ui-7.8.1.jar

Cart/CheckoutPresentation

cart1 cartN

catalog-3.3.jar

Catalog

Search

account-1.15.7.jar

User Account

Recommendations

OrderManagement

checkout-service-7.8.2.jar

Cart/Checkoutservice

Circuit breaker

... account1 accountN account-canary1

account-1.16-SNAPSHOT.jar

User Account

Recommendations

OrderManagement

Monday, May 21, 12

Page 50: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Reducing Risk Exposure

Batch Continuous

Nevents Low High

Perror High Low

Cevent High Low

Monday, May 21, 12

Page 51: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Unsolved Problems

Monday, May 21, 12

Page 52: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Unsolved Problems

•Managing library dependencies.

•Managing service & protocol dependencies.

•Interfacing with ITIL processes.

Monday, May 21, 12

Page 53: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Questions To Think About

Monday, May 21, 12

Page 54: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

If you could rebuild whole environments over a coffee break,

how would your processes change?

Questions To Think About

Monday, May 21, 12

Page 55: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

What's the smallest incremental change you could make toward CD?

Questions To Think About

Monday, May 21, 12

Page 56: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

What could you automate that you're doing manually today?

Questions To Think About

Monday, May 21, 12

Page 57: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

What monitors could add to improve your visibility?

Questions To Think About

Monday, May 21, 12

Page 58: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

What could you do to remove organizational barriers that prevent

you from doing CD today?

Questions To Think About

Monday, May 21, 12

Page 59: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

DISBAND THEDEPLOYMENT ARMY

© 2012 Michael T. Nygard, All Rights Reserved.

Michael T. NygardRelevance, Inc.

www.thinkrelevance.com

[email protected] @mtnygard

Monday, May 21, 12

Page 60: DISBAND THE DEPLOYMENT ARMY - GOTO Conference · Releases Large Releases Atmosphere of Uncertainty and Risk Ambiguous or Threatening Situations Humans Adapt ... Canary Releasing Monday,

Monday, May 21, 12