Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

59
Opening Opensource the Jenkins Way BreizhCamp 17 juin 2011 ©2011 Cloud Bees, Inc. All Rights Reserved

description

Jenkins (formerly known as Hudson) is one of the most used tool in Java (non exclusive) to support continuous integration. Created as a hobby project, it quickly became a strategic tool for most development teams. Designed for extensibility, it also choosed from beginning an incremental development model, applying literally the 'release early, release often' principle. It focussed on building a large, active community, with the lowest contribution barrier I ever seen on opensource project and a complete transparency on project management, making Jenkins something uncommon in opensource world. During this session, I'll explain the Jenkins management & technical model, how it promotes contribution and how it allow CloudBees to both support the opensource community-driven project and deliver business value with proprietary extensions.

Transcript of Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

Page 1: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

Opening Opensource the Jenkins Way

BreizhCamp 17 juin 2011

©2011 Cloud Bees, Inc. All Rights Reserved

Page 2: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

2 ©2011 CloudBees, Inc. All Rights Reserved

Nicolas De loof

•  Java-Boy •  DevOps at •  (ex-)Committer Maven

•  JUG-Leader

Page 3: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

©2011 CloudBees, Inc. All Rights Reserved

Page 4: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

4

•  de facto continuous integration Server in Java ecosystem (non exclusive)

•  Basis for Software Factory automation o Q&A Code inspection o Release management o Continuous deployment o Business Intelligence …

©2011 CloudBees, Inc. All Rights Reserved

Page 5: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

5

Hudson / Jenkins : the fork

©2011 CloudBees, Inc. All Rights Reserved

KK  create  Hudson  as  a  Hobby  

Hudson  is  adopted  world  wide  

Oracle  aquire  SUN  

Oracle  register  «  Hudson  »  trademark  

Issues  with  java.net  infrastructure  

Oracle  uses  trademark  as  a  weapon  

Vote  to  rename  the  project  and  move  to  GitHub  

Jenkins  defines  it’s  own  process  

Here  we  are  

Sonatype  join  Oracle  Hudson  

Jenkins  

moved  to  GitHub  and  proposed  to  Eclipse  FoundaKon  Hudson  

Page 6: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

6 ©2011 CloudBees, Inc. All Rights Reserved

•  13 000 downloads / week •  1 500 member on jenkins-users •  4 000 followers @jenkinsci

User choosed Jenkins

Page 7: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

7

•  900 members on jenkins-dev •  48 active contributors, 94 publicized •  170 Pull-requests from occasional

contributors •  11,3 changes per release

(6,7 before the fork)

… as Developers did

©2011 CloudBees, Inc. All Rights Reserved

Page 8: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

©2011 CloudBees, Inc. All Rights Reserved

Page 9: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

9

•  Voice committer •  Committer •  Contributor •  Supporting User •  User

Standard OSS model « meritocratic »

©2011 CloudBees, Inc. All Rights Reserved

Page 10: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

10

1.  Use the tool 2.  Contribute to user-forum 3.  Get familiar with the code 4.  Contribute to dev-forum 5.  Fix bugs and post patches 6.  Be nice with everybody 7.  Do some lobbying

How to become a Committer …

©2011 CloudBees, Inc. All Rights Reserved

Page 11: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

11

•  Difficult to get into the code •  Difficult to get spare time •  Difficult to fix bug or add new features •  Laborious to create and maintain patches •  Frustrating to wait for approval

How many talentuous guys do we loose here ?

In practice…

©2011 CloudBees, Inc. All Rights Reserved

Page 12: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

12

My personal experience

©2011 CloudBees, Inc. All Rights Reserved

