2

We have deployed Azure devops Self-hosted Agent in our own agentpool.

enter image description here

We have also purchased 4 parallel job per agent , but when our build runs, it runs only one job at a time and other pipeline/release jobs have to wait.

How can we run 4 parallel pipeline/release jobs ?

enter image description here

user888263
  • 111
  • 2
  • 12
  • So what Monthly purchase 4 will do ? We want only one Agent and run 4 jobs in parallel . If we build 4 agents then no purchase of parallel job required – user888263 Apr 16 '21 at 12:00
  • Monthly purchase 4 allows you to run 4 more parallel jobs. Currently, you can run 46 parallel jobs. Without Monthly purchase 4, you can only run 42 parallel jobs. This refers to the number of parallel jobs you can run. – Hugh Lin Apr 19 '21 at 09:39
  • And running a parallel job needs to occupy one agent, so the parallel jobs you can actually run are also determined by how many self-hosted agents you set. – Hugh Lin Apr 19 '21 at 09:40
  • 1
    So basically Azure Devops offers only one executor per agent . Is there a enhancement in future to have multiple executors per agent ? – user888263 Apr 20 '21 at 12:01
  • Yes, open the run.cmd in the local agent folder, you can find that in the cmd window, if you want to run the next job, you need to wait for the previous run to complete, just like you can't execute two commands at the same time in a cmd.exe . So I am afraid it's not possible to have multiple executors per agent. – Hugh Lin Apr 21 '21 at 07:39
  • Answer was helpful but I was really hopping that ADO provide same capability as Jenkins a multiple executors – user888263 Apr 28 '21 at 12:41
  • You could add your request for this feature on our [UserVoice](https://developercommunity.visualstudio.com/report?space=21&entry=suggestion) site , which is our main forum for product suggestions. – Hugh Lin Apr 30 '21 at 05:15
  • Can we restrict the parallel jobs on a self hosted agent ? – Abdul Mohsin Jul 01 '21 at 12:03

2 Answers2

4

How can we run 4 parallel pipeline/release jobs ?

According to your screenshot, you seem to only register one self-hosted agent, and running a parallel job will consume one agent, so if you want to run 4 jobs in parallel, you need to register at least 4 self-hosted agents.

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25
0

Running parallel jobs on the same agent can be achieved by container jobs

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/container-phases?view=azure-devops-2019#multiple-jobs-with-agent-pools-on-a-single-hosted-agent

There is a small gotcha around being logged out when multiple jobs are running at the same time and a Docker workaround suggested here

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/container-phases?view=azure-devops-2019#multiple-jobs-with-agent-pools-on-a-single-hosted-agent

Ricky Gummadi
  • 4,559
  • 2
  • 41
  • 67