OverviewLets you configure tools so that slaves will install them on demand whenever running a job that needs them. This could be especially useful when running a large farm of slaves in a cloud which all start with a minimal operating system configuration. Several techniques are already supported: run arbitrary shell command; download & unpack archive from arbitrary URL; download and install official Sun JDK, Ant release, or Maven release. The configuration is part of a tool; a project owner just picks a tool (JDK, Ant, Maven, ...) by name as usual, and may observe a build running some extra steps if it needs to perform an installation, but it is otherwise transparent. Installers can be limited to slaves marked with a label. Demo ConfigurationMasterHudson 1.311 on localhost:8080 with no executors. Node configOne JNLP slave node ubuntu-vbox with one executor and Remote FS root set to /hudson. Tool Config
Test ProjectFreestyle project, no SCM. Two build steps:
SlaveAn Ubuntu 8.10 server installation inside VirtualBox (NAT networking) with only default-jre-headless installed and user hudson added. /etc/rc.local#!/bin/sh -e su - hudson -c /hudson/slave-jnlp 2>&1 | perl -p -e 's/\n/\r\n/g' 1>&2 & /etc/sudoers# ... hudson ALL=NOPASSWD: ALL /hudson/slave-jnlp#!/bin/sh
dir=`dirname $0`
server=http://10.0.2.2:8080
node=ubuntu-vbox
while :
do
wget -O $dir/slave.jar $server/jnlpJars/slave.jar && \
java -jar $dir/slave.jar -jnlpUrl $server/computer/$node/slave-agent.jnlp
sleep 15
done
Expected project console output... Building remotely on ubuntu-vbox ... JDK: /hudson/tools/JDK_6 ... [...] $ /hudson/tools/Ant_1.7.1/bin/ant -version Apache Ant version 1.7.1 compiled on June 27 2008 Finished: SUCCESS Suggested features
Related: Tool Environment Plugin Adding new versionsHudson gets the information where to download the versions via a JSON download from the internet. The JSON data for the tools are stored in the files https://hudson.dev.java.net/svn/hudson/trunk/www/updates/, so adding a new version of an existing tool would require a path to the related file. The JSON data for some tools is created by backend/crawler in Hudson sources. More tools needed!More things should extend ToolInstallation for this system to be really useful. An incomplete list:
|