Run jobs in sequence in one agent

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Run jobs in sequence in one agent

Alexandros Karypidis
Hello,

I have 2 jobs A and B. When B runs, it uses theĀ (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.

Thanks

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1f48b703-5bd7-42a7-9d54-4c67cb8ce7b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Run jobs in sequence in one agent

Alexandros Karypidis
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:
Hello,

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=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwiki.jenkins-ci.org%2Fdisplay%2FJENKINS%2FParameterized%2BTrigger%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFBKylHnaME13S31XF8VBPGHLpQZg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwiki.jenkins-ci.org%2Fdisplay%2FJENKINS%2FParameterized%2BTrigger%2BPlugin\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFBKylHnaME13S31XF8VBPGHLpQZg&#39;;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.

Thanks

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/416fd4a3-f1dc-4c20-9a9d-e21b3e8ba07d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.