Jenkins execute part of the job on master?

1,286 views
Skip to first unread message

Michael Lasevich

unread,
Jul 2, 2013, 12:17:31 PM7/2/13
to jenkins...@googlegroups.com
Trying to understand master-slave relationship in jenkins node. 

Is it possible to execute MOST of the job (build) on a slave node, but the final step (one or more publishers?) on the master node?

If I am writing my own plug in, how do I control where the plugin executes? Or can I?


Thanks,

-M

Mark Waite

unread,
Jul 2, 2013, 1:07:13 PM7/2/13
to jenkins...@googlegroups.com
As far as I can tell, a job executes on a single node, whether master or slave.  I'm not aware of any facility that allows a Jenkins job to move execution steps to a node different than the node executing the job.

Mark Waite


From: Michael Lasevich <mlas...@gmail.com>
To: jenkins...@googlegroups.com
Sent: Tuesday, July 2, 2013 10:17 AM
Subject: Jenkins execute part of the job on master?

--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Steven Deal

unread,
Jul 2, 2013, 1:16:19 PM7/2/13
to jenkins...@googlegroups.com
I think publishing happens on the master. So in that sense, different phases of the build can happen on different machines. If you want a plugin to only run on the master, I would think making your plugin extend Recorder would have it execute on master. I'm not sure what all your choices are here though.

lom109

unread,
Jul 3, 2013, 2:51:23 PM7/3/13
to jenkins...@googlegroups.com
You can produce this behaviour if you decide to use the Groovy Plugin.

It lets you "set up the environment" using groovy ON the master... which means you can run arbitrary setup logic on the master before you "copy over" any artifacts to the slave.

Which isn't what the OP requested.. but throwing that out there.

Michael Lasevich

unread,
Jul 5, 2013, 12:44:22 PM7/5/13
to jenkins...@googlegroups.com, Steven Deal
Unless I am missing some finer detail "Publishing tasks" are same as "post-build tasks". I have tried running a script from post-build - but that also executes on the slave node.

I am considering separating my job into 2 jobs, triggering one from the other and pass info between them via "copy artifacts" - but I am not sure if copy artifacts will work in this scenario. Its an ugly solution though, as I will have to make part of my source as "artifact" to pass it

Thanks.

-M
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/GidC6--i5_E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.

Michael Lasevich

unread,
Jul 5, 2013, 12:52:09 PM7/5/13
to jenkins...@googlegroups.com, lom109
Thanks, this actually works in the sense that I can definitely force execution on the master. At the very least this allows me to look at the code for this to figure out how this is done. I think I have a bigger issue though because the workspace files I need may not be on the master at that point. Need to think this through a bit more, but it is a great starting point. Thanks again!

-M
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/GidC6--i5_E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages