uber mobility - build & release

173
Daniel Liem & Chirayu Krishnappa Ship Fast & Stable @ Uber Scale 11.1.2016

Upload: dhaval-patel

Post on 15-Apr-2017

54 views

Category:

Mobile


2 download

TRANSCRIPT

Page 1: Uber mobility - Build & Release

Daniel Liem & Chirayu Krishnappa

Ship Fast & Stable @ Uber Scale

11.1.2016

Page 2: Uber mobility - Build & Release
Page 3: Uber mobility - Build & Release
Page 4: Uber mobility - Build & Release
Page 5: Uber mobility - Build & Release

99.99%

Page 6: Uber mobility - Build & Release

● Have a dedicated Release team

● Aggressive weekly release cadence

● Build cuts (CI) from Master

● Nightly (alpha) vs. Beta / Production builds

● Internal beta dogfooding vs. External Beta testing

● FF (Feature Flagging) wherever possible

● Avoid alphafixes, betafixes, hotfixes & rollbacks

● Soft Upgrades vs. Force Upgrades

Our Process

Page 7: Uber mobility - Build & Release

Staged Rollouts

iOS

Android

Page 8: Uber mobility - Build & Release

Staged Rollouts

iOS Sanity Tests / Patches

Android Sanity Tests / Patches

Page 9: Uber mobility - Build & Release

Staged Rollouts

iOS Sanity Tests / Patches

Upload to iTunes, enable Testflight

(Weekend dogfooding)

Android Sanity Tests / Patches

β channel(Weekend

dogfooding)

Page 10: Uber mobility - Build & Release

Staged Rollouts

iOS Sanity Tests / Patches

Upload to iTunes, enable Testflight

(Weekend dogfooding)

Wait for Approval

Android Sanity Tests / Patches

β channel(Weekend

dogfooding)

Staged Rollouts (1% → 10% → 50% → 100%)

Page 11: Uber mobility - Build & Release

Staged Rollouts

iOS Sanity Tests / Patches

Upload to iTunes, enable Testflight

(Weekend dogfooding)

Launch 100%(All users at once!)

Wait for Approval

Android Sanity Tests / Patches

β channel(Weekend

dogfooding)

Staged Rollouts (1% → 10% → 50% → 100%)

(Partner app only)Soft Upgrade + Force Upgrade

Page 12: Uber mobility - Build & Release
Page 13: Uber mobility - Build & Release
Page 14: Uber mobility - Build & Release
Page 15: Uber mobility - Build & Release

How many apps?

Page 16: Uber mobility - Build & Release

How many teams?

Developers!

Page 17: Uber mobility - Build & Release

How long does it take to “deploy to production”?

Page 18: Uber mobility - Build & Release

Build, sign, and more.

Mostly deterministic.

Page 19: Uber mobility - Build & Release

Submit to App Store for approval

Page 20: Uber mobility - Build & Release

WAIT … !

Page 21: Uber mobility - Build & Release

Approved! Now what?

Page 22: Uber mobility - Build & Release

WAIT … !

Your users will upgrade…eventually.

Page 23: Uber mobility - Build & Release

http://www.publicdomainpictures.net/view-image.php?image=139317&picture=snail-man

Page 24: Uber mobility - Build & Release

SPEED

Not the speed of your mobile app

Page 25: Uber mobility - Build & Release

SPEED

Speed of deployment

Page 26: Uber mobility - Build & Release

SPEED

Speed of reactions when you discover issues

Page 27: Uber mobility - Build & Release

SPEED

Speed of rollbacks.

Page 28: Uber mobility - Build & Release

What are rollbacks?

Page 29: Uber mobility - Build & Release

How many versions of your app are out there?

Page 30: Uber mobility - Build & Release
Page 31: Uber mobility - Build & Release

Adoption across versions

Page 32: Uber mobility - Build & Release
Page 33: Uber mobility - Build & Release

Need for a trusted system

Page 34: Uber mobility - Build & Release

Goal: Develop at full speed!

Page 35: Uber mobility - Build & Release

High quality bar!

Goal: Develop at full speed

Page 36: Uber mobility - Build & Release

High quality bar!Goal: Develop at full speed

Because slow to deploy/rollback

Page 37: Uber mobility - Build & Release

Signals

Page 38: Uber mobility - Build & Release

Signals

Page 39: Uber mobility - Build & Release

Soon to be 100s of signals

Signals

Page 40: Uber mobility - Build & Release

How can you stay on top?

How do you react to these signals?

Page 41: Uber mobility - Build & Release

Ticketing system at the core

If there’s a failure that should block the train, there’s a ticket for it.

Page 42: Uber mobility - Build & Release
Page 43: Uber mobility - Build & Release

