Escolar Documentos
Profissional Documentos
Cultura Documentos
SF JUG
Kohsuke Kawaguchi
Sun Microsystems, Inc.
Rise of Continuous
Integration
Offload
from people, push to
$ computers
co m p u te rs
p e o p le
tim
2
Spend more CPU power to
help you
First
on your laptops and
workstations
IDEs are at the forefront
And then to the servers
a.k.a. “Continuous Integration”
More frequent build/test executions
Static code analysis tools
And more to come
3
Hudson
h ttp s:// h u d so n -cio
. rg /
Open-source CI server
Emphasis on ease of installation and
use
“java -jar hudson.war” execution
Or your OS-specific package
Configure everything from browsers
Extensibility
230+ community-developed public
plugins
By 230+ contributors
Estimated 13,000 installations 4
Adoption in all kinds of
businesses
5
Support Subscriptions
6
Basic Feature Set
12
FindBugs integration
13
Tracking changes
14
… and more
15
Inter-Project Support
SQE test
18
Build Promotion
19
Got the idea?
Automation
Reduce turn-around time
Make things transparent
Remove people from the loop
Save people’s time
Push jobs to servers, keep
workstations idle for you
20
Doing Distributed Builds
21
Why?
22
Installing new slaves
For
first 20 or so slaves, we did it
manually
Insert CD, click, type, click, type, click,
…
But that doesn’t scale
Then we automated
Available as “Hudson PXE Plugin”
23
Automated System
Installations
H u d so n + P X E plugin
>
lIS O im a g e s o f O S
l
l
Slaves
Power on, hit F12
PC boots from network
(PXE)
24
Automated System
Installations
H u d so n + P X E plugin
>
lIS O im a g e s o f O S
l Your corporate IT
guy & his DHCP
l server
Slaves
Power on, hit F12
PC boots from network
(PXE)
Choose OS from menu
Installs non-interactively
25
Distributed builds with
Hudson
Master
Serves HTTP
requests
Stores all important
info
Slaves
170KB single JAR
Assumed to be
unreliable
Scale to at least 100
Link
Single bi-di byte 26
How master and slaves
start talking
For Unix slaves, via SSH
Only need SSHD and JRE on slaves
We just need a host name
27
How master and slaves
start talking
For Windows, DCOM
We just need admin user name and
password
No manual intervention
Works even from Unix masters
28
How master and slaves
start talking
Via Java Web Start
When master cannot see slaves
A separate socket connection is made
29
Automating JNLP launch
Once
started, can be installed as
Windows service
30
Automating JNLP launch
31
Automated Tool
Installation - JDK
JDK from http://java.sun.com/
Hudson automatically chooses the
right bundle
Always up to date with new releases
32
Automated Tool
Installation - Apache
Ant and Maven from Apache
33
Heterogeneous Cluster
Challenge
Your builds/tests need to run in specific
environment
Dependency on individual nodes hurts
utilization
jobs slaves
Wombat
Windows test Windows #1
GlassFish
Windows test Windows #2
34
Labels to rescue
Wombat
Windows test Windows #1
Windows
GlassFish
Windows test Windows #2
35
Concurrent Builds
Hudson #10
Hudson #11
Hudson #12
Hudson #13
Hudson #14
Hudson #15
time
36
Making builds sticky
38
Clean up mess after
builds
Kill run-away processes
Daemons, background processes left
by your build
Works on Windows, Linux, Mac, and
Solaris
39
Load Statistics
Monitoring
40
When it’s time to add more
slaves
41
Hudson EC2 plugin
Automatically
provisions slaves on
EC2 on demand
Based on the current load
Picks the right AMI depending on
demand
Starts slave agent
Shuts down unused instances
42
Putting it all together
capacit
y
# of
executors
time
43
Hudson “Appliance” on
EC2
Run
the master in the cloud too, if
you like
Hudson on stock OpenSolaris AMI
Data stored persistently in Elastic
Block Storage
▪ Dynamically expandable thanks to ZFS
▪ Online, too
Packaged as a wizard
44
And a lot more I couldn’t
show
IDE plugins
iPhone/Android apps
REST API and CLI
Deployment Automation
Hadoop, Selenium
…
45
Conclusions
CI is here to stay
Using lots of PCs is a key
46
Q&A
Kohsuke Kawaguchi
Sun Microsystems, Inc.
Compartmentalization
full Metro build #10 full Metro build #11
Faster feedback
Good engineering practice anyway
Isolation of problems
48
Automated System
Installations
SupportsOpenSolaris, Ubuntu,
CentOS, Fedora
Trivial with most Linux
Cooperate with Windows, too