Doron Shai
Doron Shai

Reputation: 698

Jenkins Build Distribution among Slaves

I need to get some advice about the way to control the way Jenkins Slaves are used / Jobs are being triggered.

Background / Constraints:

  1. I have a sequence of 10 jobs that run one after each other using the "Trigger parameterized build on other projects" option Parameterized Trigger Plugin.

  2. Each Build of these jobs must run on the same node (I am doing it by using "Build on the same node" which is also configured in the parameterized build plugin and comes from the NodeLabel Plugin).

  3. I have 5 Slaves (current number of executors per slave is 1 but i am open for suggestions here...)

  4. Once Slave is occupied by a Build Sequence, no other job can run on it. When I had only 1 slave, the way I enforced it was using the "Block build when downstream project is building"

  5. The way I configured the slave to be chosen when the first Job is triggered is one of the following: (None of them solved my problem)

    a. Using the "Restrict where this project can be run" and put there a label that all relevant slaves will point to.

    b. Using the option of "This build is parameterized" (Parameterized Trigger Plugin) and then add a "Node" parameter with the list of Slaves that the User can choose from.

What I want to achieve?

Any suggestions how to solve it?

Thanks!

Upvotes: 1

Views: 1550

Answers (2)

sidu
sidu

Reputation: 12

Try node-label parameter plugin. you can make Jobs to run slave node which is free at that movement

Upvotes: 0

Electrawn
Electrawn

Reputation: 2254

Try passing ${NODE_NAME} as a NodeLabel as a post-build trigger to the downstream jobs. If that works, you may need to pass it every job.

Upvotes: 0

Related Questions