Top Banner
Five (easy?) Steps Towards Continuous Delivery Eberhard Wolff @ewolff innoQ
74

Five (easy?) Steps Towards Continuous Delivery

Apr 09, 2017

Download

Software

Eberhard Wolff
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Five (easy?) Steps Towards Continuous Delivery

Five (easy?) Steps Towards Continuous

DeliveryEberhard Wolff

@ewolffinnoQ

Page 2: Five (easy?) Steps Towards Continuous Delivery

http://continuous-delivery-buch.de/

Page 3: Five (easy?) Steps Towards Continuous Delivery

http://microservices-buch.de/ http://microservices-book.com/

Page 4: Five (easy?) Steps Towards Continuous Delivery

http://microservices-book.com/primer.html

FREE!!!!

Page 5: Five (easy?) Steps Towards Continuous Delivery

What is CD?

Page 6: Five (easy?) Steps Towards Continuous Delivery

Continuous Delivery =Deployment automation

Page 7: Five (easy?) Steps Towards Continuous Delivery

Continuous Delivery =Deployment automation

to increase speed

Page 8: Five (easy?) Steps Towards Continuous Delivery

Production problem.Boss screams at you.

How long to production?<15 min<30 min<60 min>60 min>1 day

Page 9: Five (easy?) Steps Towards Continuous Delivery

OH “The application server takes 15 min

to start.”

Page 10: Five (easy?) Steps Towards Continuous Delivery

Why don’t we deliver software every day

into production?

Page 11: Five (easy?) Steps Towards Continuous Delivery

Old release

Hot fix

Old release

New release

Page 12: Five (easy?) Steps Towards Continuous Delivery

Risk of bug fix small compared to keeping

faulty release in production.

Page 13: Five (easy?) Steps Towards Continuous Delivery

Would we deliver into production more often

if it took e.g. 5 minutes?

Page 14: Five (easy?) Steps Towards Continuous Delivery

Would we deliver software into

production more often with Puppet, Chef,

Docker?

Page 15: Five (easy?) Steps Towards Continuous Delivery

Step One

Realize deployment automation is just a

prerequisite for Continuous Delivery!

Page 16: Five (easy?) Steps Towards Continuous Delivery

Continuous Delivery =Deployment automation

to increase speed

Page 17: Five (easy?) Steps Towards Continuous Delivery

Continuous Delivery =Deployment automation

to increase speed

Page 18: Five (easy?) Steps Towards Continuous Delivery

What is CD?

Page 19: Five (easy?) Steps Towards Continuous Delivery

Agile Manifesto Principles

Our highest priority is

to satisfy the customer

through early and

continuous delivery

of valuable software.

Page 20: Five (easy?) Steps Towards Continuous Delivery

Build Pipeline

CommitStage

AutomatedAcceptance

Testing

AutomatedCapacityTesting

ManualExplorative

TestingRelease

Many tests to minimize risk

Infrastructure automation

Fast Feedback

Page 21: Five (easy?) Steps Towards Continuous Delivery

Why Continuous Delivery?

> Faster Deployment

> Higher Reliability

> Reproducibility

Page 22: Five (easy?) Steps Towards Continuous Delivery

Why Continuous Delivery?

> Cost-savings hard to estimate

> CD is an important step towards better and faster results €

Page 23: Five (easy?) Steps Towards Continuous Delivery

Understand the Goal!

> Seemingly simple

> …but often forgotten

> Not just about time-to-market

> Might also be reliability!

Page 24: Five (easy?) Steps Towards Continuous Delivery

Reliability

> Errors hard to reproduce

> Software hard to install

> Invest in deployment automation

> Ensure environment is identical in development and production

Page 25: Five (easy?) Steps Towards Continuous Delivery

Time-to-Market

> Optimize processing time!

> There is already a pipeline

> Goal: Constant flow of features through the pipeline

> Optimize throughput

Page 26: Five (easy?) Steps Towards Continuous Delivery

Value Stream Mapping

> Analyze existing pipeline

> Optimize throughput

Page 27: Five (easy?) Steps Towards Continuous Delivery

Commit AcceptanceTesting

CapacityTesting Release

Delay

Lead Time

5 Days 2 Days 1 Day

1 day 1 day 1 day

AutomatedAcceptance

Testing

AutomatedCapacityTesting

Testing,Sign Off &

Release

