Build Flow Plugin with Node Label Parameter Plugin

631 views
Skip to first unread message

Katie Outram

unread,
Mar 3, 2015, 10:40:40 AM3/3/15
to jenkins...@googlegroups.com
Has anyone had success using the Build Flow Plugin with the Node Label Parameter Plugin?
 
Right now I have a build flow that executes some of the steps on Machine A and other steps on Machine B, eventhough I am passing the NODE_NAME and NODE_LABELS to the children jobs via an Environment Variable file.
 
If you have done this, do you have any suggestions on how to make certain all of the builds that are part of the flow operate on either Machine A or Machine B and not both?

Ginga, Dick

unread,
Mar 3, 2015, 10:47:03 AM3/3/15
to jenkins...@googlegroups.com

I have had good success doing this but I pass the NODE_NAME as a specific parameter:

 

Build (“AnyBuild”,

            BUILD_NODE:”BUILDHERE”)

 

Where BUILD_NODE is a NODE parameter

--
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/38fbb947-a6d2-494f-b2dd-7cad9e76a7db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Katie Outram

unread,
Mar 3, 2015, 2:31:57 PM3/3/15
to jenkins...@googlegroups.com
Thanks for this information!    This is now farther along and my entire job is building on one slave (not on both).
 
I do have one other strange thing happening now.  
 
I have two slaves configured in the node label parameter plugin, however everything is only executing on one slave, no mater how many builds I have running.   Do you have any idea as to why that is happening?

Ginga, Dick

unread,
Mar 3, 2015, 3:33:02 PM3/3/15
to jenkins...@googlegroups.com

Well, I don’t know how it chooses but I would not be surprised if there were no jobs running, that it would choose the same one first each time.

 

BTW, if your first build chooses one slave from a labeled group, you want to pass on to the next job the specific slave chosen. For example, you don’t care which Windows build machine the first job ends up on, but you want the other to follow suit.

 

def nodename=build.getBuiltOnStr()

 

out.println "This node is " + nodename

 

b = build ("second-job-core-builder",

                    BUILD_NODE:nodename)

 

Because what you want is the 2nd job to run an the specific slave that the first job selected. If you follow me?

Ginga, Dick

unread,
Mar 4, 2015, 2:49:01 PM3/4/15
to jenkins...@googlegroups.com

Found this as an explanation why you are getting builds on the same node:

Scheduling strategy

Some slaves are faster, while others are slow. Some slaves are closer (network wise) to a master, others are far away. So doing a good build distribution is a challenge. Currently, Jenkins employs the following strategy:

  1. If a project is configured to stick to one computer, that's always honored.
  2. Jenkins tries to build a project on the same computer that it was previously built.
  3. Jenkins tries to move long builds to slaves, because the amount of network interaction between a master and a slave tends to be logarithmic to the duration of a build (IOW, even if project A takes twice as long to build as project B, it won't require double network transfer.) So this strategy reduces the network overhead.

If you have interesting ideas (or better yet, implementations), please let me know.

 

 

From: Ginga, Dick
Sent: Tuesday, March 03, 2015 3:33 PM
To: jenkins...@googlegroups.com
Subject: RE: Build Flow Plugin with Node Label Parameter Plugin

 

Well, I don’t know how it chooses but I would not be surprised if there were no jobs running, that it would choose the same one first each time.

 

BTW, if your first build chooses one slave from a labeled group, you want to pass on to the next job the specific slave chosen. For example, you don’t care which Windows build machine the first job ends up on, but you want the other to follow suit.

 

def nodename=build.getBuiltOnStr()

 

out.println "This node is " + nodename

 

b = build ("second-job-core-builder",

                    BUILD_NODE:nodename)

 

Because what you want is the 2nd job to run an the specific slave that the first job selected. If you follow me?

 


Sent: Tuesday, March 03, 2015 2:32 PM
To: jenkins...@googlegroups.com

Nooram Chawla

unread,
Feb 19, 2016, 4:22:40 AM2/19/16
to Jenkins Users
Hi,

I tried passing the Build Node in the DSL and it is not working.

My Node parameter name is set to "Build_Here". 

and in DSL i am passing it as 

build("Job1",BUILD_NODE:"Build_Here")
parallel({ build("Job2",BUILD_NODE:"Build_Here") },{ build("JOb3",BUILD_NODE:"Build_Here") },{ build("JOb4",BUILD_NODE:"Build_Here") })


This is not working. The JOb 1 starts at other Node that is available.

Also, I also need to pass the SVN URL as a parameter to Job 1.

Any help will be appreciated

-Nooram.
Reply all
Reply to author
Forward
0 new messages