83
Jenkins Evolutions Anton Arhipov ZeroTurnaround JRebel @antonarhipov http://arhipov.blogspot.com

Jenkins Evolutions - JEEConf 2012

Embed Size (px)

Citation preview

Page 1: Jenkins Evolutions - JEEConf 2012

Jenkins Evolutions

Anton ArhipovZeroTurnaroundJRebel

@antonarhipovhttp://arhipov.blogspot.com

Page 2: Jenkins Evolutions - JEEConf 2012

Why Evolutions?

Page 3: Jenkins Evolutions - JEEConf 2012

Why Evolutions?

test automation

Page 4: Jenkins Evolutions - JEEConf 2012

Why Evolutions?

continuousintegration

Page 5: Jenkins Evolutions - JEEConf 2012

Why Evolutions?

continuousdeployment

Page 6: Jenkins Evolutions - JEEConf 2012

Why Evolutions?

cron on steroids

Page 7: Jenkins Evolutions - JEEConf 2012

Agenda

Background

Stories• Functional tests• Servlet tests• Scaling

Random stuff

Page 8: Jenkins Evolutions - JEEConf 2012

Background - 2008

First installation

Clicked “Run” when wanted to test stuff

Page 9: Jenkins Evolutions - JEEConf 2012

Background 2012

54 215 324 jobs2 5 8 dedicated machinesAmazon ~7000 instance-hour per month3 in house plugin developedCustom dashboard (50 x 300 grid)

Page 10: Jenkins Evolutions - JEEConf 2012
Page 11: Jenkins Evolutions - JEEConf 2012

https://github.com/ jenkinsci/ jenkins-scripts

Page 12: Jenkins Evolutions - JEEConf 2012

Custom Dashboard

Page 13: Jenkins Evolutions - JEEConf 2012

story of functional tests

Page 14: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Page 15: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Page 16: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Per JDK• Per functional test• Compile couple of classes• Run some methods and assert• Recompile couple of classes• Run some methods and assert• …

Page 17: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Per JDK• Per functional test• Compile couple of classes• Run some methods and assert• Recompile couple of classes• Run some methods and assert• …

Page 18: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Per JDK• Per functional test• Compile couple of classes• Run some methods and assert• Recompile couple of classes• Run some methods and assert• …

Page 19: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Per JDK• Per functional test• Compile couple of classes• Run some methods and assert• Recompile couple of classes• Run some methods and assert• …

Page 20: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Per JDK …Which Jenkins feature is the best here?

Page 21: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Configuration matrix FTW!

Page 22: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Executed with a Groovy script

Page 23: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Page 24: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

How to get results? Jenkins feature…

Page 25: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Output JUnit XML!

Page 26: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Page 27: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Creates ~ 10 000 new filesCompile ~ 1700 java classesInvoke the JVM ~ 550 times

Page 28: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Sloooooooow!

Page 29: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

I/OCPUMemory

Page 30: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Page 31: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Bare metalCloudBare metal (+ cloud)

Page 32: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Cloud• 1 small instance per JDK• Manual update of AMIs• Slow• Scales!

Page 33: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Which Jenkins plugin to use?

Page 34: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Amazon EC plugin

Page 35: Jenkins Evolutions - JEEConf 2012

JRebel Functional JDK Tests

Bare metal• 8 core & 16GB RAM gaming

machines• Recycled developer machines• Marketing demo machines (iMac)• Developer machines, ad-hoc (?)

Page 36: Jenkins Evolutions - JEEConf 2012

JenkinsMaster

Page 37: Jenkins Evolutions - JEEConf 2012

JenkinsMaster

WindowsWindowsWindows

*nix*nix*nix*nix*nix

Page 38: Jenkins Evolutions - JEEConf 2012

JenkinsMaster

WindowsWindowsWindows

*nix*nix*nix*nix*nixAWS

Page 39: Jenkins Evolutions - JEEConf 2012

JenkinsMaster

WindowsWindowsWindows

*nix*nix*nix*nix*nixAWS

My Laptop

iMac

Page 40: Jenkins Evolutions - JEEConf 2012

Adding new machines

How to manage the configurations?How to automate the setup?

Page 41: Jenkins Evolutions - JEEConf 2012

Adding new machines

Chef, Puppet

Page 42: Jenkins Evolutions - JEEConf 2012

Taming I/O

SSD: ~30% performance gain

Page 43: Jenkins Evolutions - JEEConf 2012

story ofservlet tests

Page 44: Jenkins Evolutions - JEEConf 2012

Servlet Tests

Start a container version• WebSphere, Weblogic, JBoss, etc

Deploy applications

Test results, reload changes, test results, …

Page 45: Jenkins Evolutions - JEEConf 2012

Custom Dashboard

Page 46: Jenkins Evolutions - JEEConf 2012

