107
The Continuous Delivery Value 12 - 04 - 2014 ROME 11-12 April 2014 David Funaro Crash dei sistemi, Migrazioni fallite, aggiornamenti interrotti: sono tutte problematiche che nessuno vorrebbe mai incontrare durante l'introduzione di nuove funzionalità nel proprio applicativo (deploy) e ... la speranza non basta. L'attività di deploy è importante tanto quanto quelle che la precedono. La Continuous Delivery è un insieme di strumenti e metodologie che permetteranno di rendere i rilasci a basso rischio, economici, veloci, predicibili e ... sonni tranquilli. [email protected]

The Continuous delivery value - Funaro

Embed Size (px)

DESCRIPTION

Slides from David Funaro talk @ codemotion roma 2014

Citation preview

Page 1: The Continuous delivery value - Funaro

The Continuous Delivery Value

12 - 04 - 2014

ROME 11-12 April 2014

David Funaro

Crash dei sistemi, Migrazioni fallite, aggiornamenti interrotti: sono tutte problematiche che nessuno vorrebbe mai incontrare durante l'introduzione di nuove funzionalità nel proprio applicativo (deploy) e ... la speranza non basta. L'attività di deploy è importante tanto quanto quelle che la precedono. La Continuous Delivery è un insieme di strumenti e metodologie che permetteranno di rendere i rilasci a basso rischio, economici, veloci, predicibili e ... sonni tranquilli.

[email protected]

Page 2: The Continuous delivery value - Funaro

The Continuous Delivery

Value

12 - 04 - 2014

Page 3: The Continuous delivery value - Funaro

David Funaro

@ingdavidino

davidfunaro.com

Page 4: The Continuous delivery value - Funaro

First Release

Page 5: The Continuous delivery value - Funaro

Release Day

Page 6: The Continuous delivery value - Funaro

WRONG WAY

This talk is for you…

Page 7: The Continuous delivery value - Funaro

Overview

Page 8: The Continuous delivery value - Funaro

Facts

keep system up and running

release new features as soon as possible

IT Business

Page 9: The Continuous delivery value - Funaro

… with CD

ITBu

sine

ss

Page 10: The Continuous delivery value - Funaro

RELEASE

FEEDBACK

new features monetize bug

performance layout

Page 11: The Continuous delivery value - Funaro

RELEASE

? Miss Release Price ?

Page 12: The Continuous delivery value - Funaro

Reaction MetricsC

hang

e

REL

EASE

Time

Security

Skills

Cost

Predictable

Stress

Repeatability

Page 13: The Continuous delivery value - Funaro

• How many time you need to release software

Time

Page 14: The Continuous delivery value - Funaro

• Everything will be ok ?

• Can i be sure that every needed step will be done ?

• Exceptions, are managed ?

• Data migration goes well ?

• Can i go back (rollback) ?

Security

Page 15: The Continuous delivery value - Funaro

• Have, the selected person, all the skill needed to terminate the procedure ?

• What about his behavior in some exception flow case

Skills

Page 16: The Continuous delivery value - Funaro

• How many people you need ?

• For how many time ?

• Other Resources ?

Cost

Page 17: The Continuous delivery value - Funaro

• are you able to indicate how much time will care ?

Predictable

Page 18: The Continuous delivery value - Funaro

• What about the stress

• stress => error-prone

Stress

Page 19: The Continuous delivery value - Funaro

• Just finish a deploy. Software released. A bug is found. You have to re-start the deploy procedure

Repeatability

Page 20: The Continuous delivery value - Funaro

Reaction Metrics

REL

EASE

Production

Testing

Staging

Time

Security

Skills

Cost

Predictable

Stress

Repeatability

Page 21: The Continuous delivery value - Funaro

No Automation Process ?

Page 22: The Continuous delivery value - Funaro

Lots of things to consider

• Code evolution

• Code dependency management

• System evolution management

• Data management and architecture

• Component management

Page 23: The Continuous delivery value - Funaro

Software Release

• Low Risk

• Cheap

• Frequent

• Rapid

• Predictable

... should be

Continuous Delivery

Page 24: The Continuous delivery value - Funaro

CD requirements

• Source Code Management

• Continuous Integration Server

• Automated Deploy

• Real Time Alerting

• Root Cause Analysis

Page 25: The Continuous delivery value - Funaro

CD FLOW

Commit /pushAutomated

Testing

FAIL

SUCCESS Automated Deploy

Procedure

notify

Basic Scenario

Page 26: The Continuous delivery value - Funaro
Page 27: The Continuous delivery value - Funaro

Deploy Pipeline

Commit StageCompile UnitTest Analysis

Build Installers

ReleaseAutomated acceptance

testign

Automated capacity testing

