Expert Talks Cardiff 2017 - Keeping your ci-cd system as fast as it needs to be

Preview:

Citation preview

Abraham Marin-Perez@AbrahamMarin

fromfragiletoagile.com

Keeping Your CI / CD Pipeline as Fast as It Needs to Be

#ExpertTalks @AbrahamMarin @EqualExperts

Abraham Marin-Perez@AbrahamMarin

fromfragiletoagile.com

Keeping Your CI / CD Pipeline as Fast as It Needs to Be

#ExpertTalks @AbrahamMarin @EqualExperts

About Me

About Me

About Me

About Me

About Me

About Me

About This Talk

Continuous Integration: check everything is still working after every commit

Continuous Deployment: every successful commit turns into a release

About This Talk

About This Talk

About This Talk

About This Talk

About This Talk

SUPER APP

# Files: 75# Tests: 800Build Time: 4 minOutput: superapp.war

SUPER APP

# Files: 113# Tests: 1200Build Time: 6 minOutput: superapp.war

SUPER APP

# Files: 169# Tests: 1800Build Time: 9 minOutput: superapp.war

Slow feedback

Broken builds mask issues

Development paralysis

Impact on ability to meet our SLAs

Pay per use

Missed business opportunities

The Problems Of Size

Live with it

Partial CD: only quick tests

Phased CD: split into components

Test Deprecation Policy

Microservices

How Organisations Manage Size

Microservices

Microservices

Microservices

SUPER APP

# Files: 169# Tests: 1800Build Time: 9 minOutput: superapp.war

APP BACKEN

DSUPER

APP

# Files: 115# Tests: 1200Build Time: 6 minOutput: superapp.war

# Files: 72# Tests: 800Build Time: 4 minOutput: appbackend.jar

Microservices?

Microservices

Microservices

Microservices

Microservices

Microservices

Microservices

Build Pipeline Becomes a Network

https://goo.gl/LvkkRq

Scalable Continuous DeploymentWith Maven

A real case scenario

Service

Service

Service

Parent POM

Logging

Service

Service

Service

Parent POM

Logging

28%

Service

Service

Service

Parent POM

Logging

28%28%

28%

Service

Service

Service

Parent POM

Logging

28%28%

28%

20%

Service

Service

Service

Parent POM

Logging

48%

28%

28%

20%

Service

Service

Service

Parent POM

Logging

Highest runfrequency

Lowest runfrequency

Service

Service

Service

Highest runfrequency

Lowest runfrequency

Build Time (BT): time an individual build takes to run

Change Rate (CR): percentage of commits upon an individual build with respect to the whole system

Useful Metrics

Service

Service

Service

Highest runfrequency

Lowest runfrequency

Service

Service

Service

Parent POM

Logging

28%

Impact Time (IT): total time to run a build and all the builds that will be triggered as a result

Useful Metrics

No dependants IT(A) = BT(A)

A

Useful Metrics

Serial execution IT(A) = BT(A) + IT(B) + IT(C)

B

A

C

Useful Metrics

Parallel execution IT(A) = BT(A) + max(IT(B), IT(C))

B

A

C

Useful Metrics

Service

Service

Service

Highest runfrequency

Lowest runfrequency

Weighted Impact Time (WIT): impact time of a build weighted according to its change rage

WIT(A) = IT(A) * CR(A)

Useful Metrics

Average Impact Time (AIT): total time needed, on average, to execute all necessary builds after any given commit anywhere in the system

AIT = WIT(A) + WIT(B) + ... + WIT(Z)

Useful Metrics

Sample Thresholds

Average Impact Time

Average Impact Time is what indicates how well you have scaled your system

Sample Thresholds

Maximum Impact Time

In a worst-case scenario, a build won’t take longer than this.

Sample Thresholds

Maximum Impact Time for Critical Components

The same, but only for your most sensitive modules (log-in, payment gateway, etc.)

Beware of dependencies!

Sample Thresholds

Service

Service

Service

Highest runfrequency

Lowest runfrequency

Manual processingtakes time...

Most CI systems provide an API Calculations aren’t complex Multiple graphical tools available

Automating Build Analysis

github.com/quiram/build-hotspotsBuild Hotspots

https://commons.wikimedia.org/wiki/File:2012_Italian_GP_-_Lotus_wheel.jpg

Thank You

@EqualExperts

equal-experts

equalexperts.com

Thank You

fromfragiletoagile.com@AbrahamMarin

#FastCI

Recommended