IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Resolve dependencies in Argo workflow

    RobinDong发表于 2022-12-01 23:23:39
    love 0

    My configuration DAG of Argo workflow was like this:

    {
      name: "my-workflow",
      dag: {
        tasks: [
          {
            name: "step1",
            template: "template1",
          },
          {
            name: "manual-check",
            template: "template-manual-check",
            depends: "step1.Failed",
          },
          {
            name: "step2",
            template: "template2",
            depends: "manual-check",
          },
        ],
      },
    }

    If “step1” failed, the “manual-check” will suspend the whole pipeline and let users (or customers) decide whether this pipeline could continue. But I met a funny situation when “step1” is successful: the “manual-check” step was omitted by workflow and “step2” would never be executed because it depends on “manual-check”!

    The correct solution should let “step2” run when “step1” is successful. Therefore I need to change the configuration to this:

    {
      ......
          {
            name: "step2",
            template: "template2",
            depends: "manual-check || step1.Succeeded",
          },
        ],
      },
    }

    Thanks to this reference: “Enhanced Depends Logic“.



沪ICP备19023445号-2号
友情链接