Servlet Tests

How to start a server?

Page 47: Jenkins Evolutions - JEEConf 2012

Servlet Tests

Duh! With a startup script!

Page 48: Jenkins Evolutions - JEEConf 2012

Servlet Tests

Problem: 1 app server, 2 jobs. Which plugin to use?

Page 49: Jenkins Evolutions - JEEConf 2012

Servlet Tests

Throttle Concurrent Builds plugin

Page 50: Jenkins Evolutions - JEEConf 2012

Servlet Tests

Page 51: Jenkins Evolutions - JEEConf 2012

Servlet Tests

How do you deploy an application?

Page 52: Jenkins Evolutions - JEEConf 2012

Servlet Tests

Start TomcatCopy WAR files to webapps/GET /some-urlAssertUpdate applicationGET /some-urlAssert

Page 53: Jenkins Evolutions - JEEConf 2012

Servlet Tests

Sloooooooow!

Page 54: Jenkins Evolutions - JEEConf 2012

Servlet Tests

I/OCPUMemory

Page 55: Jenkins Evolutions - JEEConf 2012

Testing Multiple Containers

Cloud• 1 small instance per container• Need to update AMIs• Slow• Isolation

Page 56: Jenkins Evolutions - JEEConf 2012

Testing Multiple Containers

Single machine• Port hell• Memory limits• Fast(er)!

Page 57: Jenkins Evolutions - JEEConf 2012

story ofDVCS

Page 58: Jenkins Evolutions - JEEConf 2012

Story of DVCS

Problem• Many servers• Many containers• Many tests• Many JDKs

Slow feedback cycle

Page 59: Jenkins Evolutions - JEEConf 2012

Story of DVCS

DEVN tests on N servers

(30 minutes)

STABLEM tests on M servers

(3 hours)

Tests green?Push to branch/repository

Page 60: Jenkins Evolutions - JEEConf 2012

Story of DVCS

Page 61: Jenkins Evolutions - JEEConf 2012

Story of DVCS

Page 62: Jenkins Evolutions - JEEConf 2012

scalability

Page 63: Jenkins Evolutions - JEEConf 2012

Story of Scaling

Problem• Exponential growths of tests

• (containers) X (configurations) X (tests) + const

• Fight for executors

Page 64: Jenkins Evolutions - JEEConf 2012

Story of Scaling

Add more machines?Spin up more cloud instances?Attach developer machines at night?Cut tests scope?

Page 65: Jenkins Evolutions - JEEConf 2012

Story of Scaling

Jenkins helps with elasticity!

Page 66: Jenkins Evolutions - JEEConf 2012

Story of Scaling

Jenkins helps with elasticity!

WIN!

Page 67: Jenkins Evolutions - JEEConf 2012

random stuff

Page 68: Jenkins Evolutions - JEEConf 2012

Random Stuff

There’s an app plugin for that!

Page 69: Jenkins Evolutions - JEEConf 2012

Some Cool Plugins

Mercurial pluginThrottle Concurrent Builds pluginMatrix Configuration pluginMatrix Reloaded pluginSSH slaves pluginPublish over SSH pluginCopy Artifact pluginCopy to slave plugin

Page 70: Jenkins Evolutions - JEEConf 2012

Some Cool Plugins: Continuous Deployment

Build Pipeline pluginParametrized Trigger pluginDownstream Buildview pluginFingerprints

http://zeroturnaround.com/blog/how-to-use-jenkins-for-job-chaining-and-visualizations/

Page 71: Jenkins Evolutions - JEEConf 2012

Some Cool Plugins

Chuck Norris plugin

BUILDSUCCESSFUL

Page 72: Jenkins Evolutions - JEEConf 2012

Some Cool Plugins

Chuck Norris plugin

BUILD FAILED

Page 73: Jenkins Evolutions - JEEConf 2012

Build-it-all!

JRebel

Page 74: Jenkins Evolutions - JEEConf 2012

Build-it-all!

JRebel

Page 75: Jenkins Evolutions - JEEConf 2012

Build-it-all!IntelliJ

NetBeans

Eclipse

Installer

JRebel

Page 76: Jenkins Evolutions - JEEConf 2012

Build-it-all!IntelliJ

NetBeans

Eclipse

Installer

JRebel

Page 77: Jenkins Evolutions - JEEConf 2012

Build-it-all!IntelliJ

NetBeans

Eclipse

Installer

JRebel

Tests

Page 78: Jenkins Evolutions - JEEConf 2012

UI

Page 79: Jenkins Evolutions - JEEConf 2012
Page 80: Jenkins Evolutions - JEEConf 2012
Page 81: Jenkins Evolutions - JEEConf 2012
Page 82: Jenkins Evolutions - JEEConf 2012
Page 83: Jenkins Evolutions - JEEConf 2012

Questions?