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 @ codemotion 2014

Embed Size (px)

DESCRIPTION

System Crash, failure data migration, partial update: issues that no one would ever want to meet during the deploy and ... hoping for the best is not enough. The deployment activity is important as those that precede it. The Continuous Delivery will give you low risk, cheap, fast, predictable delivery and ... soundly.

Citation preview

Page 1: The Continuous delivery Value @ codemotion 2014

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 @ codemotion 2014

The Continuous Delivery

Value

12 - 04 - 2014

Page 3: The Continuous delivery Value @ codemotion 2014

David Funaro

@ingdavidino

davidfunaro.com

Page 4: The Continuous delivery Value @ codemotion 2014

First Release

Page 5: The Continuous delivery Value @ codemotion 2014

Release Day

Page 6: The Continuous delivery Value @ codemotion 2014

WRONG WAY

This talk is for you…

Page 7: The Continuous delivery Value @ codemotion 2014

Overview

Page 8: The Continuous delivery Value @ codemotion 2014

Facts

keep system up and running

release new features as soon as possible

IT Business

Page 9: The Continuous delivery Value @ codemotion 2014

… with CD

ITBu

sine

ss

Page 10: The Continuous delivery Value @ codemotion 2014

RELEASE

FEEDBACK

new features monetize bug

performance layout

Page 11: The Continuous delivery Value @ codemotion 2014

RELEASE

? Miss Release Price ?

Page 12: The Continuous delivery Value @ codemotion 2014

Reaction MetricsC

hang

e

REL

EASE

Time

Security

Skills

Cost

Predictable

Stress

Repeatability

Page 13: The Continuous delivery Value @ codemotion 2014

• How many time you need to release software

Time

Page 14: The Continuous delivery Value @ codemotion 2014

• 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 @ codemotion 2014

• 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 @ codemotion 2014

• How many people you need ?

• For how many time ?

• Other Resources ?

Cost

Page 17: The Continuous delivery Value @ codemotion 2014

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

Predictable

Page 18: The Continuous delivery Value @ codemotion 2014

• What about the stress

• stress => error-prone

Stress

Page 19: The Continuous delivery Value @ codemotion 2014

• 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 @ codemotion 2014

Reaction Metrics

REL

EASE

Production

Testing

Staging

Time

Security

Skills

Cost

Predictable

Stress

Repeatability

Page 21: The Continuous delivery Value @ codemotion 2014

No Automation Process ?

Page 22: The Continuous delivery Value @ codemotion 2014

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 @ codemotion 2014

Software Release

• Low Risk

• Cheap

• Frequent

• Rapid

• Predictable

... should be

Continuous Delivery

Page 24: The Continuous delivery Value @ codemotion 2014

CD requirements

• Source Code Management

• Continuous Integration Server

• Automated Deploy

• Real Time Alerting

• Root Cause Analysis

Page 25: The Continuous delivery Value @ codemotion 2014

CD FLOW

Commit /pushAutomated

Testing

FAIL

SUCCESS Automated Deploy

Procedure

notify

Basic Scenario

Page 26: The Continuous delivery Value @ codemotion 2014
Page 27: The Continuous delivery Value @ codemotion 2014

Deploy Pipeline

Commit StageCompile UnitTest Analysis

Build Installers

ReleaseAutomated acceptance

testign

Automated capacity testing

Manual TestingShowcasesExplorarory

testing

example

Page 28: The Continuous delivery Value @ codemotion 2014

ContinuousDelivery

Tools

MethodologiesPractices

Cautions

Page 29: The Continuous delivery Value @ codemotion 2014

Anti-patterns

• Deploy software manually

• Manual Configuration

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

Page 30: The Continuous delivery Value @ codemotion 2014

Benefits

• Empower Team

• Reducing Errors

• Lowering Stress

• Deployment Flexibility

• Practice Make Perfect

Page 31: The Continuous delivery Value @ codemotion 2014

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 @ codemotion 2014

SECTION ISource Code Management

Page 33: The Continuous delivery Value @ codemotion 2014

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 @ codemotion 2014
Page 35: The Continuous delivery Value @ codemotion 2014

SCM : What is it ?

3

57

10

Repository

Page 36: The Continuous delivery Value @ codemotion 2014

Local

Check-out

Pull

8

29

Page 37: The Continuous delivery Value @ codemotion 2014

Check-in

Push

Local

3 4

Page 38: The Continuous delivery Value @ codemotion 2014

SCM : What it does ?

• Keeping multiple file version

• Collaboration

Page 39: The Continuous delivery Value @ codemotion 2014

CHECK POINT

Page 40: The Continuous delivery Value @ codemotion 2014

Application Evolution

Page 41: The Continuous delivery Value @ codemotion 2014

Collaboration

Page 42: The Continuous delivery Value @ codemotion 2014

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 @ codemotion 2014

Best Practice

• Little Commit

• Frequent Commit

• Consistent commit

• User Meaningful Commit message

Page 44: The Continuous delivery Value @ codemotion 2014

Different Products

Page 45: The Continuous delivery Value @ codemotion 2014

SECTION IIContinuous Integration

Page 46: The Continuous delivery Value @ codemotion 2014

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 @ codemotion 2014

Ops (after deploy in prod)

INTEGRATION PROBLEM

It was working on the stage environment !!!

Page 48: The Continuous delivery Value @ codemotion 2014

sleepless nights before demo ... bug just after release

Page 49: The Continuous delivery Value @ codemotion 2014

Cos

t

