scaling up continuous deployment

20
Scaling Up Continuous Deployment Timothy Fitz (.com)

Upload: timothy-fitz

Post on 28-May-2015

791 views

Category:

Technology


1 download

DESCRIPTION

How do you continue to ship 50 times a day, when you're constantly hiring more engineers? How can you continue, when every day you write more tests that need to be run on every commit? This talk will cover how to scale up Continuous Integration and Continuous Deployment infrastracture, for teams as small as a handful of engineers and as large as hundreds of engineers.

TRANSCRIPT

Page 1: Scaling Up Continuous Deployment

Scaling Up Continuous Deployment

Timothy Fitz (.com)

Page 2: Scaling Up Continuous Deployment

“Continuous deployment involves deploying early and often, so as to avoid

the pitfalls of "deployment hell". The practice aims to reduce timely rework and thus

reduce cost and development time.”

Page 3: Scaling Up Continuous Deployment

Scalability

• Maintaining availability, performance and happiness

• As a function of # of people• As a function of # of tests

Page 4: Scaling Up Continuous Deployment

Availability

• The build must always be green• Set a “green SLA”– 99% green– Never red for > 15m

• Measure, track and report on these numbers

Page 5: Scaling Up Continuous Deployment

Performance

• Measure (intent to) commit to time of deploy– Goal: < 5 minutes

• Measure local development test loop– Goal: < 2s

Page 6: Scaling Up Continuous Deployment

Happiness

• CI/CD System is a product• Software Engineers are the customer• Keep your customer happy!

Page 7: Scaling Up Continuous Deployment

Testing Pyramid

Page 8: Scaling Up Continuous Deployment

How do you make tests fast?

• Tests can exercise large amounts of code without being slow

• Minimize system calls (no I/O, no disk)• Minimize test data size• Make sure all systems are cheap to

instantiate/teardown• No external state makes tests more reliable

Page 9: Scaling Up Continuous Deployment

Run Tests in Parallel

• Multiprocess• Multimachine• Multi-VM• Instant multi-VM: http://circleci.com

Page 10: Scaling Up Continuous Deployment

Hardware Scale

• CI Cluster will get huge– Function of cumulative engineering man-months– Rule of thumb: 10% of your cluster size

• You will need a CI/CD DevOps person– CI cluster monitoring / alerting– Configuration Management critical

Page 11: Scaling Up Continuous Deployment

Scale testing infrastructure recap

• Write the right kind of tests• Make those tests as fast as possible• Run those tests in parallel

Page 12: Scaling Up Continuous Deployment

People / Roles

• Sheriff– Designated reverter / problem troubleshooter– Common pattern (IMVU, Chromium, Firefox)

• CD “Product Owner”– Held accountable for SLA / Performance– Manage infrastructure backlog

Page 13: Scaling Up Continuous Deployment

Single trunk

• Do this until it doesn’t work for you• Gets painful in the 16 – 32 developer range• Faster commit->deploy reduces the pain– But effort becomes prohibitive

Page 14: Scaling Up Continuous Deployment

“Try” pipeline

• Conceptually, a second tree that “doesn’t matter” but still gets tested for feedback

• Buildbot implements a patch-pushing version• Takes a significant amount of pressure off of

trunk builds

Page 15: Scaling Up Continuous Deployment

CI Server takes active role

• Server automatically reverts red commits• Server merges green commits to trunk

Page 16: Scaling Up Continuous Deployment

Feature branches

• All incremental development happens on branches, branches land when feature is “ready”

• If “feature” is kept small, can be 2-3 per engineer per week on average

• Less continuous, but scales much better– Feature branches tested before merge

Page 17: Scaling Up Continuous Deployment

Merge tree

• Tree per team / feature• Trees merged into trunk daily (if green)• Scale up via tree of trees (of trees…)• Again, less continuous

Page 18: Scaling Up Continuous Deployment

Federation

• Each team gets their own deploy pipeline• Requires SOA / component architecture• Each team can set their own CD pace• “Enterprise Ready”

Page 19: Scaling Up Continuous Deployment

Recap

• Single trunk + Try pipeline / Autorevert• Feature Branches• Merge Tree• Federation

Page 20: Scaling Up Continuous Deployment

Questions?

Timothy Fitz (.com)