1

I have written a argo dag to trigger spark job in recursion until the condition satisfies. I have a counter parameter which needs to be incremented by 1 after every successful completion of spark job. But this isnt happening. Here is the snippet of my workflow.

  templates:
    - name: test-dag
      dag:
        tasks:
        - name: test-spark-job
          template: test-spark-job
        - name: loop-it
          template: backfill-dag
          dependencies: [backfill-spark-job]
          when: "{{=asInt(workflow.parameters.counter)}} <= {{=asInt(workflow.parameters.batchsize)}}"
          arguments:
            parameters:
              - name: counter
                value: {{=asInt(workflow.parameters.counter)}}+1

1 Answers1

0

It +1 should be part of the expression. Try:

arguments:
  parameters:
    - name: value
      value: "{{=asInt(workflow.parameters.counter) + 1}}"
Gabio
  • 9,126
  • 3
  • 12
  • 32