Slide 1

Slide 1 text

Presented by Danny W. Adair // Kiwi PyCon // 13 Sep 2014 The Full Monty - CI on OpenStack

Slide 2

Slide 2 text

Danny W. Adair ● Python daily since 1999 ● In New Zealand since 2001 (from Germany) ● President of NZPUG ● Manages “Python Community” on LinkedIn ● Software Engineer at Catalyst IT ● Building Odoo capability

Slide 3

Slide 3 text

Talk Outline ● Odoo is an Open Source ERP ● It's big and scary and under active development ● We need to customise it ● Continuous Integration – Our setup ● OpenStack cloud ● Development workflow ● Gotchas ● Improvements ● Questions

Slide 4

Slide 4 text

Odoo “More than an ERP”

Slide 5

Slide 5 text

Enterprise Resource Planning ● Product planning, cost and development ● Manufacturing or service delivery ● Project Management ● Human Resources ● Marketing and Sales ● Inventory Management ● Shipping and Payment ● Accounting Software for managing a business, usually a suite of integrated applications:

Slide 6

Slide 6 text

Enterprise Resource Planning ● Product planning, cost and development ● Manufacturing or service delivery ● Project Management ● Human Resources ● Marketing and Sales ● Inventory Management ● Shipping and Payment ● Accounting Software for managing a business, usually a suite of integrated applications: “No size fits all”

Slide 7

Slide 7 text

Consultingware

Slide 8

Slide 8 text

Open Source Business Models ● Service & Expertise ● Configuration ● Customisation ● Development ● Hosting ● Support / Maintenance ● Not locked in to vendor (?)

Slide 9

Slide 9 text

Odoo Statistics (Aug 2014) ● 2,015,172 code lines in 260 core modules (+ 312,116 comment lines, +284,157 blank lines) ● 45.2% XML (1.18M lines) ● 26.0% Python (0.68M lines) ● 23.1% JavaScript (0.60M lines) ● 4.0% CSS (0.10M lines) ● ca. 200 commits / week

Slide 10

Slide 10 text

Odoo Statistics (Aug 2014) ● 2,015,172 code lines in 260 core modules (+ 312,116 comment lines, +284,157 blank lines) ● 45.2% XML (1.18M lines) ● 26.0% Python (0.68M lines) ● 23.1% JavaScript (0.60M lines) ● 4.0% CSS (0.10M lines) ● ca. 200 commits / week

Slide 11

Slide 11 text

Not a framework! ● Create vs. Customise ● django.contrib.auth.models.User anyone?

Slide 12

Slide 12 text

Scary: Magic import

Slide 13

Slide 13 text

Scary: ORM browse_record is a browse_record is a browse_record

Slide 14

Slide 14 text

Realistic Server Setup Web & Application Server Database Server

Slide 15

Slide 15 text

Continuous – Integration - Testing ● Continuous Integration Merge dev copies into mainline several times a day ● Integration Testing Combine modules and test as a group ● Cloud provides servers quickly and easily, paid per hour ● Perfect match to go the Full Monty

Slide 16

Slide 16 text

Things we could do... Web & Application Server Database Server (Continuous...) ● Regression Testing ● Performance Testing ● Load Testing ● Scalability Testing

Slide 17

Slide 17 text

Tools used Gerrit Code Review Jenkins CI

Slide 18

Slide 18 text

We Are Family ● Gerrit ● Jenkins ● OpenStack ● Puppet ● Odoo

Slide 19

Slide 19 text

We Are Family ● Gerrit ● Jenkins ● OpenStack ● Puppet ● Odoo

Slide 20

Slide 20 text

Code Review: Gerrit Gerrit +1 Code Review master push merge

Slide 21

Slide 21 text

Code Review: Gerrit Gerrit +1 Code Review master push merge +1 Code Review

Slide 22

Slide 22 text

Code Review: Gerrit Gerrit +1 Code Review master push merge

Slide 23

Slide 23 text

Code Review: Gerrit and Jenkins Gerrit Jenkins +1 Code Review master push merge

Slide 24

Slide 24 text

Code Review: Gerrit and Jenkins Gerrit Jenkins +1 Code Review master push merge

Slide 25

Slide 25 text

Code Review: Gerrit and Jenkins Gerrit Jenkins +1 Verified +1 Code Review master push merge

Slide 26

Slide 26 text

Code Review: Gerrit and Jenkins Gerrit Jenkins +1 Verified +1 Code Review master push merge “I don't want to review broken code”

Slide 27

Slide 27 text

Code Review: Gerrit and Jenkins For your change to be merged into the main line: ● Jenkins needs to say “yes” ● Your peer needs to say “yes”

Slide 28

Slide 28 text

Scotland

Slide 29

Slide 29 text

Realistic Setup Web & Application Server Database Server

Slide 30

Slide 30 text

OpenStack ● Servers provided quickly, removed quickly ● Paid per hour ● Open Source ● Python

Slide 31

Slide 31 text

OpenStack ...

Slide 32

Slide 32 text

OpenStack

Slide 33

Slide 33 text

Gotcha: Networking ● Subnet just for CI servers ● Access through VPN (one “floating IP”) ● Routing (e.g. external VPN connections) ● DNS (nice FQDNs for the transient servers) ● We're building more than one server at a time!

Slide 34

Slide 34 text

Build me a server 1. Base image

Slide 35

Slide 35 text

Build me a server 2. Cloud init 1. Base image

Slide 36

Slide 36 text

Build me a server 3. SSH session (fabric) 2. Cloud init 1. Base image

Slide 37

Slide 37 text

Build me a server 4. Get build instructions from repo 3. SSH session (fabric) 2. Cloud init 1. Base image

Slide 38

Slide 38 text

Build me a server 5. Run puppet configuration 4. Get build instructions from repo 3. SSH session (fabric) 2. Cloud init 1. Base image

Slide 39

Slide 39 text

Build me a server 6. “Run my script” 5. Run puppet configuration 4. Get build instructions from repo 3. SSH session (fabric) 2. Cloud init 1. Base image

Slide 40

Slide 40 text

Gotcha: Wait your turn ● Wait for asynchronous tasks to finish ● sshd ready (successful connection) ● puppet ready (cert from puppet master)

Slide 41

Slide 41 text

gerrit odoo odoo-build foobar odoo-ci foobar odoo.gerrit odoo-build.gerrit foobar.gerrit odooci-stack-suffix-app1 odooci-stack-suffix-db1 odoo-build odoo-build odoo foobar foobar odoo odoo.github odoo

Slide 42

Slide 42 text

https://odooci-master-latest-app1.odoo-ci.wgtn.cat-it.co.nz/

Slide 43

Slide 43 text

Improvements

Slide 44

Slide 44 text

Improvements 6. “Run my script” 5. Run puppet configuration 4. Get build instructions from repo 3. SSH session (fabric) 2. Cloud init 1. Base image

Slide 45

Slide 45 text

Questions?

Slide 46

Slide 46 text

Thank you Enjoy the rest of Kiwi PyCon 2014! Danny W. Adair [email protected]