Cycle Time = Delay + Lead Time

1 hour

20 minutes 20 minutes

30 minutes

2 Day

2 day

Page 28: Five (easy?) Steps Towards Continuous Delivery

Commit AcceptanceTesting

CapacityTesting Release

Delay

Lead Time

5 Days 2 Days 1 Day

1 day 1 day 1 day

AutomatedAcceptance

Testing

AutomatedCapacityTesting

Testing,Sign Off &

Release

Cycle Time = Delay + Lead Time

1 hour

20 minutes 20 minutes

30 minutes

2 Day

2 day

11 days

5 days

Page 29: Five (easy?) Steps Towards Continuous Delivery

Result

> Cycle time reduced: Automated tests faster

> …and less effort

> Still manual sign-off & Release

> Feedback faster: Early 80% acceptance test

Page 30: Five (easy?) Steps Towards Continuous Delivery

Goal:Reliability

DeploymentAutomation

Goal:Time-to-Market Value Stream

MappingFast Feedback

Page 31: Five (easy?) Steps Towards Continuous Delivery

Step Two

Understand goals! Take pragmatic steps!

Page 32: Five (easy?) Steps Towards Continuous Delivery

CommitAutomatedAcceptance

Testing

AutomatedCapacityTesting

Testing,Sign Off &

Release1 hour 2 day

Why Sign Off?

Acceptance test = software is accepted

Page 33: Five (easy?) Steps Towards Continuous Delivery

Why Sign-Off?

> Customer wants to check the final result.

> Understandable

> But: Slow

> But: Hard to reproduce

Page 34: Five (easy?) Steps Towards Continuous Delivery

Eliminate manual Sign-off!

Page 35: Five (easy?) Steps Towards Continuous Delivery

Sign-off->Automated Tests

> Automated tests are fast

> …and easily reproducible

> …and cheaper

> Obviously the better choice!

Page 36: Five (easy?) Steps Towards Continuous Delivery

Why Sign-off?

> Risk of deploying the wrong software

> Lack of trust in tests

> Risk handling strategy

Page 37: Five (easy?) Steps Towards Continuous Delivery

Handling risk

> Make it easier to resolve issues

> Make deployment easier and faster

> Problem in production easier to fix

> Deployment automation

Page 38: Five (easy?) Steps Towards Continuous Delivery

Old release

New release

Page 39: Five (easy?) Steps Towards Continuous Delivery

Old release

New release

New release

New release

New release

Page 40: Five (easy?) Steps Towards Continuous Delivery

Handling risk

> Smaller deployments

> More frequent deployments

> Less risk that an error sneaks in

> Easier to reverse

Page 41: Five (easy?) Steps Towards Continuous Delivery

Creating Trust

> Customer must understand the tests

> Reviews

> Use proper kind of tests

Page 42: Five (easy?) Steps Towards Continuous Delivery

Automated Acceptance

Tests

Automated Integration

Tests

Unit Tests

ManualTests

Test Pyramid

Visible to customer

Page 43: Five (easy?) Steps Towards Continuous Delivery

The ultimate requirement is an

automated acceptance test.

XP 1999

Page 44: Five (easy?) Steps Towards Continuous Delivery

UI Tests: Selenium

> Easy to start

> Natural for testers

> Fragile

> Loose semantics

Page 45: Five (easy?) Steps Towards Continuous Delivery

Behavior-drivendevelopment: ExampleScenario: User registers successfully

Context

Event

Expectedoutcome

Given a new user with [email protected] Eberhardname Wolff

When the user registers

Then a customer with [email protected] should exist

And no error should be reported

Page 46: Five (easy?) Steps Towards Continuous Delivery

Creating Trust

> UI Tests are overused and have drawbacks

> BDD is designed for customers

> But most important:

> Choose whatever the customer understands!

> UI tests might be OK

Page 47: Five (easy?) Steps Towards Continuous Delivery

Step Three

Eliminate manual sign-offs!

Create trust in tests!

Page 48: Five (easy?) Steps Towards Continuous Delivery

CD & DevOps

> Usually Dev wants Continuous Delivery (CD)

> Dev wants easier and faster releases

> Ops not supportive

> However, they should aim for less risky deployments…

Page 49: Five (easy?) Steps Towards Continuous Delivery

Ops> Optimized for costs

> Caught in a local optimum

> i.e. standardized environments

> …but manual deployment