MoKvaKon  (#  of  contribuKons)  

(never  occurred)  

Page 13: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

13

•  Rule #1 : lower the contribution barrier

The Jenkins-way

©2011 CloudBees, Inc. All Rights Reserved

Page 14: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

14

Want to contribute ?

©2011 CloudBees, Inc. All Rights Reserved

Ask  for  commit  

Page 15: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

15

« With great power, comes great responsibility »

Self-censored contributors

©2011 CloudBees, Inc. All Rights Reserved

Page 16: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

16

•  Discover a regression : revert

•  Test harness to the rescue (still much to do there)

Possible if there is few changes between releases !

Hey, this is SCM role after all !

©2011 CloudBees, Inc. All Rights Reserved

Page 17: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

17

•  Rule #2 : Release often (even more)

The Jenkins-way

©2011 CloudBees, Inc. All Rights Reserved

Page 18: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

18

•  One release per week •  Few changes between releases •  Easy to rollback when something is

broken

•  + « stable but older » branch (3 month) with Critical bug fixes only

Jenkins releases

©2011 CloudBees, Inc. All Rights Reserved

Page 19: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

©2011 CloudBees, Inc. All Rights Reserved

Page 20: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

20

•  Contributor may ask for code review •  Contribution may require few changes

before beeing applied •  We don’t want to discourage contributors

WTF ?

©2011 CloudBees, Inc. All Rights Reserved

Page 21: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

21

•  Diff format is definitly not a sexy format for humans

> +@Deprecated > +public class Base64 > +{ > + public Base64() > + { > + super();

Does it really need to call Object.super(). Can we not leave it with the default constructor as Plexus' original has?

> + }

Diff format (SVN patch)

©2011 CloudBees, Inc. All Rights Reserved

Page 22: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

22

GitHub pull request

©2011 CloudBees, Inc. All Rights Reserved

Page 23: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

23

•  Rule #3 : Tools matter, use the right ones

The Jenkins-way

©2011 CloudBees, Inc. All Rights Reserved

patch  

Pull  request  +  Commit  paTern  

Page 24: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

24

•  Origin of the Hudson/Jenkins fork (java.net outage)

•  200 forks on Jenkins GitHub repo ! •  170 pull requests

Jenkins at GitHub

©2011 CloudBees, Inc. All Rights Reserved

Page 25: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

25

What about CLA ?

©2011 CloudBees, Inc. All Rights Reserved

Page 26: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

26

•  Constrain contributors to transfer Intellectual Property

•  … but not to ensure they have •  License is not a guarantee of freedom

•  This is a lawyers artifact

What is a CLA for ?

©2011 CloudBees, Inc. All Rights Reserved

Page 27: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

27

•  Rule #4 : We are developers, not lawyers

The Jenkins-way

©2011 CloudBees, Inc. All Rights Reserved

Page 28: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

©2011 CloudBees, Inc. All Rights Reserved

Page 29: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

29

•  250 plugins ! (maven plugin is the only one in core)

•  Even growing ecosystem •  Contributor can focus on some plugin

that bring them value daily

Modular design

©2011 CloudBees, Inc. All Rights Reserved

Page 30: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

30

•  Extension point with runtime discovery •  Need to plug somewhere in Jenkins ? add a new extension point

•  Some idea for a new plugin ? add for a repo on github/jenkins-ci

Extensibility

©2011 CloudBees, Inc. All Rights Reserved

Page 31: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

31

•  Rule #5 : design for extensibility

Multiple technical solutions (incl. @Inject)

The Jenkins way

©2011 CloudBees, Inc. All Rights Reserved

Page 32: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

©2011 CloudBees, Inc. All Rights Reserved

Page 33: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

33

•  User forum

•  Dev forum

•  Private forum

•  (+ lobbying)

Multiple discussion levels

©2011 CloudBees, Inc. All Rights Reserved

Page 34: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

34

•  Need for private discussion when it could hurt someone

  invitation for new Committers

… but we don’t have to « filter » committers anymore

WTF ?

©2011 CloudBees, Inc. All Rights Reserved

Page 35: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

35

•  All discussions are public – On jenkins-dev – On irc #jenkinsci

•  Meeting bi-weekly on irc – Logged by irc-bot for later availability

http://meetings.jenkins-ci.org/jenkins

transparency

©2011 CloudBees, Inc. All Rights Reserved

Page 36: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

36

•  24/7 on #jenkins •  Active reader on mailing lists •  Join the bi-weekly #irc meeting •  Read the meeting minutes

Multiple level of participation

©2011 CloudBees, Inc. All Rights Reserved

Page 37: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

37

Rule #6 : Make things transparent

The Jenkins way

©2011 CloudBees, Inc. All Rights Reserved

Page 38: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

38

•  Multiple levels of commitment   24/7 eMail addict   filter mails by subject   discuss major themes on bi-weekly meeting   read meeting notes

e-Mail avalanche syndrom

©2011 CloudBees, Inc. All Rights Reserved

Page 39: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

©2011 CloudBees, Inc. All Rights Reserved

Page 40: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

40

•  Many contributor involved •  Everyone can commit (with care) •  No need for long debates thanks to small

release cycles and transparency

•  But… project still needs some sort of lead

Lead

©2011 CloudBees, Inc. All Rights Reserved

Page 41: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

41

•  … but not a despot !

« Benevolent Dictator For Life »-syndrom

A Lead

©2011 CloudBees, Inc. All Rights Reserved

Page 42: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

42

•  Highly active contributor •  Good knowledge of project history •  Good technical skills •  Visionary •  Newbie-compliant •  Not egocentric

Lead must be …

©2011 CloudBees, Inc. All Rights Reserved

Page 43: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

43

•  Kohsuke Kawaguchi •  Andrew Bayer •  Dean Yu

(all from distinct companies) And discuss in public !

Lead-commitee is safer

©2011 CloudBees, Inc. All Rights Reserved

Page 44: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

44

•  Rule #7 : choose a good Lead model

focus first on building a community

The Jenkins way

©2011 CloudBees, Inc. All Rights Reserved

Page 45: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

45

« all from distinct companies » ?

Opensource (x)or Business

©2011 CloudBees, Inc. All Rights Reserved

Page 46: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

46

( ©2011 CloudBees, Inc. All Rights Reserved

Page 47: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

©2011 CloudBees, Inc. All Rights Reserved

Page 48: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

48

•  Nectar : enhanced & supported Jenkins •  DEV@Cloud : hosted software factory •  RUN@Cloud : Java PaaS

•  Public : hosted by Amazon •  Private : on your own virtualized infra

CloudBees in 5 words

©2011 CloudBees, Inc. All Rights Reserved

Page 49: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

49

•  KK is a CloudBees employee

… but CloudBees engaged to never interfere with Jenkins Lead committee

•  DEV@Cloud is awesome thanks to active opensource ecosystem !

CloudBees vs OpenSource

©2011 CloudBees, Inc. All Rights Reserved

Page 50: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

50

•  CloudBees contributes bugfixes to OSS

CloudBees vs OpenSource

©2011 CloudBees, Inc. All Rights Reserved

Page 51: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

51

•  Q&A, stabilised + supported •  Some entreprise dedicated plugins

o Security (RBAC) o Virtualisation, auto-scaling,

hypervisor integration o Jobs classification (folders) o Advanced Backup o …

Nectar value for entreprises

©2011 CloudBees, Inc. All Rights Reserved

Page 52: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

52

•  Jenkins cluster •  Multi-tenant masters •  Pool of slaves •  Automatic provisionning

– On phisical or virtual machines •  Centralised management

(plugins, upgrades, default config…)

DEV@Cloud Private Edition

©2011 CloudBees, Inc. All Rights Reserved

Page 53: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

53

•  Thanks to flexible Jenkins model •  Easiest maintenance •  Easiest contributions to oss •  All Jenkins improvements are good for

CloudBees •  All time focused on Jenkins dev&support

is good for Jenkins

All thoses features are Plugins !

©2011 CloudBees, Inc. All Rights Reserved

Page 54: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

54

) ©2011 CloudBees, Inc. All Rights Reserved

Page 55: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

©2011 CloudBees, Inc. All Rights Reserved

Page 56: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

56

•  I’m trying to for GWT-maven-plugin

Does Jenkins model apply elsewhere ?

©2011 CloudBees, Inc. All Rights Reserved

Page 57: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

57

•  lower the contribution barrier just ask to join the team !

•  release often one release per month

•  tools matter moved from codehaus svn to GitHub

•  make it transparent everything happens on googlegroups

•  choose a good lead-model myself + Olivier Lamy, may change …

•  design for extensibility more investigation required here

Applying rules

©2011 CloudBees, Inc. All Rights Reserved

Page 58: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

58

•  Future will say…

•  Allready some contributors to join : o  complaining about missing features, o  encouraged to contribute, o  added to team, o  they fixed issues by themself !

•  Salvador Diaz to analyse Pull Request •  Pierre-Yves Ricau committed 5 fixes •  .. an M2Eclipse configurator

Does it work ?

©2011 CloudBees, Inc. All Rights Reserved

Page 59: Java / Opening Open Source the Jenkins Way - Nicolas de Loof, CloudBees

59

Q&A

Thank you

©2011 CloudBees, Inc. All Rights Reserved