apiVersion: dataflow.argoproj.io/v1alpha1 kind: Pipeline metadata: annotations: dataflow.argoproj.io/description: |- This pipeline count the number of words in a document, not the number of count of each word as you might expect. It also shows an example of a pipelines terminates based on a single step's status. dataflow.argoproj.io/needs: word-count-input-configmap.yaml dataflow.argoproj.io/owner: argoproj-labs dataflow.argoproj.io/test: 'false' name: 201-word-count spec: steps: - container: args: - sh - -c - cat /in/text | tee -a /var/run/argo-dataflow/out image: ubuntu:latest volumeMounts: - mountPath: /in name: in name: read-text sinks: - stan: subject: lines sources: - kafka: topic: input-topic volumes: - configMap: name: word-count-input name: in - container: args: - bash - -c - |- set -eux -o pipefail while read sentence; do for word in $sentence; do echo $word done done > /var/run/argo-dataflow/out < /var/run/argo-dataflow/in image: ubuntu:latest in: fifo: true name: split-lines scale: desiredReplicas: minmax(pending, 0, 1) sinks: - stan: subject: words sources: - stan: subject: lines - container: args: - bash - -c - |- set -eux -o pipefail i=0 while read word && [ $word != EOF ]; do i=$((i+1)) done < /var/run/argo-dataflow/in echo $i > /var/run/argo-dataflow/out image: ubuntu:latest in: fifo: true name: count-words sinks: - kafka: topic: output-topic sources: - stan: subject: words terminator: true