the continuous delivery value - codemotion milano 2014
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.TRANSCRIPT
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. !@ingdavidino - Dnsee
MILAN november 28th/29th 2014
The Continuous Delivery Value
MILAN november 28th/29th 2014 – David Funaro
The Continuous Delivery
Value
MILAN november 28th/29th 2014 – David Funaro
David Funaro
@ingdavidino
davidfunaro.com
MILAN november 28th/29th 2014 – David Funaro
First Release
MILAN november 28th/29th 2014 – David Funaro
Release Day
MILAN november 28th/29th 2014 – David Funaro
WRONG WAY
This talk is for you…
MILAN november 28th/29th 2014 – David Funaro
Overview
MILAN november 28th/29th 2014 – David Funaro
Facts
release new features as soon as possible
IT Business
keep system up and running
MILAN november 28th/29th 2014 – David Funaro
… with CD
ITBu
sine
ss
MILAN november 28th/29th 2014 – David Funaro
RELEASE
FEEDBACK
new features monetize bug
performance layout
MILAN november 28th/29th 2014 – David Funaro
RELEASE
? Miss Release Price ?
€
MILAN november 28th/29th 2014 – David Funaro
Reaction MetricsC
hang
e
REL
EASE
MILAN november 28th/29th 2014 – David Funaro
Reaction MetricsC
hang
e
REL
EASE
Time
Security
Skills
Cost
Predictable
Stress
Repeatability
MILAN november 28th/29th 2014 – David Funaro
• How many time you need to release software
Time
MILAN november 28th/29th 2014 – David 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
MILAN november 28th/29th 2014 – David Funaro
• Have, the selected person, all the skill needed to terminate the procedure ?
• What about his behavior in some exception flow case
Skills
MILAN november 28th/29th 2014 – David Funaro
• How many people you need ?
• For how many time ?
• Other Resources ?
Cost
MILAN november 28th/29th 2014 – David Funaro
• are you able to indicate how much time will care ?
Predictable
MILAN november 28th/29th 2014 – David Funaro
• What about the stress
• stress => error-prone
Stress
MILAN november 28th/29th 2014 – David Funaro
• Just finish a deploy. Software released. A bug is found. You have to re-start the deploy procedure
Repeatability
MILAN november 28th/29th 2014 – David Funaro
Reaction Metrics
REL
EASE
Production
MILAN november 28th/29th 2014 – David Funaro
Reaction Metrics
REL
EASE
Production
Time
Security
Skills
Cost
Predictable
Stress
Repeatability
MILAN november 28th/29th 2014 – David Funaro
Reaction Metrics
REL
EASE
Production
Staging
Time
Security
Skills
Cost
Predictable
Stress
Repeatability
MILAN november 28th/29th 2014 – David Funaro
Reaction Metrics
REL
EASE
Production
Testing
Staging
Time
Security
Skills
Cost
Predictable
Stress
Repeatability
MILAN november 28th/29th 2014 – David Funaro
No Automation Process ?
MILAN november 28th/29th 2014 – David Funaro
Lots of things to consider
• Code evolution
• Code dependency management
• System evolution management
• Data management and architecture
• Component management
MILAN november 28th/29th 2014 – David Funaro
Software Release
• Low Risk
• Cheap
• Frequent
• Rapid
• Predictable
... should be
Continuous Delivery
MILAN november 28th/29th 2014 – David Funaro
CD Requirements
• Source Code Management
• Continuous Integration Server
• Automated Deploy
• Real Time Alerting
• Root Cause Analysis
MILAN november 28th/29th 2014 – David Funaro
CD FLOW
Commit /push
Automated Deploy
Procedure
Notify TeamBasic Scenario
Real Time Alerting
Automated Testing
RELEASE
MILAN november 28th/29th 2014 – David Funaro
CD FLOW
Commit /push
Automated Deploy
Procedure
Notify TeamBasic Scenario
Real Time Alerting
Automated Testing
RELEASE
MILAN november 28th/29th 2014 – David Funaro
RELEASE
MILAN november 28th/29th 2014 – David Funaro
Deploy Pipeline
Commit StageCompile UnitTest Analysis
ReleaseAutomated acceptance
testign
Automated capacity testing
Manual TestingShowcasesExplorarory
testing
example
MILAN november 28th/29th 2014 – David Funaro
ContinuousDelivery
Tools
MethodologiesPractices
Cautions
MILAN november 28th/29th 2014 – David Funaro
CD Anti-patterns• Deploy software manually
• Manual Configuration
• First Deploy when development is complete
• … to a production-like Environment
MILAN november 28th/29th 2014 – David Funaro
CD Benefits• Empower Team
• Reducing Errors
• Lowering Stress
• Deployment Flexibility
• Practice Make Perfect
MILAN november 28th/29th 2014 – David Funaro
Keep Everything in version control
Automate Almost Everything
If it hurts, do it more frequently
Done means released
Build quality in
Principles
MILAN november 28th/29th 2014 – David Funaro
SECTION ISource Code Management
MILAN november 28th/29th 2014 – David Funaro
The problem
i sent you a mail with the last change
... are you shure ?
i can’t find the new file ?!?
MILAN november 28th/29th 2014 – David Funaro
MILAN november 28th/29th 2014 – David Funaro
MILAN november 28th/29th 2014 – David Funaro
SCM : What is it ?
3
57
10
Repository
MILAN november 28th/29th 2014 – David Funaro
Check-out
Local
Pull
8
29
MILAN november 28th/29th 2014 – David Funaro
Check-out
Local
Pull
8
2
9
MILAN november 28th/29th 2014 – David Funaro
Check-in
Push
Local
3
MILAN november 28th/29th 2014 – David Funaro
Check-in
Push
Local
34
MILAN november 28th/29th 2014 – David Funaro
SCM : What it does ?
• Keeping multiple file version
• Collaboration
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. !@ingdavidino - Dnsee
MILAN november 28th/29th 2014
CHECK POINT
MILAN november 28th/29th 2014 – David Funaro
Application Evolution
MILAN november 28th/29th 2014 – David Funaro
Collaboration
MILAN november 28th/29th 2014 – David 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.
MILAN november 28th/29th 2014 – David Funaro
Best Practice
• Little Commit
• Frequent Commit
• Consistent commit
• Use Meaningful Commit message
MILAN november 28th/29th 2014 – David Funaro
Different Products
MILAN november 28th/29th 2014 – David Funaro
SECTION IIContinuous Integration
MILAN november 28th/29th 2014 – David Funaro
Ops
INTEGRATION PROBLEM
(after one commit )
After your commit nothing works anymore
But ... “was working on my computer”
MILAN november 28th/29th 2014 – David Funaro
Ops (after deploy in prod)
INTEGRATION PROBLEM
It was working on the stage environment !!!
MILAN november 28th/29th 2014 – David Funaro
• sleepless nights before demo ... bug just after release
•
sleepless nights before demo ... bug just after release
MILAN november 28th/29th 2014 – David Funaro
Resolve defectsC
ost
Analysis Design Implementation Testing Release
MILAN november 28th/29th 2014 – David Funaro
t
integration
Regression
Working
Broken
MILAN november 28th/29th 2014 – David Funaro
t
integration
Regression
Working
Broken
Effort
MILAN november 28th/29th 2014 – David Funaro
Good Solution
In software development the components integration need to be tested continuosly...
!
in order to find inconsistenciesas soon as possible
MILAN november 28th/29th 2014 – David Funaro
Continuous Integration
MILAN november 28th/29th 2014 – David Funaro
Continuous Integration is a software 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
MILAN november 28th/29th 2014 – David Funaro
Requirements
Source Code Management
MILAN november 28th/29th 2014 – David Funaro
Requirements
MILAN november 28th/29th 2014 – David Funaro
Agile-Testing-Quadrants
MILAN november 28th/29th 2014 – David Funaro
CI Flow
MILAN november 28th/29th 2014 – David Funaro
F
CI Flow
MILAN november 28th/29th 2014 – David Funaro
F
Checkout last Commit
CI Flow
Build and Tests Process
MILAN november 28th/29th 2014 – David Funaro
F
Checkout last Commit
CI Flow
Build and Tests Process
MILAN november 28th/29th 2014 – David Funaro
F
F
F
Checkout last Commit
CI Flow
Build and Tests Process
MILAN november 28th/29th 2014 – David Funaro
F
F
F
F
F
F
Checkout last Commit
CI Flow
Build and Tests Process
MILAN november 28th/29th 2014 – David Funaro
F
F
F
F
F
FF
F
Checkout last Commit
CI Flow
Build and Tests Process
MILAN november 28th/29th 2014 – David Funaro
F
F
F
F
F
FF
F
Checkout last Commit
CI Flow
Build and Tests Process
MILAN november 28th/29th 2014 – David 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
MILAN november 28th/29th 2014 – David 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
MILAN november 28th/29th 2014 – David Funaro
CI - Output
System Status Documentation/Artifacts
Quality Check
MILAN november 28th/29th 2014 – David Funaro
“Continuous Integration doesn’t get rid of bugs, but it does make them dramatically easier to find and remove.”
Martin Fowler
MILAN november 28th/29th 2014 – David Funaro
Ci - Best practice
• CI server === Production Server
• Integrate it from the first commit
• Find best way to get notified
MILAN november 28th/29th 2014 – David Funaro
Immediate feedback of the health of the system
MILAN november 28th/29th 2014 – David Funaro
MILAN november 28th/29th 2014 – David Funaro
MILAN november 28th/29th 2014 – David Funaro
Ci - software
... more and more
MILAN november 28th/29th 2014 – David Funaro
SECTION IIIAutomated Deploy
MILAN november 28th/29th 2014 – David Funaro
Deployment
“all the activities that make a software system available for use”
Wikipedia
MILAN november 28th/29th 2014 – David Funaro
Deploy
A Critical part of the application life-cycle
MILAN november 28th/29th 2014 – David Funaro
RELEASE
Real ?
MILAN november 28th/29th 2014 – David Funaro
RELEASE
Real ?
RELEASERELEASERELEASERELEASERELEASERELEASERELEASERELEASERELEASERELEASERELEASEfeedback
MILAN november 28th/29th 2014 – David Funaro
• Low Risk
• Cheap
• Frequent
• Rapid
• Predictable
Deployment
MILAN november 28th/29th 2014 – David Funaro
Low Risk
• Exception catched
• Rollback
• Data on secure
MILAN november 28th/29th 2014 – David Funaro
Cheap
• no more than one click
• no more than one person
• no skilled person
MILAN november 28th/29th 2014 – David Funaro
Frequent
• to get feedback
MILAN november 28th/29th 2014 – David Funaro
Rapid
MILAN november 28th/29th 2014 – David Funaro
Predictable
MILAN november 28th/29th 2014 – David Funaro
Incomplete ways
MILAN november 28th/29th 2014 – David Funaro
is that a deploy procedure ?
$ git pull origin master
$ svn update
Remote DesktopVersioning update
MILAN november 28th/29th 2014 – David Funaro
Problems• Incomplete
• Manual procedure
• Slow
• Server Downtime
• No data migration
• No Rollback
MILAN november 28th/29th 2014 – David Funaro
Automated Deployment Goals
MILAN november 28th/29th 2014 – David Funaro
one click deploy
Deploy
Automated Deployment Goals
MILAN november 28th/29th 2014 – David Funaro
AnyTime AnyWhere AnyOne
Automated Deployment Goals
MILAN november 28th/29th 2014 – David Funaro
Rollback
Automated Deployment Goals
MILAN november 28th/29th 2014 – David Funaro
no downtime
Automated Deployment Goals
MILAN november 28th/29th 2014 – David Funaro
Scalable
Frontend 1 Frontend 1I Frontend III
Balancer
Automated Deployment Goals
MILAN november 28th/29th 2014 – David Funaro
Deployment Elements• Executable Code
• Dependency Management
• Software configuration
• Infrastructure Management
• Data Migrations
• Manage Cache
MILAN november 28th/29th 2014 – David Funaro
Executable code (SCM)
MILAN november 28th/29th 2014 – David Funaro
Dependency Management
MILAN november 28th/29th 2014 – David 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
MILAN november 28th/29th 2014 – David Funaro
PIP
MILAN november 28th/29th 2014 – David Funaro
MILAN november 28th/29th 2014 – David Funaro
Data Migration
MILAN november 28th/29th 2014 – David Funaro
What if, after your first production deployment, you have to change the Entity Relationship ?
MILAN november 28th/29th 2014 – David Funaro
MILAN november 28th/29th 2014 – David Funaro
Infrastructure Management
MILAN november 28th/29th 2014 – David 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
MILAN november 28th/29th 2014 – David Funaro
A way to setup your environment
MILAN november 28th/29th 2014 – David Funaro
Write Configuration
Script
MILAN november 28th/29th 2014 – David Funaro
Write Configuration
Script
Versionable
MILAN november 28th/29th 2014 – David Funaro
Environment Management
MILAN november 28th/29th 2014 – David Funaro
Production TestingStaging
MILAN november 28th/29th 2014 – David Funaro
Manual - Follow recipe
• Integrity problems
• Problem with exception handling
• Basic Skills requirements
• Time consuming - expensive
• Error - prone
• Stress
MILAN november 28th/29th 2014 – David Funaro
Build a custom Script
• Do a backup
• Create new directory
• Update the code
• Update dependencies
• Run migration data
• Update Environements
MILAN november 28th/29th 2014 – David Funaro
MILAN november 28th/29th 2014 – David Funaro
Existing Tools
Fabric
... and more others
MILAN november 28th/29th 2014 – David Funaro
SECTION IVRealtime Alerting
MILAN november 28th/29th 2014 – David Funaro
Waiting for customers feedback ?
MILAN november 28th/29th 2014 – David Funaro
Waiting for customers feedback ?
MILAN november 28th/29th 2014 – David Funaro
Real Time Monitoring
• Application health
• System heatlh
• Services health
MILAN november 28th/29th 2014 – David Funaro
Some tools
Sentry
Log - Exception
Errors Server Monitoring
Application Monitoring
MILAN november 28th/29th 2014 – David Funaro
Example - NE
MILAN november 28th/29th 2014 – David Funaro
Example - Sentry
MILAN november 28th/29th 2014 – David Funaro
Keep Everything in version control
MILAN november 28th/29th 2014 – David Funaro
Keep Everything in version control
Build quality in
Done means released
If it hurts, do it more frequently
Automate Almost Everything
MILAN november 28th/29th 2014 – David Funaro
MILAN november 28th/29th 2014 – David Funaro
David Funaro
@ingdavidinodavidfunaro.com
Thanks
MILAN november 28th/29th 2014 – David Funaro