Manual TestingShowcasesExplorarory

testing

example

Page 28: The Continuous delivery value - Funaro

ContinuousDelivery

Tools

MethodologiesPractices

Cautions

Page 29: The Continuous delivery value - Funaro

Anti-patterns

• Deploy software manually

• Manual Configuration

• Deploy to a production-like Env Only after development is complete

Page 30: The Continuous delivery value - Funaro

Benefits

• Empower Team

• Reducing Errors

• Lowering Stress

• Deployment Flexibility

• Practice Make Perfect

Page 31: The Continuous delivery value - Funaro

Keep Everything in version control

Automate Almost Everything

Principles

If it hurts, do i more frequently

Done means released

Build quality in

Page 32: The Continuous delivery value - Funaro

SECTION ISource Code Management

Page 33: The Continuous delivery value - Funaro

i sent you a mail with the last change

... are you shure ?

i can’t find the new file ?!?

The problem

Page 34: The Continuous delivery value - Funaro
Page 35: The Continuous delivery value - Funaro

SCM : What is it ?

3

57

10

Repository

Page 36: The Continuous delivery value - Funaro

Local

Check-out

Pull

8

29

Page 37: The Continuous delivery value - Funaro

Check-in

Push

Local

3 4

Page 38: The Continuous delivery value - Funaro

SCM : What it does ?

• Keeping multiple file version

• Collaboration

Page 39: The Continuous delivery value - Funaro

CHECK POINT

Page 40: The Continuous delivery value - Funaro

Application Evolution

Page 41: The Continuous delivery value - Funaro

Collaboration

Page 42: The Continuous delivery value - Funaro

isn’t just for source code

Cautions

you need everything required to re-create your application’s binaries and the environments in

which they run.

Page 43: The Continuous delivery value - Funaro

Best Practice

• Little Commit

• Frequent Commit

• Consistent commit

• User Meaningful Commit message

Page 44: The Continuous delivery value - Funaro

Different Products

Page 45: The Continuous delivery value - Funaro

SECTION IIContinuous Integration

Page 46: The Continuous delivery value - Funaro

After your commit nothing works anymore

Ops

INTEGRATION PROBLEM

(after one commit )

After your commit nothing works anymore

But ... “was working on my computer”

Page 47: The Continuous delivery value - Funaro

Ops (after deploy in prod)

INTEGRATION PROBLEM

It was working on the stage environment !!!

Page 48: The Continuous delivery value - Funaro

sleepless nights before demo ... bug just after release

Page 49: The Continuous delivery value - Funaro

Cos

t

Analysis Design Implementation Testing Release

Resolve defects

Page 50: The Continuous delivery value - Funaro

t

integration

Regression

Working

Broken

Effort

Page 51: The Continuous delivery value - Funaro

In software development the components integration need to be tested continuosly...

!

in order to find inconsistenciesas soon as possible

Good Solution

Page 52: The Continuous delivery value - Funaro

Continuous Integration

Page 53: The Continuous delivery value - Funaro

Cont inuous In tegrat ion i s a so f tware development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day.

Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible.

Martin Fowler

Page 54: The Continuous delivery value - Funaro

Requirements

Source Code Management

Page 55: The Continuous delivery value - Funaro

Requirements

Page 56: The Continuous delivery value - Funaro

Agile-Testing-Quadrants

Page 57: The Continuous delivery value - Funaro

F

F

F

F

F

FF

F

Checkout last Commit

CI Flow

Build and Tests Process

Page 58: The Continuous delivery value - Funaro

Build & Test

✓ Process creating executable code

✓Unit test

✓Quality criteria

✓ Functional Test

✓Non Functional Test

Valid Syntax Compile

Code behavior

Code coverage, Mass detector

Business Acceptance Criteria

Application performance

PASS

Page 59: The Continuous delivery value - Funaro

CI - Reduce Risk

• Say goodbye to long and tense integrations

• Increase visibility which enables greater communication

• Catch issues fast and nip them in the bud

• Spend less time debugging and more time adding features

• Proceed in the confidence you’re building on a solid foundation

• Stop waiting to find out if your code’s going to work

• Reduce integration problems allowing you to deliver software more rapidly

Page 60: The Continuous delivery value - Funaro

CI - Output

System Status Documentation/Artifacts Quality Check

Page 61: The Continuous delivery value - Funaro

“Continuous Integration doesn’t get rid of bugs, but it does make them dramatically easier to find and

remove.”

Martin Fowler

Page 62: The Continuous delivery value - Funaro

Ci - Best practice

• CI server === Production Server

• Integrate it from the first commit

• Find best way to get notified

Page 63: The Continuous delivery value - Funaro

Immediate feedback on the health of the system

