azure - 限制 Azure DevOps Pipeline 中的并行作业数量
问题描述
我想将工作限制为 parallel-10 。我的总工作量约为 150。如何在下面的 yaml 结构中定义“策略:并行”。我为每个循环创造了 100 多个工作。因此需要 1 多个小时才能完成,并且还使用了所有代理。所以想限制代理。有人可以帮忙吗?
下面的代码:
stages:
- stage: xxx
jobs:
- ${{ each v in parameters.vvv }}:
- template: Templates/aa.yml
parameters:
解决方案
如文档中所述,使用具有parallel
ormatrix
策略的作业。您可以设置最大并行度。
jobs:
- job: string # name of the job (A-Z, a-z, 0-9, and underscore)
strategy:
parallel: # parallel strategy; see the following "Parallel" topic
matrix: # matrix strategy; see the following "Matrix" topic
maxParallel: number # maximum number of matrix jobs to run simultaneously
推荐阅读
- mongodb - 连接到 Mongo DB 的 Masstransit Saga 类中的异常
- c# - 为什么没有 await 关键字以下代码无法运行?
- java - 错误:程序类型已存在:com.google.firebase.auth.FirebaseAuthException
- android - 如何在 Kotlin 中调整图像文件的大小
- r - 将因子转换为数字,带有点、千 (K) 和百万 (M) 缩写
- assembly - 如何使用 Cmake 通过 NASM 构建二进制文件
- javascript - 使用示例演示中的布局时获取“失败的道具类型:提供给“布局”的无效道具“appBar”警告
- ios - 框架内的框架有问题吗?
- php - 在 Laravel 中间件中获取请求片段
- oop - 我如何正确(惯用地)在飞镖中做私人成员?