building a distributed build system at google scale

75
Building a Distributed Build System at Google Scale Aysylu Greenberg

Upload: aysylu-greenberg

Post on 15-Apr-2017

681 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Building a Distributed Build System at Google Scale

Building a Distributed Build System at Google ScaleAysylu Greenberg

Page 2: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Aysylu Greenberg

@aysylu22

Page 3: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Aysylu Greenberg

@aysylu22

Page 4: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Building Distributed Build System

at Google Scale

Page 5: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Building Distributed Build System

at Google Scale

Page 6: Building a Distributed Build System at Google Scale

Confidential + Proprietary

WTH is"Google scale"?

Page 7: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Scale● Engineers: >30,000 developers in 40+ offices

Page 8: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Scale● Engineers: >30,000 developers in 40+ offices● Commits: 15K by humans + 30K by robots per day

Page 9: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Scale● Engineers: >30,000 developers in 40+ offices● Commits: 15K by humans + 30K by robots per day● Source code: 2 billion LOC

Page 10: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Scale● Engineers: >30,000 developers in 40+ offices● Commits: 15K by humans + 30K by robots per day● Source code: 2 billion LOC● Builds and tests: 5M per day through BuildRabbit

Page 11: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Scale● Engineers: >30,000 developers in 40+ offices● Commits: 15K by humans + 30K by robots per day● Source code: 2 billion LOC● Builds and tests: 5M per day through BuildRabbit● Petabytes of output artifacts

Page 12: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Scale● Engineers: >30,000 developers in 40+ offices● Commits: 15K by humans + 30K by robots per day● Source code: 2 billion LOC● Builds and tests: 5M per day through BuildRabbit● Petabytes of output artifacts● 1 repository

Page 13: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Working in One Repository

Page 14: Building a Distributed Build System at Google Scale

Confidential + Proprietary

● Linear revision history

Working in One Repository

Page 15: Building a Distributed Build System at Google Scale

Confidential + Proprietary

● Linear revision history● Everything is cross-referenced

Working in One Repository

Page 16: Building a Distributed Build System at Google Scale

Confidential + Proprietary

● Linear revision history● Everything is cross-referenced● Components for library releases

○ = Git subtree or Git subcomponents to separate release from WIP versions

Working in One Repository

Page 17: Building a Distributed Build System at Google Scale

Confidential + Proprietary

● Linear revision history● Everything is cross-referenced● Components for library releases● Repository of artifacts vs build from source:

○ Predictable, repeatable builds from source○ Optimizations to avoid compiling same artifacts○ Decouple each team's processes as much as possible

Working in One Repository

Page 18: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Building Distributed Build System

at Google Scale

Page 19: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Building Distributed Build System

at Google Scale

Page 20: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Towards Distributed Build System

Page 21: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Towards Distributed Build System

Page 22: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 23: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 24: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 25: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Build Scenario:

Project with dependencies

Find dependencies

Build project with the dependencies

Download build artifacts

Page 26: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Test Scenario:

Project with dependencies

Find dependencies

Build project with the dependencies

Download build artifacts Run the test

Get the results of the test

Page 27: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 28: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 29: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 30: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 31: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 32: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 33: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 34: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 35: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 36: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 37: Building a Distributed Build System at Google Scale

Confidential + Proprietary

http://opencv.org/

Towards Distributed Build System

Page 38: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Towards Distributed Build System

http://opencv.org/

Page 39: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Towards Distributed Build System

http://opencv.org/

Page 40: Building a Distributed Build System at Google Scale

Confidential + Proprietary

BuildRabbit:Distributed Build System

Page 41: Building a Distributed Build System at Google Scale

Confidential + Proprietary

BuildRabbit: Distributed Build System

IN THE CLOUD

Page 42: Building a Distributed Build System at Google Scale

Confidential + Proprietary

What does BuildRabbit do?

Page 43: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Continuous integration

system

BuildRabbit Blaze

Source System

Google engineers &

teams

Release infrastructure

Integration testing

infrastructure

Build artifact storage

Page 44: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Building Distributed Build System

at Google Scale

Page 45: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Building Distributed Build System