Block specific versions

Verify patched versions

Track mitigation tasksWeekly reports

Page 44: Uber mobility - Build & Release
Page 45: Uber mobility - Build & Release

Intelligent Subsystemscrash detection at alpha stages vs. production

Every alpha crash gets a

ticket

Page 46: Uber mobility - Build & Release

Feature Flagging

Automate to track features per version and turn off

based on classified crashes

Page 47: Uber mobility - Build & Release

Reminders

E.g. When a new build is ready

(also in-app “upgrade” notifications)

Page 48: Uber mobility - Build & Release
Page 49: Uber mobility - Build & Release

Notifications/Alerts

We’re pushing at 4pm

It’s 2pm and we have new / unresolved tickets.

Page 50: Uber mobility - Build & Release
Page 51: Uber mobility - Build & Release

Production alerts are separate

e.g. Spike in crashes, E2E,App Store ratings dropped.

Page 52: Uber mobility - Build & Release

https://pixabay.com/en/go-button-3d-icon-sign-symbol-1067074/

Page 53: Uber mobility - Build & Release

Stage Everything

Rollout to employees

Test flight, alpha, beta channels

Page 54: Uber mobility - Build & Release

Stage Everything

Alpha channel rollout?

Stage it. 1%, 10%, 50% 100%

Page 55: Uber mobility - Build & Release

Stage Everything

In app upgrade prompt?

Stage that too! 1%, 10%, 100%.

Page 56: Uber mobility - Build & Release

In a nutshell…

Deploys are slowCollect all signalsTicketing at core

Automated remindersAd hoc notifications / alerts

Page 57: Uber mobility - Build & Release

Thank you

Proprietary and confidential © 2016 Uber Technologies, Inc. All rights reserved. No part of this document may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval systems, without permission in writing from Uber. This document is intended only for the use of the individual or entity to whom it is addressed and contains information that is privileged, confidential or otherwise exempt from disclosure under applicable law. All recipients of this document are notified that the information contained herein includes proprietary and confidential information of Uber, and recipient may not make use of, disseminate, or in any way disclose this document or any of the enclosed information to any person other than employees of addressee to the extent necessary for consultations with authorized personnel of Uber.

Ship Fast & Stable @ Uber Scale

Daniel Liem & Chirayu Krishnappa

Page 58: Uber mobility - Build & Release

Building At Uber ScaleLike a ‘BAUS’

Robbert van Ginkel & Gautam Korlam11.1.2016

Page 59: Uber mobility - Build & Release

Overview

Challenges with mobile development at scale

Team Size

Build Time

Infrastructure

Improving Developer Experience while tackling scale

Architecture

Workflow

Tooling

Page 60: Uber mobility - Build & Release

Mobile Scale @ Uber

Page 61: Uber mobility - Build & Release

Several Hundred Mobile Developers

Hundreds of commits daily

50% of code changes every month

Shared modular codebase with hundreds of modules

Page 62: Uber mobility - Build & Release

Team Size

Page 63: Uber mobility - Build & Release

Commits

Page 64: Uber mobility - Build & Release

Architecting for Scale

Code architectureFeatures are built as Plugins and shared between apps

Code infrastructure and toolingMonorepo helps with modularization and sharing

Regressions block the whole teamAlways keep master green

Guard as much as possible at compile timeFail fast

Page 65: Uber mobility - Build & Release

Workflow at Scale

Asynchronous change mergingSubmit queueStacked Diffs

Run expensive code quality checks pre mergeUI TestsDeep static analysis - Infer etc.Performance regressions on real devices - cold start, battery, network etc.

Page 66: Uber mobility - Build & Release

Build Time

Page 67: Uber mobility - Build & Release

Waiting for builds...

Page 68: Uber mobility - Build & Release

With more modules, come more problems

Page 69: Uber mobility - Build & Release

Build Tools Scaling Issues

CocoapodsDoes not scale well with more targets (15 min pod install time)

XcodeIncorrect incremental builds (non deterministic and hard to debug)Xcode project file merge conflicts

GradleDoes not scale well with large android projects (15 min for a single line change)Android Studio performance degrades

Page 70: Uber mobility - Build & Release

Building at Scale

Both iOS and Android use Buck to build at UberIncremental everywhereScale non exponentially as more code is addedCache immutable state - avoid rebuildingTransparent Dependency ManagementWorks well for monorepoiOS - Clean ~4x faster, Incremental ~20x fasterAndroid - Clean ~6x faster, Incremental ~30x fasterRemote Build Cache

Page 71: Uber mobility - Build & Release

Infrastructure

Page 72: Uber mobility - Build & Release

Uber’s CI Infrastructure

CI capacity needs increased exponentially400+ Busy Executors on CI hourly50k+ CI Jobs run per day

