容器批量计算 BCE-workflow:workflow配置样例

时间:2025-01-14 15:38:01

workflow配置样例

workflow:  job-a:    tool: nginx:latest    type: G CS .Job    resources:      memory: 2G      cpu: 1c    commands:      - sleep `expr 3 \* ${wait-base}`; echo ${output-prefix}job-a | tee -a ${obs}/${output}/${result};  job-b:    tool: nginx:latest    type: GCS.Job    commands_iter:      command: sleep `expr ${1} \* ${wait-base}`; echo ${output-prefix}job-b-${item} | tee -a ${obs}/${output}/${result};      vars_iter:        - range(0, 4) #内置函数range,实际表示 [0, 1, 2, 3]。最终并发执行4个容器,每个使用数组成员替代    depends:      - target: job-a        type: whole #可不写,whole为默认值  job-c:    tool: nginx:latest    type: GCS.Job    resources:      memory: 8G      cpu: 2c    commands_iter:      command: sleep `expr ${1} \* ${wait-base}`; echo ${output-prefix}job-c-${item} | tee -a ${obs}/${output}/${result};      vars_iter:        - [3, 20] #最终并发2个容器,每个使用数组成员替代    depends:      - target: job-a        type: iterate      - target: job-b
support.huaweicloud.com/usermanual-bce/bce_01_0032.html