To further clarify: Job A takes 30 minutes and job B another 30 minutes. They tie up both agents for the first 15 minutes for no reason. Now B depends on A (A uploads artifacts to a Nexus that B uses). So the truth is that I don't really mind if they run on the same agent or not (B will find A's output no matter what). What I really want is for B not to tie up an agent while it is waiting on A...
On Tuesday, 10 October 2017 10:24:03 UTC+1, Alexandros Karypidis wrote:
I have 2 jobs A and B. When B runs, it uses the (<a href="http://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin" style="text-decoration:underline;color:rgb(92,53,102);font-family:Helvetica,Arial,sans-serif;text-align:right;background-color:rgba(255,255,255,0.74902)" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwiki.jenkins-ci.org%2Fdisplay%2FJENKINS%2FParameterized%2BTrigger%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFBKylHnaME13S31XF8VBPGHLpQZg';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwiki.jenkins-ci.org%2Fdisplay%2FJENKINS%2FParameterized%2BTrigger%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFBKylHnaME13S31XF8VBPGHLpQZg';return true;">Jenkins Parameterized Trigger plugin) to trigger A to run and blocks until A finishes.
The problem is that I have 3 agents with 1 executors each and the result is that A and B usually run on different agents.
I would like to somehow achieve the following:
1) If I trigger B it should be able to pick any available agent and run there.
2) When B triggers A and waits for it, I would like A to run on the SAME agent as B.
I noticed that if I restrict A and B to a specific agent, the system "deadlocks" as A waiting for that agent which is occupied by B.
I guess what I am after is a way to chain jobs A and B into a sequence that runs on the same agent as a production line. B does not have to be active when A runs, only after A has finished.