600

400

200

100

CI Executors with Time

Page 73: Uber mobility - Build & Release

Optimizing the CI Pipeline

Perform relevant checks at the right stageCode Formatting - pre diffBuild, Unit Tests - diffUI, Static Analysis - pre merge

Use CI resources effectivelyRemote build artifact cachingBuild in elasticity to meet peak demand

Page 74: Uber mobility - Build & Release

Open Source

Page 75: Uber mobility - Build & Release

Projects to Watch

OkBuck - Gradle plugin that lets you use gradle projects with buckBuck Http Cache - A distributed build artifact cache serviceComing soon: Swift Support in Buck

https://github.com/uber/buck-http-cache

1https://github.com/uber/okbuck , Slide Deck

Page 76: Uber mobility - Build & Release

Takeaway

Invest in the right build tools early onScaling hardware only works till a certain pointHaving shared workflow/tools across platforms helps a lot in the long run

Fail earlier and keep master always green

Page 77: Uber mobility - Build & Release

Scaling the Build Process at UberRobbert van Ginkel & Gautam Korlam

Thank You

Page 78: Uber mobility - Build & Release

In-product features for release engineers

Christian [email protected]

Page 79: Uber mobility - Build & Release
Page 80: Uber mobility - Build & Release
Page 81: Uber mobility - Build & Release
Page 82: Uber mobility - Build & Release
Page 83: Uber mobility - Build & Release
Page 84: Uber mobility - Build & Release

App

↑ ↑ ↑http://www.pocketship.com

Page 85: Uber mobility - Build & Release

In-product features for release engineers

Page 86: Uber mobility - Build & Release

In-product

Page 87: Uber mobility - Build & Release

ReleaseEnginee

rs

ProductEnginee

rsApp

Page 88: Uber mobility - Build & Release

Empathy

Agency

Page 89: Uber mobility - Build & Release

Agency

Fix Release Engineering pain

Gain more code context and

confidence

Improve Release Engineering

processes

Influence company direction

Reciprocal

Page 90: Uber mobility - Build & Release

Empathy

Build times and CI turnaround

Tests, test infrastructure, and

tooling

Release process overhead

Shipping to the world

Reciprocal

Page 91: Uber mobility - Build & Release

Empathy

“One of us”

Page 92: Uber mobility - Build & Release

Specific features

Page 93: Uber mobility - Build & Release

Specific featuresCompany

Product

Release

Page 94: Uber mobility - Build & Release

Crash, OOM, hang reporting

Page 95: Uber mobility - Build & Release

Telemetry / analytics

Page 96: Uber mobility - Build & Release

Feature flags (A/B testing)

if (whatever) { doA();} else { doB();}

Page 97: Uber mobility - Build & Release

Feature flags (A/B testing)

if (whatever) { doA();} else { doB();}

Page 98: Uber mobility - Build & Release

Feature flags (A/B testing)

Page 99: Uber mobility - Build & Release

Bug reporter

Page 100: Uber mobility - Build & Release

Bug reporter

Page 101: Uber mobility - Build & Release

Bug reporter

Page 102: Uber mobility - Build & Release

Bug reporter

Page 103: Uber mobility - Build & Release

Bug reporter

Page 104: Uber mobility - Build & Release

Bug reporter

Page 105: Uber mobility - Build & Release

Promotion framework

Page 106: Uber mobility - Build & Release

Promotion framework

Page 107: Uber mobility - Build & Release

Promotion framework

Page 108: Uber mobility - Build & Release

Promotion framework

Page 109: Uber mobility - Build & Release

Promotion framework

Test the next version of FacebookGet access to new features and

bugfixes before everyone else.

Page 110: Uber mobility - Build & Release

Promotion framework

Page 111: Uber mobility - Build & Release

Promotion framework

Page 112: Uber mobility - Build & Release

Promotion framework

Page 113: Uber mobility - Build & Release

Automatic employee updater

Page 114: Uber mobility - Build & Release

React Native

Page 115: Uber mobility - Build & Release

React Native

JS Bundle

Page 116: Uber mobility - Build & Release

React Native

JS Bundle

JS Bundle↑

Page 117: Uber mobility - Build & Release

React Native

Page 118: Uber mobility - Build & Release

WebViews

Page 119: Uber mobility - Build & Release

WebViews

Page 120: Uber mobility - Build & Release

Version number scheme

Page 121: Uber mobility - Build & Release

Version number scheme

Page 122: Uber mobility - Build & Release

Version number scheme

v20

Page 123: Uber mobility - Build & Release

Version number schemev20

#5001#5002#5003#5004#5005#5006

14 APKs

Page 124: Uber mobility - Build & Release