at Google Scale

Page 46: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Evolution of BuildRabbit:From push to pull

Page 47: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Evolution of BuildRabbit: From Push to Pull

● Experimental project -> key piece of Google's developer infrastructure

Page 48: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Evolution of BuildRabbit: From Push to Pull

● Experimental project -> key piece of Google's developer infrastructure

● Push model

Client for

User

BuildRabbitScheduler

BuildRabbitWorker

Page 49: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Evolution of BuildRabbit: From Push to Pull

● Experimental project -> key piece of Google's developer infrastructure

● Push model● Pull model: build service

Page 50: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Build Service

User

Persistent Queue

BuildRabbit Worker

Build ArtifactsBuild

Progress Info

RPCeventstream

Page 51: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Replacing Jet EngineIn-Flight

Page 52: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Replacing Jet Engine In-Flight

Page 53: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Page 54: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Client for

User

BuildRabbitScheduler

BuildRabbitWorker

Page 55: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Client for

User

BuildRabbitScheduler

BuildRabbitWorker

User

Persistent Queue

BuildRabbit Worker

Build ArtifactsBuild

Progress Info

Page 56: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Client for

User

BuildRabbitScheduler

BuildRabbitWorker

User

Persistent Queue

BuildRabbit Worker

Build ArtifactsBuild

Progress Info

Page 57: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Implementing Re-architected Build System

Page 58: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Migrate backends first

implementing re-architected build system

Page 59: Building a Distributed Build System at Google Scale

Confidential + Proprietary

User

Persistent Queue

BuildRabbit Worker

Build ArtifactsBuild

Progress Info

RPCeventstream

Page 60: Building a Distributed Build System at Google Scale

Confidential + Proprietary

User

Persistent Queue

BuildRabbit Worker

Build ArtifactsBuild

Progress Info

RPCeventstream

Page 61: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Throw-away code is needed to prove

identical functionality

implementing re-architected build system

Page 62: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Throw-away code is needed to prove

identical functionality

>>> Compatibility window is several months

implementing re-architected build system

Page 63: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Target launch-friendly clients

before transitioning everyone

implementing re-architected build system

Page 64: Building a Distributed Build System at Google Scale

Confidential + Proprietary

User

Persistent Queue

BuildRabbit Worker

Build ArtifactsBuild

Progress Info

RPCeventstream

Page 65: Building a Distributed Build System at Google Scale

Confidential + Proprietary

User

Persistent Queue

BuildRabbit Worker

Build ArtifactsBuild

Progress Info

RPCeventstream

Page 66: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Decouple launch of services

implementing re-architected build system

Page 67: Building a Distributed Build System at Google Scale

Confidential + Proprietary

User

Persistent Queue

BuildRabbit Worker

Build ArtifactsBuild

Progress Info

RPCeventstream

Page 68: Building a Distributed Build System at Google Scale

Confidential + Proprietary

User

Persistent Queue

BuildRabbit Worker

Build ArtifactsBuild

Progress Info

RPCeventstream

Page 69: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Maximum visibility into system state

implementing re-architected build system

Page 70: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Practice before launch

implementing re-architected build system

Page 71: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Practice before launch, a lot

implementing re-architected build system

Page 72: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Practice before launch, a lot

Have a solid rollback plan

implementing re-architected build system

Page 73: Building a Distributed Build System at Google Scale

Confidential + Proprietary

References

● Why Google Stores Billions of Lines of Code in a Single Repository https://www.youtube.com/watch?v=W71BTkUbdqE

● Build artifacts storage http://google-engtools.blogspot.com/2011/10/build-in-cloud-distributing-build.html

● Distributed build actions http://google-engtools.blogspot.com/2011/09/build-in-cloud-distributing-build-steps.html

● Continuous integration testing http://dl.acm.org/citation.cfm?id=2635910

Page 74: Building a Distributed Build System at Google Scale

Confidential + Proprietary

Gratitude

Vince Noel

Scott Zawalski

Rob Siemborski

BuildRabbit team

Caitie McCaffrey

David Greenberg

Page 75: Building a Distributed Build System at Google Scale