build infrastructure: what it is, why you need it, and how to use python to fuel it

44
COPYRIGHT 2015 @ UNITY TECHNOLOGIES BUILD INFRASTRUCTURE What It Is, Why You Need It, and How to Use Python to Fuel It

Upload: natosha-bard

Post on 22-Jan-2018

1.141 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

BUILD INFRASTRUCTUREWhat It Is, Why You Need It, and How to Use Python to Fuel It

Page 2: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

WHAT IS BUILD ENGINEERING? BUILD ENGINEERING IS THE GLUE THAT HOLDS THE SOFTWARE DEVELOPMENT PROCESS TOGETHER.

Page 3: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

EXAMPLES OF BUILD ENGINEERING

• Choosing, configuring, customizing, and maintaining a CI server

• Applying/optimizing development models (branch-based, patch-based, etc)

• Build optimizations (distributed builds, bulk builds, etc)

• … and much more

Page 4: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

WHY DO I CARE?

Page 5: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

• Na’Tosha J. Bard • Copenhagen, Denmark • Engineering Tools Lead at Unity

Technologies (5+ years) • Open-Source & Linux Enthusiast • Married • 2 cats

ABOUT THE SPEAKER

Page 6: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

FOR YOUR REFERENCE

Slides will be available here:

http://natoshabard.com/speaking

Keep in touch:

Twitter: @natosha_bard E-mail: [email protected]

Page 7: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

WHAT IS UNITY?

Page 8: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

Page 9: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

Page 10: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

Page 11: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

Page 12: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

Page 13: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

WHAT IS UNITY?

• Game Engine & Content Creation Toolkit • Editor for Mac OS X & Windows • Experimental build for Linux

• Runtime ported to 22 platforms • Mostly written in C++ • Gameplay scripts written in C# • Scripting engine for gameplay code built on

top of Mono

Page 14: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

BUILD ENGINEERING AT UNITY TECHNOLOGIES

Page 15: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

2010

• Unstable SVN Server • All developers commit directly to trunk • Unstable CI Server • 6 VisualStudio and Xcode projects wrapped

in Perl • Automated Tests nightly on 2 platforms • 4 machines for building • Deployment scripts running from developer

machines • No automatic verification of deployed builds

Page 16: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

2015

• DVCS with Mercurial • Branch-based development • Project files generated with Jamplus • Stable CI Solution (Internally-Developed) • Automated tests running on developer branches

and on our mainline on various platforms • Build cloud of over 200 virtual and physical

machines • Web-based publishing portal for deploying

builds

Page 17: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

OUR RELEASE CYCLES WENT FROM AS LONG AS 18 MONTHS TO EVERY 3 MONTHS WHILE OUR DEVELOPMENT TEAM GREW 400%.

Page 18: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

FOUNDATION OF BUILD INFRASTRUCTURE

Page 19: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

THE 5 PILLARS OF BUILD INFRASTRUCTURE • ONE-CLICK BUILDS • BUILD AUTOMATION • CONTINUOUS

INTEGRATION • AUTOMATED TESTING • AUTOMATED

DEPLOYMENT

Page 20: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

WHAT ON EARTH DOES THIS ALL HAVE TO DO WITH PYTHON? PYTHON IS AN AMAZING LANGUAGE FOR WRITING DEVELOPMENT TOOLS.

Page 21: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

ONE-CLICK BUILDS: BUILDING YOUR SOFTWARE WITH JUST ONE CLICK

Page 22: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

BENEFITS OF ONE-CLICK BUILDS

• KISS principle • Build early, Build often • Groundwork for other software

development principles

Page 23: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

GETTING STARTED WITH ONE-CLICK BUILDS

• Depends on your application • Possible Solutions: SCons, Waf • Cohesive buildsystem • Keep platform-dependent issues in mind!

Page 24: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

WHAT UNITY DOES

• Currently using Jamplus and Perl • Didn’t find a good Python-based tool that

