Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Pipelines: Parallel tasks inside single job in pipeline

Using Azure DevOps, I am creating a release pipeline in which I would like to have one stage having 1 job with 5 steps. First three steps are same task types but with different variables, and I would like to make them parallel so some flow would go like:

Job

parallel: step1, step2, step3

then: step4 (after all 3 parallel steps succeeded/failed)

then: step5 (after step4 is done)

This is the current job setup

This is current job setup

I am not sure how to set up Control Options - run this task for all of these steps. I would need somehow to set the first three to run immediately (maybe Custom condition "always()") and step 4 and step 5 to run sequentially after previous steps are done.

Step 5 can be: Even if the previous task has failed unless the deployment was cancelled, but I am not sure if I set the same setting for step 4 will it consider only step 3 as previous or all three previous (step1 - step3) tasks.

Also for Execution plan Parallelism I guess it's ok to set multi-agent to three since I would have max 3 steps executing in parallel overall.

Job parallelism

like image 453
ldragicevic Avatar asked Aug 11 '19 21:08

ldragicevic


People also ask

Can a azure pipeline have multiple triggers?

Yes, you can have multiple . yml files with any name really. When you create the build pipeline, you pick and reference the existing yaml.

How do I run multiple pipelines in Azure DevOps?

If you want to trigger both the pipelines simultaneously at a single time, you would consider set up self-hosted agents or pay microsoft-hosted agents.


1 Answers

parallel: step1, step2, step3

If you have 5 task in one agent job, and just want to run previous three tasks parallel first, I'm afraid to say that this does not supported in Azure Devops.

While you put several tasks in one agent job, that's means the task will and must running in order. And also, as you mentioned in the second pic, the specified in Multi-agent is used for run agent job parallel, rather than run task parallel.

Fortunately, until now, there has been such suggestion raised by other user in our official Developer Community. And there are many users has the same demand with you. You can vote and comment there. Our Product Group team will take your suggestions kindly. If it has enough votes which means its high priority, and the team will consider it seriously.

like image 118
Mengdi Liang Avatar answered Nov 11 '22 17:11

Mengdi Liang