Preventing craziness A deep dive into OpenStack testing automation - - PowerPoint PPT Presentation

preventing craziness
SMART_READER_LITE
LIVE PREVIEW

Preventing craziness A deep dive into OpenStack testing automation - - PowerPoint PPT Presentation

Preventing craziness A deep dive into OpenStack testing automation Thierry Carrez (@tcarrez) Release manager, OpenStack OpenStack is large & growing 95+ code repositories 1.9+ MLOC Stats by OpenStack is complex 9 integrated


slide-1
SLIDE 1

Preventing craziness

A deep dive into OpenStack testing automation

Thierry Carrez (@tcarrez) Release manager, OpenStack

slide-2
SLIDE 2
slide-3
SLIDE 3

OpenStack is large & growing

 95+ code repositories  1.9+ MLOC

Stats by

slide-4
SLIDE 4

OpenStack is complex

 9 integrated projects  Each project is a framework

slide-5
SLIDE 5

OpenStack is painful

 Diffjcult to deploy  Diffjcult to test  Diffjcult to keep up with changes

slide-6
SLIDE 6

OpenStack is open innovation

 Anyone can propose a change  Lots of difgerent companies  No traditional management structure  Technical meritocracy (no DFL)  Global community

slide-7
SLIDE 7

And yet...

 We release every 6 months  Master branches are always usable  We keep on growing  We retained (most of) our sanity

slide-8
SLIDE 8
  • 1. Code reviews

 Everyone's code should be reviewed  At worse it's a learning opportunity  Elite committers vs. Peer reviewers  Everyone can review

slide-9
SLIDE 9
  • 2. Automated testing

 Not tested

Not working →

 Not automatically tested

Not tested →

slide-10
SLIDE 10
  • 2. Automated testing

 Unit tests  Integration tests  Upgrade tests  Syntax tests (PEP8)  Hacking style tests (fmake8/hacking)

slide-11
SLIDE 11
  • 3. Trunk gating

 Do not merge unless it passes tests  « Automation for code review »  Always-good trunk

slide-12
SLIDE 12

All together now...

Your git branch master git branch github git.o.o tarballs.o.o review.o.o

developer reviewers infrastructure

PEP8 Hacking Unit tests Integration tests

slide-13
SLIDE 13

git

 git is used everywhere  git is fast & powerful  git-review lets us submit to Gerrit  Github only used as a repo mirror

slide-14
SLIDE 14

Gerrit

 Code review  Inline comments, vote tracking

slide-15
SLIDE 15

Gerrit

slide-16
SLIDE 16

Gerrit

slide-17
SLIDE 17

Gerrit

 Code review  Inline comments, vote tracking  Issues :  Automating confjguration (Jeepyb)  no private reviews

slide-18
SLIDE 18

Zuul

 Triggered by gerrit event fjrehose  Handles test pipelines (see later)  Launches tests  Uses Gearman to distribute tests  Reports results back to Gerrit

slide-19
SLIDE 19

Jenkins

 Runs tests on slaves  Nodepool ensures slaves availability  Devstack-gate scripts prepare slaves  Issues :  Jjb  Avoid plugins  Not really useful at this point

slide-20
SLIDE 20

All together now...

Repository Gerrit Zuul Nodepool

git clone git review

Gerrit stream-event

Jenkins

Gearman jenkins plugin

Branch

Zuul Gerrit reporter Job results

slide-21
SLIDE 21

Everyone loves numbers

 900 patchsets proposed per day  4000 Gerrit comments/votes per day  7 Jenkins masters, 250-500 slaves  15K test jobs per day  200 patchsets merged per day

slide-22
SLIDE 22

Scaling Jenkins & Gerrit

 Multiple master setup  Log storage : logstash, Gearman  Log search : ElasticSearch / Kibana  Mirroring master git repo to cgit pool

slide-23
SLIDE 23

Gating at scale

 Serial gating is easy but limited

1 2 3 4

slide-24
SLIDE 24

Serial gating

1

slide-25
SLIDE 25

Serial gating

1 1 2

slide-26
SLIDE 26

Serial gating

1 1 2 1 2 3

slide-27
SLIDE 27

Serial gating

1 1 2 1 2 3 1 2 4

slide-28
SLIDE 28

Gating at scale

 Serial gating is easy but limited  Parallel gating ? Yay clouds  But parallel gating may introduce fails

1 2 3 4

slide-29
SLIDE 29

Parallel gating

1 2 3 4

slide-30
SLIDE 30

Parallel gating

1 2 3 4

slide-31
SLIDE 31

Gating at scale

 Serial gating is easy but limited  Parallel gating ? Yay clouds  But parallel gating may introduce fails  Zuul : Speculative execution of tests

1 2 3 4

slide-32
SLIDE 32

Speculative gating

1 1 2 1 1 3 4 2 2 3

slide-33
SLIDE 33

Speculative gating

1 1 2 1 3 2 1 4 2 3

slide-34
SLIDE 34

Speculative gating

1 1 2 1 1 3 4 2 2 3

slide-35
SLIDE 35

Speculative gating

1 1 2 1 1 3 4 2 2 3 1 2 4

slide-36
SLIDE 36

Speculative gating

1 1 2 1 1 3 4 2 2 3 1 2 4

slide-37
SLIDE 37

Speculative gating

1 1 2 1 1 3 4 2 2 3 1 2 4

slide-38
SLIDE 38

Speculative vs. serial gating

1 1 2 1 1 3 4 2 2 3 1 2 4 1 1 2 1 2 3 1 2 4

slide-39
SLIDE 39

Visualizing Zuul

slide-40
SLIDE 40

False negatives

slide-41
SLIDE 41

Tracking rechecks

slide-42
SLIDE 42

Tracking rechecks

slide-43
SLIDE 43

Failure tracking by signature

slide-44
SLIDE 44

Elastic rechecks

slide-45
SLIDE 45

Automation for the win

http://xkcd.com/1205

slide-46
SLIDE 46

Infrastructure as code

 Puppet-driven infrastructure  All project infrastructure is open  Yes, everything is in a code repo  Apply our key principles to infra too

slide-47
SLIDE 47

Join us !

 State-of-the-art dev infrastructure  Openly developed  Reused at Wikimedia and elsewhere

#openstack-infra on

slide-48
SLIDE 48

Questions ?

thierry@openstack.org http://fnords.wordpress.com @tcarrez on ttx on