met all of our requirements :-( • Migrating to Gradle • http://gradle.org/migrating-a-large-c-

codebase-to-gradle/

Page 25: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

BUILD AUTOMATION:A BUILD SERVER TO RUN YOUR ONE-CLICK BUILDS

Page 26: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

BENEFITS OF BUILD AUTOMATION

• Verification • Parallelization • Groundwork for other software

development principles

Page 27: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

GETTING STARTED WITH BUILD AUTOMATION

• Depends on feature set you need • Possible Solution: Buildbot • Give careful thought to buildserver/

buildsystem configuration split

Page 28: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

HOW UNITY DOES IT

• Custom solution built on top of Buildbot - “Katana”

• https://github.com/Unity-Technologies/katana/ • http://mariangemarcano.blogspot.dk/

• Katana’s Build Cloud configured with Salt • http://saltstack.com/

Page 29: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

CONTINUOUS INTEGRATION:CONTINUOUSLY RUN THOSE AUTOMATED BUILDS

Page 30: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

BENEFITS OF CONTINUOUS INTEGRATION

• Increased Developer Productivity • Helps avoid “Integration Hell” • Automatically identifies exact failure point

Page 31: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

GETTING STARTED WITH CONTINUOUS INTEGRATION

• Generally, the same solutions as for Build Automation apply here

• Note: Sometimes “Frequent Integration” is good enough

Page 32: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

HOW UNITY DOES IT

• We don’t…yet • Frequent integration • Nightly builds on mainlines • On-demand builds on other branches

Page 33: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

AUTOMATED TESTING:RUN TESTS ON THOSE CONTINUOUSLY-RUNNING BUILDS

Page 34: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

BENEFITS OF AUTOMATED TESTING

• Provides protection against regressions • Saves human resources • Keeps test suites from bit-rotting

Page 35: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

GETTING STARTED WITH AUTOMATED TESTING

• Find a test framework for your technology • PyUnit (unittest), nose • Sometimes creating your own frameworks

is an answer (i.e, High-Level Integration Tests)

Page 36: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

HOW UNITY DOES IT

• No Python :-( • Custom test frameworks in C# • Heavy use of NUnit • Custom test runner in Perl

Page 37: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

AUTOMATED DEPLOYMENT:EASILY DEPLOY THOSE TESTED BUILDS

Page 38: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

BENEFITS OF AUTOMATED DEPLOYMENT

• Less error-prone than manual publishing • Easy to verify • Easy to track release history

Page 39: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

GETTING STARTED WITH AUTOMATED DEPLOYMENT

• Often related to build automation/CI solution

• Highly dependent on your organization’s server infrastructure and type of software

• Start with a simple script and expand • Consider integrating directly with your

already-existing build server solution

Page 40: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

HOW UNITY DOES IT

• Web-based publishing portal - “Saihai” • Promoting builds to internal QA and

publishing to external testers. • Publishing final releases to CDN • Provides API regarding published releases

for other internal services

Page 41: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2014 @ UNITY TECHNOLOGIES

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

The 5 pillars of Build Infrastructure.

ONE-CLICK BUILDS

BUILD AUTOMATION

CONTINUOUS INTEGRATION

AUTOMATED TESTING

AUTOMATED DEPLOYMENT

Page 42: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

A CALL TO ARMS: TIPS FOR GETTING STARTED

• Just do something • When advocating for change, focus on the

benefits • Don’t underestimate the value of having

dedicated build engineers on your team

Page 43: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

COME JOIN US!

• Release Managers • Web Developers (Full-Stack & Front-End

Only) • Low-level Build Engineers • High-level Build Engineers • Version Control Experts • Packaging & Distribution Engineers

http://unity3d.com/jobs

Page 44: Build Infrastructure: What It Is, Why You Need It, and How to Use Python to Fuel it

COPYRIGHT 2015 @ UNITY TECHNOLOGIES

Text Styles

switch between levels

Level 1 = Bullet 24 pt. Level 2 = Bullet 24 pt. Level 3 = Bullet 20 pt. Level 4 = Bullet 18 pt. Level 5 = Bullet 16 pt.

+ TAB

Alternatively,

Thank You!@natosha_bard