> Large investment for full automation

> Continuous Delivery problem to be expected

Page 50: Five (easy?) Steps Towards Continuous Delivery

CommitAutomatedAcceptance

Testing

AutomatedCapacityTesting

Testing,Sign Off &

Release

Dev

Ops

Page 51: Five (easy?) Steps Towards Continuous Delivery

CD & DevOps

> No need to create DevOps teams

> Collaboration needed, though

> Deployment is a joined Ops / Dev effort

> Good news: No reorganzation

Page 52: Five (easy?) Steps Towards Continuous Delivery

CD & DevOps

> Seek feedback from Ops early on

> Try to leverage Ops experience

Page 53: Five (easy?) Steps Towards Continuous Delivery

DevOps is no organization.

Page 54: Five (easy?) Steps Towards Continuous Delivery

DevOps is collaboration.

Page 55: Five (easy?) Steps Towards Continuous Delivery

Step Four

Deal with the gap between Dev and Ops!

Page 56: Five (easy?) Steps Towards Continuous Delivery

Continuous Delivery:Build Pipeline

ECommerceSystem

CommitStage

AutomatedAcceptance

Testing

AutomatedCapacityTesting

ManualExplorative

TestingRelease

Page 57: Five (easy?) Steps Towards Continuous Delivery

ECommerceSystem

3rd partysystems

Database

Page 58: Five (easy?) Steps Towards Continuous Delivery

Challenges> Dependencies on 3rd party systems

> Must provide test systems

> …or mocks

> Large database

> Must provide test data

Page 59: Five (easy?) Steps Towards Continuous Delivery

Challenges

> Tests take too long

> Deployment takes too long

> Continuous Delivery pipeline takes far too long

Page 60: Five (easy?) Steps Towards Continuous Delivery

Continuous Delivery with large deployment

units is hard.

Page 61: Five (easy?) Steps Towards Continuous Delivery

Like real hard.

Page 62: Five (easy?) Steps Towards Continuous Delivery

Server Server

Microservices

> Independent deployment units

> E.g. process, VMs, Docker containers

> Any technology

> Any infrastructure

MicroService

MicroService

Page 63: Five (easy?) Steps Towards Continuous Delivery

Microservices

ECommerceSystem

3rd partysystems

Database

Page 64: Five (easy?) Steps Towards Continuous Delivery

Microservices

3rd partysystems

Database

Order

Catalog

Billing

Search

Page 65: Five (easy?) Steps Towards Continuous Delivery

Order

Billing

Customer

Commit!Stage!

Automated!Acceptance!Testing!

Automated!Capacity!Testing!

Manual!Explorative!Testing!

Release!

Commit!Stage!

Automated!Acceptance!Testing!

Automated!Capacity!Testing!

Manual!Explorative!Testing!

Release!

Commit!Stage!

Automated!Acceptance!Testing!

Automated!Capacity!Testing!

Manual!Explorative!Testing!

Release!

Page 66: Five (easy?) Steps Towards Continuous Delivery

Microservice Pipeline

> Build pipeline per Microservice

> Small

> Easy to set up

> Simpler (3rd party systems)

> Faster Feedback: Less tests

> Separate critical and less critical parts

Page 67: Five (easy?) Steps Towards Continuous Delivery

Migrate to Microservices

> Add Microservices to existing system

> Implement new features in Microservices

> No need to redo the full application

Page 68: Five (easy?) Steps Towards Continuous Delivery

Continuous Delivery doesn’t mean Microservices.

Page 69: Five (easy?) Steps Towards Continuous Delivery

But can you do Continuous Delivey

without supporting it in the architecture?

Page 70: Five (easy?) Steps Towards Continuous Delivery

Step Five

Adjust the architecture!

Page 71: Five (easy?) Steps Towards Continuous Delivery

Conclusion

Page 72: Five (easy?) Steps Towards Continuous Delivery

Final words

> Do no underestimate the effort!

> This is not about automation to save cost.

> It is about increasing quality!

Page 73: Five (easy?) Steps Towards Continuous Delivery

Conclusion

> Deployment automation is just a prerequisite

> Understand the goals! Take pragmatic steps!

> Eliminate sign-offs! Create trust in tests!

> Deal with the gap between Dev and Ops!

> Adjust the architecture!

Page 74: Five (easy?) Steps Towards Continuous Delivery

Thank You!@ewolff