Running a single job multiple times against a slave pool, taking a free slave if possible before queueing the next run

760 views
Skip to first unread message

Jim

unread,
Oct 30, 2015, 9:59:53 AM10/30/15
to Jenkins Users
Hi all,

I've a couple of jobs that run against a pool of slaves, taking whichever slave is free at the time. 
The problem is, if the job is already running on a slave in the pool Jenkins queues the next run, rather than using any of the pool's free slaves.

I would like Jenkins to start a new run of the job on a free slave each time until the pool is all in use if this is possible, so on a pool of two 
slaves I could have the job running twice at the same time, with different set of tests on each run instance. If I then tried to run the job for a 
third time Jenkins would queue it until a slave became free, at which point it would than be run.

Thnks for any help,
Jim.

Victor Martinez

unread,
Oct 30, 2015, 11:38:55 AM10/30/15
to Jenkins Users
I don't know if I understood correctly, you can use the matrix job: https://wiki.jenkins-ci.org/display/JENKINS/Matrix+Project+Plugin

but it does also depend on whether other builds can use those slaves, if that job is isolated and also those slaves then use the matrix otherwise, you will probably need to groovy script something like:

 For each slave based on some filger (Jenkins.instance.slaves.findAll{ whatever filter }.each
   If it is available then run the job

Maybe someone else can suggest another way or plugin

I hope it helps

Cheers

Eric Pyle

unread,
Oct 30, 2015, 11:55:26 AM10/30/15
to jenkins...@googlegroups.com
I think all you need to do is check the box "Execute concurrent builds if necessary" in the job configuration.

Eric
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0e0c3038-74d9-4172-a93f-b1cf846055e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jim

unread,
Oct 30, 2015, 12:03:17 PM10/30/15
to Jenkins Users
Thank you, that looks like it's working as I want now. :-)

Have Fun,
Jim.
Reply all
Reply to author
Forward
0 new messages