Version number schemev20

#5001#5002#5003#5004#5005#5006

v21

#5046#5047#5048#5049#5050#5051

Page 125: Uber mobility - Build & Release

Version number scheme

Ship production weekly

Slow rollout

Alpha and beta

Internal employee dogfooding

Page 126: Uber mobility - Build & Release

Version number scheme

Page 127: Uber mobility - Build & Release

Version number scheme100.0.0.20.70

Page 128: Uber mobility - Build & Release

Version number scheme100.0.0.20.70

Major version

Page 129: Uber mobility - Build & Release

Version number scheme100.0.0.20.70

Major version

Page 130: Uber mobility - Build & Release

Version number scheme100.0.0.20.70

Major version

Hotfix

Page 131: Uber mobility - Build & Release

Version number scheme100.0.0.20.70

Major version Hotfix

Page 132: Uber mobility - Build & Release

Version number scheme100.0.0.20.70

Major version Hotfix

Beta

Page 133: Uber mobility - Build & Release

Version number scheme100.0.0.20.70

Major version Hotfix Beta

Page 134: Uber mobility - Build & Release

Version number scheme100.0.0.20.70

Major version Hotfix

Alpha

Beta

Page 135: Uber mobility - Build & Release

Version number scheme100.0.0.20.70

Major version Hotfix Beta Alpha

Page 136: Uber mobility - Build & Release

ReleaseEnginee

rs

ProductEnginee

rsApp

Page 137: Uber mobility - Build & Release

ReleaseEnginee

rs

ProductEnginee

rsApp

Page 139: Uber mobility - Build & Release
Page 140: Uber mobility - Build & Release
Page 141: Uber mobility - Build & Release

THE DARK SIDE OF ENTERPRISE SWIFTJacek Suliga Mobilize @ LinkedIn🍺

Page 142: Uber mobility - Build & Release
Page 143: Uber mobility - Build & Release
Page 144: Uber mobility - Build & Release
Page 145: Uber mobility - Build & Release
Page 146: Uber mobility - Build & Release

Builds Perf& App Size

LaunchPerformance

MaintenanceCost

Page 147: Uber mobility - Build & Release

Builds Perf & App Size

LaunchPerformance

MaintenanceCost

Page 148: Uber mobility - Build & Release

8-23 MB10-30%

Page 149: Uber mobility - Build & Release
Page 150: Uber mobility - Build & Release
Page 151: Uber mobility - Build & Release

20% slower

Page 152: Uber mobility - Build & Release
Page 153: Uber mobility - Build & Release

Builds Perf& App Size

LaunchPerformance

MaintenanceCost

Page 154: Uber mobility - Build & Release

WWDC 2016, 406, “Optimizing app startup time”

Page 155: Uber mobility - Build & Release
Page 156: Uber mobility - Build & Release
Page 157: Uber mobility - Build & Release

Builds Perf& App Size

LaunchPerformance

MaintenanceCost

Page 158: Uber mobility - Build & Release

0.5

1.0

1.1

1.2

2.0

2.1

OpenSourc

e2.2

2.3

3.0

6/14

9/14

10/14

4/15

6/15

9/15

12/15

3/16

6/16

9/16

Page 159: Uber mobility - Build & Release
Page 160: Uber mobility - Build & Release

LinkedIn

Swift 3migratio

nparty

Page 161: Uber mobility - Build & Release
Page 162: Uber mobility - Build & Release
Page 163: Uber mobility - Build & Release

3.0

Page 164: Uber mobility - Build & Release

0.3

Page 165: Uber mobility - Build & Release
Page 166: Uber mobility - Build & Release
Page 167: Uber mobility - Build & Release

Any Questions?!

Page 168: Uber mobility - Build & Release

Automating Mobile Releases

Rachel Brindle

Page 169: Uber mobility - Build & Release

TERMS• User: Someone who uses your app.

• Environment: Place where a user can download your app

• Staging: HockeyApp, Testflight, etc.

• Production: Enterprise MDM, App Store, Play Store

• Automated Deployment: Using CI to push to environment

z

Page 170: Uber mobility - Build & Release

Processz

Page 171: Uber mobility - Build & Release

WHY

• Frees up the deployer to do other things

• Consistent deploys

• Shorter release cycle

• Documents

$ git pushpushed g4edeff4$ # wait$ rake check_if_deployedLatest is g4edeff4

z

Page 172: Uber mobility - Build & Release

• Make sure tests pass

• Build for release

• Gather metadata

• Screenshots

• Release Notes

• Other?

• Upload to environment

Page 173: Uber mobility - Build & Release

• Make sure tests pass

• Build for release

• Gather metadata

• Screenshots

• Release Notes

• Other?

• Upload to environment