Run job on ALL cloud (i.e. Docker) slaves including a given label

147 views
Skip to first unread message

Julianus Pfeuffer

unread,
Jan 19, 2016, 11:13:43 AM1/19/16
to Jenkins Users
Hello everybody,

currently I am desperately looking for a way to create a Jenkins job that, when launched, will be executed concurrently
on ALL slaves matching a label (or better a set of labels).
Usually (but not exclusively) my slaves will be cloud based. That means they should be fired up automatically with the Docker plugin of Jenkins.

I tried some different configurations (e.g. Elastic Axis Plugin, Matrix plugin [and its label_expressions], Restricting job to certain slaves in its configuration) but either it does not work at all or Jenkins will only fire up the job on one slave (that matches the label) only.

The method I am looking for should work on labels because I do not want to click all the slaves that should be used for a certain job everytime my configuration changes (i.e. via a slaves axis).
Has anyone found a way of doing what I envision?

Your help is highly appreciated.
Regards,
Julianus

Eric Pyle

unread,
Jan 19, 2016, 12:01:37 PM1/19/16
to jenkins...@googlegroups.com
I believe the problem is that Jenkins will not run multiple instances of a job with identical parameters. There have been posts on this list recently of users who solve this problem by adding an extra parameter which is unique for each job instance.

Regards,
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/9dfd9ba5-052b-4f23-9a05-fe2ab3ce17c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vladimir Zak

unread,
Jan 19, 2016, 12:17:59 PM1/19/16
to jenkins...@googlegroups.com

Hello,

I just set it without any problem.

You need one job which will trigger the job(s) on all slaves on all nodes with given label(s).

3rdparty_all job triggeres 3rdparty job on all nodes which fit "3rdparty" labels.

See attachments. I hope it is clear.

Best regards,

Vladimir







Date: Tue, 19 Jan 2016 08:13:43 -0800
From: jul...@googlemail.com
To: jenkins...@googlegroups.com
Subject: Run job on ALL cloud (i.e. Docker) slaves including a given label
master_job.png
slave_job.png

Jason Swager

unread,
Jan 19, 2016, 12:21:10 PM1/19/16
to Jenkins Users
Take a look at the NodeLabel Parameter plugin (https://wiki.jenkins-ci.org/display/JENKINS/NodeLabel+Parameter+Plugin).  This offers a way to start a job with a parameter that is a label and the job can run on all matching slaves.  

Julianus Pfeuffer

unread,
Jan 20, 2016, 3:42:07 AM1/20/16
to Jenkins Users
Hi Vladimir,

thank you very much for your detailed explanation. I just set up my Jenkins according to your screenshots.
The problem I am having is, that the Node label parameter factory (when given something like docker&&platformA) seems to not be able to recognize the node labels of unstarted Docker images.
I would like to have the needed images to be automatically started (and stopped once they are finished). I think unstarted images do not even have a real Nodename that can be passed as a parameter.

Do you use this setup with Docker or other clouds?

Thanks,
Julianus

Vladimir Zak

unread,
Jan 20, 2016, 4:17:23 AM1/20/16
to jenkins...@googlegroups.com
Hi,

I set it to our local cloud service a year ago. I would start the images in one job and then I use the
"3rdparty_all" job to run the things there.

But with Docker I am not much familiar because we are "windows company".

I hope this could help.

Best regards,

Vladimir






Date: Wed, 20 Jan 2016 00:42:06 -0800
From: jul...@googlemail.com
To: jenkins...@googlegroups.com
Subject: Re: Run job on ALL cloud (i.e. Docker) slaves including a given label
Reply all
Reply to author
Forward
0 new messages