Azure 管道:管道中单个作业中的并行任务 [英] Azure Pipelines: Parallel tasks inside single job in pipeline

查看:24
本文介绍了Azure 管道:管道中单个作业中的并行任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Azure DevOps,我正在创建一个发布管道,我希望在其中一个阶段包含 5 个步骤的 1 个作业.前三个步骤是相同的​​任务类型,但具有不同的变量,我想让它们并行,所以一些流程会像:

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:

工作

并行: step1, step2, step3

parallel: step1, step2, step3

然后: step4(在所有 3 个并行步骤成功/失败之后)

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

然后: step5(在 step4 完成后)

then: step5 (after step4 is done)

这是当前的作业设置

我不确定如何为所有这些步骤设置控制选项 - 运行此任务.我需要以某种方式将前三个设置为立即运行(可能是自定义条件always()"),并将步骤 4 和步骤 5 设置为在前面的步骤完成后按顺序运行.

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.

第 5 步可以是:即使前一个任务失败,除非部署被取消,但我不确定我是否为第 4 步设置了相同的设置,它是否只将第 3 步视为前一个或所有前三个(步骤 1 -step3) 任务.

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.

对于执行计划并行,我想将多代理设置为三个是可以的,因为我最多可以并行执行 3 个步骤.

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.

推荐答案

并行:step1、step2、step3

parallel: step1, step2, step3

如果您在一个代理作业中有 5 个任务,并且只想先并行运行前三个任务,恐怕 Azure Devops 不支持此功能.

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.

当您将多个任务放在一个代理作业中时,这意味着该任务将并且必须按顺序运行.而且,正如您在第二张图片中提到的,Multi-agent 中指定的用于运行代理作业并行,而不是运行任务并行.

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.

这篇关于Azure 管道:管道中单个作业中的并行任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