# Example with vertical and horizontal scalability # # Imagine we have 'M' workers which work in parallel, # each worker should performs 'N' loops sequentially # apiVersion: argoproj.io/v1alpha1 kind: WorkflowTemplate metadata: name: parallelism-nested spec: arguments: parameters: - name: seq-list value: | [1,2,3,4,5,6,7,8,9] entrypoint: seq-worker templates: - name: seq-worker inputs: parameters: - name: seq-list steps: - - name: seq-step template: one-job arguments: parameters: - name: seq-id value: "{{item}}" withParam: "{{inputs.parameters.seq-list}}" - name: one-job synchronization: semaphore: configMapKeyRef: name: my-config key: count2 inputs: parameters: - name: seq-id container: image: alpine command: ['/bin/sh', '-c'] args: ["echo {{inputs.parameters.seq-id}}; sleep $((RANDOM%10+1))"]