3
votes

I have created a release pipeline with five agent jobs and I want to start all five jobs at the same time.

example:

vsts

In example I need to start all agent jobs simultaneously, and execute unique task (wait 10 seconds) at the same time.

Does VSTS (Azure DevOps) have option to do this?

4
Why you not put the 5 tasks in one agent job and run the job simultaneously like the answers below?Shayki Abramczyk

4 Answers

4
votes

You could also just use 5 different stages (depending on what exactly it is you're doing). Then you can leverage the full power of the pipeline model, have pre and post stages, whatever you wish. This is as mentioned in the other answers also possible with different agent jobs but this is more straight forward. Also you can easily clone stages.

I'm not sure what it is what you're trying to achieve with waiting for 10 seconds, but this is very easy to do with a PowerShell step. Select the radio button "Inline" and type this:

Start-Sleep -Seconds 10

Example of a pipeline, that might do the simultaneous work that you want, but keep in mind, each agent job (doesn't matter multiple jobs in one stage or multiple single job stages) has to find an agent that is capable, available and idle, otherwise the job(s) will wait in a waiting queue!!!

enter image description here

2
votes

In the release pipeline click on "Agent job", then expand the "Execution plan" and click on "Multi-agent".

enter image description here

1
votes

I think you need to create 5 stages since for the release pipeline in the Azure devops, jobs in one stage could not be paralleled.see documents from Microsoft Or if you want to run the same set of set of tasks on multiple agents, you could use the option Multi-agent as shown below. ADO Multi-agent option

-1
votes

If you want a job to be executed in parallel then choose multi-agent configuration, but if you have 5 (very) different jobs then you can choose "Even if a previous job has failed" from the dropdown "Run this job".

This is by default set to "Only when all previous jobs have succeeded" which means that:

  1. All of your 5 jobs will be executed sequentially in the order that you've set them up
  2. The chain of jobs will come to a stop as soon as one of the jobs fails

Take note that you can specify individually on what agent queue what job will execute, by default they're all going to the same queue, if you run 5 jobs in parallel on a single queue, then this queue should have 5 agents available and idle to get what you're expecting.

enter image description here