Page 64: The Continuous delivery value - Funaro
Page 65: The Continuous delivery value - Funaro

Ci - software

... more and more

Page 66: The Continuous delivery value - Funaro

SECTION IIIAutomated Deploy

Page 67: The Continuous delivery value - Funaro

Deployment

“is all the activities that make a software system available for use”

Wikipedia

Page 68: The Continuous delivery value - Funaro

A Critical part of the application life-cycle

Deployment

Page 69: The Continuous delivery value - Funaro

RELEASE

Real ?

RELEASERELEASERELEASERELEASERELEASERELEASERELEASERELEASERELEASERELEASERELEASEfeedback

Page 70: The Continuous delivery value - Funaro

Deployment

• Low Risk

• Cheap

• Frequent

• Rapid

• Predictable

Page 71: The Continuous delivery value - Funaro

Low Risk

• Exception catched

• Rollback

• Data on secure

Page 72: The Continuous delivery value - Funaro

Cheap

• no more than one click

• no more than one person

• no skilled person

Page 73: The Continuous delivery value - Funaro

Frequent

• to get feedback

Page 74: The Continuous delivery value - Funaro

Rapid

Page 75: The Continuous delivery value - Funaro

Predictable

Page 76: The Continuous delivery value - Funaro

Incomplete ways

Page 77: The Continuous delivery value - Funaro

is that a deploy procedure ?

$ git pull origin master

$ svn update

Remote Desktop Versioning update

Page 78: The Continuous delivery value - Funaro

• Incomplete

• Manual procedure

• Slow

• Server Downtime

• No data migration

• No Rollback

Problems

Page 79: The Continuous delivery value - Funaro

Automated Deployment Goals

Page 80: The Continuous delivery value - Funaro

one click deploy

Deploy

Automated Deployment Goals

Page 81: The Continuous delivery value - Funaro

AnyTime AnyWhere AnyOne

Automated Deployment Goals

Page 82: The Continuous delivery value - Funaro

Rollback

Automated Deployment Goals

Page 83: The Continuous delivery value - Funaro

no downtime

Automated Deployment Goals

Page 84: The Continuous delivery value - Funaro

Scalable

Frontend 1 Frontend 1I Frontend III

Balancer

Automated Deployment Goals

Page 85: The Continuous delivery value - Funaro

Deployment Elements

• Executable Code

• Dependency Management

• Software configuration

• Infrastructure Management

• Data Migrations

• Manage Cache

• Manage Assets

Page 86: The Continuous delivery value - Funaro

Executable code (SCM)

Page 87: The Continuous delivery value - Funaro

Dependency Management

Page 88: The Continuous delivery value - Funaro

How you keep updated your libraries dependencies ?

to get the feature 103 done, i use library XXX

ok, i’ll note it here ...

to get the feature 103 done, i use library XXX

OK

Page 89: The Continuous delivery value - Funaro

PIP

Page 90: The Continuous delivery value - Funaro
Page 91: The Continuous delivery value - Funaro

Data Migration

Page 92: The Continuous delivery value - Funaro

What if, after your first production deployment, you have to change the Entity Relationship ?

Page 93: The Continuous delivery value - Funaro
Page 94: The Continuous delivery value - Funaro

Infrastructure Management

Page 95: The Continuous delivery value - Funaro

How you keep updated your OS componets/libraries ?

to get the feature 103 done, i use library XXX, that require

the module 288

ok, i’ll note it here ...

to get the feature 103 done, i use library XXX, that require

the module 903OK

Page 96: The Continuous delivery value - Funaro

A way to setup your environment

Page 97: The Continuous delivery value - Funaro

Write Configuration

Script

Versionable

Page 98: The Continuous delivery value - Funaro

Environment Management

Page 99: The Continuous delivery value - Funaro

Production TestingStaging

Page 100: The Continuous delivery value - Funaro

Manual - Follow recipe

• Integrity problems

• Problem with exception handling

• Basic Skills requirements

• Time consuming - expensive

• Error - prone

• Stress

Page 101: The Continuous delivery value - Funaro

Build a custom Script• Do a backup

• Create new directory

• Update the code

• Update dependencies

• Run migration data

• Update Environements

• Warm up cache

• ...

Page 102: The Continuous delivery value - Funaro
Page 103: The Continuous delivery value - Funaro

Existing Tools

Fabric

... and more others

Page 104: The Continuous delivery value - Funaro

Build quality in

Done means released

If it hurts, do i more frequently

Automate Almost Everything

Keep Everything in version control

Page 105: The Continuous delivery value - Funaro
Page 106: The Continuous delivery value - Funaro

David Funaro

@ingdavidinodavidfunaro.com

Thanks

Page 107: The Continuous delivery value - Funaro