---------- Forwarded message --------- From: kamthe kirtee <[hidden email]> Date: Mon, 5 Apr, 2021, 4:36 pm Subject: How to run upstream and downstream jobs on same executor To: <[hidden email]> Hi team, Suppose in jenkins I have 1 slave and in that slave I have 1 executor Also I have one upstream job and one downstream job My question is: If an upstream job is running on executor 1, and after that my downstream job is starting on the same executor at the same time, & I want upstream job to go aside/queue untill the downstream job is over. Once the downstream job is over, the paused upstream job should again resume start running on the same executor. So how We can achieve this? Because I don't want to increase the number of executors Can you please guide me for the same? 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/CAD0fyGieWSsj%3DmAtLQEyuOkn0h5Y_q%2BGpf1oEZ%3DMKYfYS20mEw%40mail.gmail.com. |
If I take the words precisely as you stated them, I don't think you can run multiple jobs at the same time on the same agent with only 1 executor. With only 1 executor, only 1 job can be executed on that agent.
If you would like to have the downstream job run on the same agent as the upstream job, you might look at the node label parameter plugin. It has the ability to assign a downstream job to run on the same agent as the upstream job that starts the downstream job. Mark Waite On Monday, April 5, 2021 at 6:01:06 AM UTC-7 Kitu wrote:
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/2a588296-0fe6-4ed7-b7c6-ebae68c2b34bn%40googlegroups.com. |
In reply to this post by kamthe kirtee
Hi, from what I know, it's not achievable. When a job is waiting for a downstream to complete, it keeps an executor occupied. So, the downstream job needs to run on a different executor. But, frankly, that seems more of https://xyproblem.info/ :-) So, what is your problem? what do you need? Cheers, Gianluca.
On 05/04/2021 12:36, kamthe kirtee
wrote:
-- 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/60c42944-94fb-b406-65d2-e5f905e81af6%40gmail.com. |
Hi, My question is if upstream job is running on executor 1 and when downstream job is triggered, that should run on executor 1 or executor 2 As soon as downstream job started running, upstream job should not be running on any of the executor. Beacuse I don't want upstream job to wait for the downstream job to complete and also not to occupied executor unnecessarily. Thanks On Mon, 5 Apr, 2021, 8:49 pm Gianluca Massera, <[hidden email]> wrote:
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/CAD0fyGiVtQ5p%3DZGdNwaFTPXE6XJxVuEUvkXiJgv%3DF4hAGvb0vA%40mail.gmail.com. |
Hi, From what I know, a job will keep an executor busy till it completes. Hence, if an upstream job needs to do something after a downstream completes, then Jenkins needs two executors. Otherwise, if an upstream job doesn't need to anything after a downstream completes, then you trigger a downstream with wait options set to false and if there is only one executor Jenkins will queue the downstream job till the upstream completes and the executor will be free to run something else. Is it clear? Also, "waiting for something" even though doesn't need much CPU
still needs some processing power, hence you need an executor,
hence is not occupied unnecessarily ... it's occupied to do what
you asked for: "wait for something" ;-) Hope that helps. Cheers, Gianluca.
On 05/04/2021 17:18, kamthe kirtee
wrote:
-- 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/3fd8068d-010e-a5e7-3992-ab26dd6721ed%40gmail.com. |
Free forum by Nabble | Edit this page |