Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Jenkins 2.x - Riviera DEV

Jenkins 2.x - Riviera DEV

This talk gives an overview of Jenkins 2.x
* Why Jenkins 2.x?
* What is Jenkins 2.x?
* Steps beyond 2.x

Avatar for Vincent Latombe

Vincent Latombe

June 16, 2016

Other Decks in Programming

Transcript

  1. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved Jenkins 2.X Riviera DEV - 2016-06-16
  2. © 2016 CloudBees, Inc. All Rights Reserved About Jenkins An

    extensible automation server built on the JVM with hundreds of plugins to support nearly every continuous integration, delivery and deployment pipeline imaginable 2
  3. © 2016 CloudBees, Inc. All Rights Reserved About me Vincent

    Latombe • Long time Jenkins user and community member – January 2010 : My first discussion on the mailing list and my first ticket about Jenkins born Hudson 1.342 on ClearCase plugin. • Contributor on various plugins: – ClearCase, Mesos, Git, Literate, Maven, linenumbers… • Engineer at CloudBees, Inc – Deploying Jenkins massively on your private cloud 3 @VLatombe vlatombe
  4. © 2016 CloudBees, Inc. All Rights Reserved Developers community reaction

    to the announce 5 https://www.flickr.com/photos/kilgarron/9151943045
  5. © 2016 CloudBees, Inc. All Rights Reserved My reaction as

    a Jenkins user 6 https://pixabay.com/en/fear-fright-danger-horror-scared-1172372/
  6. © 2016 CloudBees, Inc. All Rights Reserved Let’s discuss •

    Why Jenkins 2.x? • What is Jenkins 2.0? • Road beyond 2.0… 7
  7. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved Why Jenkins 2.x?
  8. © 2016 CloudBees, Inc. All Rights Reserved • 1.x line

    is now 11 years old. No, really. • Lots of great stuff has gone into Jenkins in the last couple years but users don’t know about them! • Oh, and some fairly big changes! Why 2.0? 9 ~/Code/jenkinsci/jenkins/war (git:master %)$ mvn dependency:list ... [INFO] org.acegisecurity:acegi-security:jar:1.0.7:compile ... [INFO] org.springframework:spring-core:jar:2.5.6.SEC03:compile ... [INFO] com.google.guava:guava:jar:11.0.1:compile ... [INFO] org.codehaus.groovy:groovy-all:jar:1.8.9:compile ... Apr 2008 Oct 2008 Jan 2012 Feb 2013
  9. © 2016 CloudBees, Inc. All Rights Reserved Overwhelmed by Jenkins?

    Me too. Dear Mr Jenkins, There are too many plugins these days. Please eliminate three hundred. P.S. I am not a crackpot. 10
  10. © 2016 CloudBees, Inc. All Rights Reserved Initial Experience is

    Complicated • Installing Jenkins is easy – But then you need to find the right plugins… – And setting up security… – And eighty other things you probably forgot about… •That should be easier !! 11
  11. © 2016 CloudBees, Inc. All Rights Reserved • Continuous Delivery

    is eating the software that is eating the world. • More shops moving in this direction. • Jenkins is a key part of how they get there. • New use cases need new user interfaces - one size doesn’t always fit all. • How can we make adopting Jenkins for CD smoother without limiting the power Jenkins has for other use cases? Continuous Delivery 13
  12. © 2016 CloudBees, Inc. All Rights Reserved How do I…where

    do I…what do I… • jenkins-ci.org site is 6 years old, give or take. – Old tooling. – Awkward content discovery. – Not a great way to share documentation and guides. – wiki.jenkins-ci.org is there too, but it’s not easy to navigate. • Brand – jenkins-ci.org ! CI ?!? o Jenkins is an automation tool before everything else. 14
  13. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved Meet Jenkins 2.x jenkins-ci.org/2.0
  14. © 2016 CloudBees, Inc. All Rights Reserved 2.0 Themes New

    Jenkins Website Improved “out of the box” user experience User interface improvements Pipeline as code jenkins-ci.org/content/jenkins-20-proposals 17
  15. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved New Jenkins Website 18
  16. © 2016 CloudBees, Inc. All Rights Reserved • Wait, why

    is this part of the 2.0 release? Can’t you just update the website whenever? • Sure, but like we said, the changes we’re making to the website are to address a lot of the things 2.0 proper is addressing: – On-boarding – Plugin discovery – Documentation – Examples and resources Website as part of release? 19 59
  17. © 2016 CloudBees, Inc. All Rights Reserved New website: the

    guts • Current website – Drupal – Dynamically generated – Hard to contribute to - gotta get an account, submit a blog post, etc… • New website – Static site generation – Awestruct and Asciidoc – Contributing? Just submit a pull request to https://github.com/ jenkins-infra/jenkins.io and tada! 20
  18. © 2016 CloudBees, Inc. All Rights Reserved Better home for

    documentation and reference • What we’re calling “Solutions Pages” – Landing pages for collections of docs, blog posts, reference material and advice for specific Jenkins use cases. – i.e., a Ruby solution page, a Docker solution page, etc • A one-stop-shop for finding what you *need* to know for your Jenkins usage. • SOON: The Jenkins definitive guide, a real browsable end-user documentation 21
  19. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved Better Out-of-the-box UX
  20. © 2016 CloudBees, Inc. All Rights Reserved Out of the

    Box User Experience • New setup wizard! • Security configuration is part of the setup wizard! – …because we all forget to configure security sometimes. • A better, broader set of plugins included by default! – Less need to go hunting through 1100+ plugins. 25
  21. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved User Interface Improvements 33
  22. © 2016 CloudBees, Inc. All Rights Reserved User Interface Improvements

    • Improved “New Item” page • Tabs to organize jobs configuration pages • New Global Tool Configuration page • More consistent terminology (like agent vs node vs slave) 34
  23. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved Pipeline as Code 38
  24. © 2016 CloudBees, Inc. All Rights Reserved Pipeline as Code

    • Introduce “pipeline” as a new type in Jenkins • Codify an implicit series of stages into an explicit Jenkinsfile in your source repository or directly in your job definition • Extend the DSL with your own steps. • Built-in global library to share Pipeline scripts, functions, variables across jobs on your master. • Durable tasks keep running while the Jenkins master restarts. 39
  25. © 2016 CloudBees, Inc. All Rights Reserved Pipeline as Code

    • Execute arbitrary build steps in parallel easily. • Allow manual input from users before continuing to the next step. • A single pipeline working across multiple agents or SCM repositories. No need to glue multiple jobs together anymore. • Resume build from checkpoints (CloudBees Jenkins Platform only) 40
  26. © 2016 CloudBees, Inc. All Rights Reserved Pipeline sample node('docker')

    {
 checkout scm
 
 /* Grab the abbreviated SHA1 of our pipeline’s commit.
 */
 sh 'git rev-parse HEAD > GIT_COMMIT'
 def shortCommit = readFile('GIT_COMMIT').take(6)
 
 stage 'Build'
 def image = docker.build("jenkinsciinfra/bind:build-$ {shortCommit}")
 
 stage 'Deploy'
 image.push()
 } 41 github.com/jenkinsci/pipeline-examples
  27. © 2016 CloudBees, Inc. All Rights Reserved • Multi-Branch Pipeline

    Plugin – Job configuration only contains reference to the SCM (Git/ GitHub, BitBucket…) – Jenkins takes Pipeline from Jenkinsfile in SCM – Jenkins creates separate subtasks for branches, builds and reports results separately – Pull-request builds • Organization Folder Plugin (Same thing for GitHub and BitBucket orgs) – 1 single spec in Jenkins for the many projects – Jenkins creates separate multi-branch folders for each repository Pipeline Features. Multi-Branch 48
  28. © 2016 CloudBees, Inc. All Rights Reserved • More plugin

    integrations • Pipeline syntax highlighting and docs in IDE • Graphical editor of Jenkins pipelines Pipeline - Coming soon… 53
  29. © 2016 CloudBees, Inc. All Rights Reserved Graphical Pipeline Editor

    54 https://github.com/jenkinsci/pipeline-editor-plugin
  30. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved 2.x Timeline / Roadmap 55
  31. © 2016 CloudBees, Inc. All Rights Reserved • April 21st

    • Jenkins 2.0 tagged and released • April 25th • Jenkins 2.0 announced • This summer (~July) • First LTS based on 2.x will be released • 1.x maintenance will be stopped 2.x Timeline / Roadmap 56
  32. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved Road Beyond 2.0
  33. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved 2.0 Retrospective 58
  34. © 2016 CloudBees, Inc. All Rights Reserved 2.0 Retrospective •

    Discussing “2.0” started conversations about much bigger and involved changes • The “weekly incremental release” model has left big challenges unaddressed • Aging user interface layer is difficult to substantially improve 59 https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+2.0
  35. © 2016 CloudBees, Inc. All Rights Reserved ten·ta·tive (tĕn′tə-tĭv) adj.

    Not fully worked out, concluded, or agreed upon; provisional 60
  36. © 2016 CloudBees, Inc. All Rights Reserved Themes Continuous Delivery

    Scalability & Availability User Experience 61
  37. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved Continuous Delivery 62
  38. © 2016 CloudBees, Inc. All Rights Reserved Continuous Delivery •

    Model “Application” and “Environments” in Jenkins • Inform Jenkins of what happens with them – synchronous: build owns the deployment – asynchronous: external reporters/deployment tools notify Jenkins upon completion • Expose what’s “in” Environments – Differences between deployments, e.g. commits, tickets, etc 63
  39. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved Scalability & Availability 64
  40. © 2016 CloudBees, Inc. All Rights Reserved Storage & Availability

    • Configurations, build records, logs, fingerprints and artifacts all currently live on master node • Reduce local disk dependency on master node • Pluggable storage backend – BYODB (bring your own data backend) 65
  41. © 2016 CloudBees, Inc. All Rights Reserved Storage & Availability:

    Clustering • Break the single-JVM master node into a conceptual “master” across multiple JVMs • Prevent need for “hard downtime” to modify, etc • Must still run as a single instance • Evaluate multi-tenancy via: – Access controls – Per-folder configuration separation – ? 66
  42. © 2016 CloudBees, Inc. All Rights Reserved Storage & Availability:

    Clustering • Defer more “master” work out to separate JVMs • Develop more “stateless” components which can scale horizontally 67
  43. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved More UI improvements 68
  44. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved Blue Ocean A new user experience for Jenkins 70 https://jenkins.io/projects/blueocean/
  45. © 2016 CloudBees, Inc. All Rights Reserved • Javascript toolchain

    • ES6, React, NPM • js-modules • Client-side Extension Points • Blue Ocean libraries are built on ES6 and React.js and provide an extensible client-side component model • Server Sent Events • UI updated in real time Modern Toolset 71
  46. © 2016 CloudBees, Inc. All Rights Reserved • Jenkins 2.x

    is a new start for the community. • But 2.x is just a drop-in replacement for 1.x – With the exception of the servlet 3.1 (Java EE 7) container pre- requisite (Apache Tomcat 8, Wildfly 8, Glassfish 4, Websphere 9...) • All the technical evolutions (like javascript modularization) are in place to revolution Jenkins in a near future. • The usage of major versions is a good change which will enforce to identify and accept breaking changes to – define a clearer roadmap for users ( 3.x, 4.x, …. ) – organize this middle/long term work within the team Conclusion 80
  47. © 2016 CloudBees, Inc. All Rights Reserved Try out Jenkins

    2.0 now! • Jenkins 2 is here! • Download and discover it from – jenkins.io / jenkins.io/2.0 • Give weekly releases a try and share your feedback with the community • [email protected] • #jenkins IRC channel on Freenode 81
  48. © 2016 CloudBees, Inc. All Rights Reserved Useful links •

    Jenkins project – Website: http://jenkins.io – GitHub: https://github.com/jenkinsci/ • Samples • https://github.com/jenkins-demo • CloudBees – Website: https://www.cloudbees.com – CloudBees Jenkins Platform o https://www.cloudbees.com/products/cloudbees-jenkins-platform 82
  49. © 2016 CloudBees, Inc. All Rights Reserved Greetings • Thanks

    to R. Tyler Croy, Oleg Nenashev and James Dumay for all the inputs to create this presentation • Thanks to Arnaud Heritier who created the first version of this slide deck. 83
  50. © 2016 CloudBees, Inc. All Rights Reserved © 2016 CloudBees,

    Inc. All Rights Reserved Questions and (perhaps) Answers