tags:

views:

234

answers:

3

I am setting up a number of slaves to my Hudson master, grouped by labels. I would like to be able to have a set of nodes that run during the day and an additional set of nodes that are turned on during the evening.

Is this possible, either directly by hudson or via plugin or script? If so what is your recommended solution?

A: 

Let the OS (or any other scheduler) control the start and stop of a node. Hudson only uses what's available. Not sure how Hudson acts if a node dies while running a job.

Peter Schuetze
Before a node shuts down, you could use the Hudson API to mark the node offline. I'm not sure of the exact syntax, but most Hudson operations can be performed with an appropriate HTTP request.
Dave Bacher
A: 

Expanding on what @Peter Schuetze said...

Unless the nodes are VMs that you want Hudson to manage (see the VMware plugin), the start and stop operations are out of Hudson's control. Depending on how you have your slaves set up, Hudson may just automatically connect when it sees the node is online, or you may need to make sure the slave runs something at startup.

You can use the Hudson API (generally HTTP POSTs to URLs on the Hudson master) to tell Hudson that nodes are going offline ahead of time. This will help avoid builds that get killed when the node goes down. Check out the HTML source on the node's page (http://hudson/computer/node_name) to see what the web interface does for the "mark offline" and "disconnect" operations.

Dave Bacher
+1  A: 

There is an experimental feature to schedule when each slave should be available. It is in core, but you have to set a system property to enable it. So if you start Hudson with

java -Dhudson.scheduledRetention=true -jar hudson.war

You will get an extra configuration option on each node, allowing you to specify a schedule of when that node should be used.

Michael Donohue

related questions