Analysis Design Implementation Testing Release

Resolve defects

Page 50: The Continuous delivery Value @ codemotion 2014

t

integration

Regression

Working

Broken

Effort

Page 51: The Continuous delivery Value @ codemotion 2014

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 @ codemotion 2014

Continuous Integration

Page 53: The Continuous delivery Value @ codemotion 2014

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 @ codemotion 2014

Requirements

Source Code Management

Page 55: The Continuous delivery Value @ codemotion 2014

Requirements

Page 56: The Continuous delivery Value @ codemotion 2014

Agile-Testing-Quadrants

Page 57: The Continuous delivery Value @ codemotion 2014

F

F

F

F

F

FF

F

Checkout last Commit

CI Flow

Build and Tests Process

Page 58: The Continuous delivery Value @ codemotion 2014

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 @ codemotion 2014

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 @ codemotion 2014

CI - Output

System Status Documentation/Artifacts Quality Check

Page 61: The Continuous delivery Value @ codemotion 2014

“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 @ codemotion 2014

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 @ codemotion 2014

Immediate feedback on the health of the system

Page 64: The Continuous delivery Value @ codemotion 2014
Page 65: The Continuous delivery Value @ codemotion 2014

Ci - software

... more and more

Page 66: The Continuous delivery Value @ codemotion 2014

SECTION IIIAutomated Deploy

Page 67: The Continuous delivery Value @ codemotion 2014

Deployment

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

Wikipedia

Page 68: The Continuous delivery Value @ codemotion 2014

A Critical part of the application life-cycle

Deployment

Page 69: The Continuous delivery Value @ codemotion 2014

RELEASE

Real ?

RELEASERELEASERELEASERELEASERELEASERELEASERELEASERELEASERELEASERELEASERELEASEfeedback

Page 70: The Continuous delivery Value @ codemotion 2014

Deployment

• Low Risk

• Cheap

• Frequent

• Rapid

• Predictable

Page 71: The Continuous delivery Value @ codemotion 2014

Low Risk

• Exception catched

• Rollback

• Data on secure

Page 72: The Continuous delivery Value @ codemotion 2014

Cheap

• no more than one click

• no more than one person

• no skilled person

Page 73: The Continuous delivery Value @ codemotion 2014

Frequent

• to get feedback

Page 74: The Continuous delivery Value @ codemotion 2014

Rapid

Page 75: The Continuous delivery Value @ codemotion 2014

Predictable

Page 76: The Continuous delivery Value @ codemotion 2014

Incomplete ways

Page 77: The Continuous delivery Value @ codemotion 2014

is that a deploy procedure ?

$ git pull origin master

$ svn update

Remote Desktop Versioning update

Page 78: The Continuous delivery Value @ codemotion 2014

• Incomplete

• Manual procedure

• Slow

• Server Downtime

• No data migration

• No Rollback

Problems

Page 79: The Continuous delivery Value @ codemotion 2014

Automated Deployment Goals

Page 80: The Continuous delivery Value @ codemotion 2014

one click deploy

Deploy

Automated Deployment Goals

Page 81: The Continuous delivery Value @ codemotion 2014

AnyTime AnyWhere AnyOne

Automated Deployment Goals

Page 82: The Continuous delivery Value @ codemotion 2014

Rollback

Automated Deployment Goals

Page 83: The Continuous delivery Value @ codemotion 2014

no downtime

Automated Deployment Goals

Page 84: The Continuous delivery Value @ codemotion 2014

Scalable

Frontend 1 Frontend 1I Frontend III

Balancer

Automated Deployment Goals

Page 85: The Continuous delivery Value @ codemotion 2014

Deployment Elements

• Executable Code

• Dependency Management

• Software configuration

• Infrastructure Management

• Data Migrations

• Manage Cache

• Manage Assets

Page 86: The Continuous delivery Value @ codemotion 2014

Executable code (SCM)

Page 87: The Continuous delivery Value @ codemotion 2014

Dependency Management

Page 88: The Continuous delivery Value @ codemotion 2014

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 @ codemotion 2014

PIP

Page 90: The Continuous delivery Value @ codemotion 2014
Page 91: The Continuous delivery Value @ codemotion 2014

Data Migration

Page 92: The Continuous delivery Value @ codemotion 2014

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

Page 93: The Continuous delivery Value @ codemotion 2014
Page 94: The Continuous delivery Value @ codemotion 2014

Infrastructure Management

Page 95: The Continuous delivery Value @ codemotion 2014

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 @ codemotion 2014

A way to setup your environment

Page 97: The Continuous delivery Value @ codemotion 2014

Write Configuration

Script

Versionable

Page 98: The Continuous delivery Value @ codemotion 2014

Environment Management

Page 99: The Continuous delivery Value @ codemotion 2014

Production TestingStaging

Page 100: The Continuous delivery Value @ codemotion 2014

Manual - Follow recipe

• Integrity problems

• Problem with exception handling

• Basic Skills requirements

• Time consuming - expensive

• Error - prone

• Stress

Page 101: The Continuous delivery Value @ codemotion 2014

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 @ codemotion 2014
Page 103: The Continuous delivery Value @ codemotion 2014

Existing Tools

Fabric

... and more others

Page 104: The Continuous delivery Value @ codemotion 2014

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 @ codemotion 2014
Page 106: The Continuous delivery Value @ codemotion 2014

David Funaro

@ingdavidinodavidfunaro.com

Thanks

Page 107: The Continuous delivery Value @ codemotion 2014