diff --git a/docs/examples/workflows-examples.md b/docs/examples/workflows-examples.md index f5bbff610..a0c56e5e7 100644 --- a/docs/examples/workflows-examples.md +++ b/docs/examples/workflows-examples.md @@ -107,8 +107,7 @@ Explore the examples through the side bar! | [template-defaults](https://github.com/argoproj/argo-workflows/blob/main/examples/template-defaults.yaml) | | [testvolume](https://github.com/argoproj/argo-workflows/blob/main/examples/testvolume.yaml) | | [timeouts-step](https://github.com/argoproj/argo-workflows/blob/main/examples/timeouts-step.yaml) | -| [title-and-description-with-markdown](https://github.com/argoproj/argo-workflows/blob/main/examples/title-and-description-with-markdown.yaml) | -| [withsequence-nested-result](https://github.com/argoproj/argo-workflows/blob/main/examples/withsequence-nested-result.yaml) | +| [title-and-descriptin-with-markdown](https://github.com/argoproj/argo-workflows/blob/main/examples/title-and-descriptin-with-markdown.yaml) | | [work-avoidance](https://github.com/argoproj/argo-workflows/blob/main/examples/work-avoidance.yaml) | | [workflow-count-resourcequota](https://github.com/argoproj/argo-workflows/blob/main/examples/workflow-count-resourcequota.yaml) | | [workflow-event-binding/event-consumer-workfloweventbinding](https://github.com/argoproj/argo-workflows/blob/main/examples/workflow-event-binding/event-consumer-workfloweventbinding.yaml) | diff --git a/docs/examples/workflows/template_level_volume.md b/docs/examples/workflows/template_level_volume.md index a4c1fe017..883e6758f 100644 --- a/docs/examples/workflows/template_level_volume.md +++ b/docs/examples/workflows/template_level_volume.md @@ -73,17 +73,35 @@ See https://argo-workflows.readthedocs.io/en/latest/walk-through/volumes/ spec: entrypoint: generate-and-use-volume templates: - - inputs: - parameters: - - name: pvc-size - name: generate-volume - outputs: + - name: generate-and-use-volume + steps: + - - name: generate-volume + template: generate-volume + arguments: + parameters: + - name: pvc-size + # In a real-world example, this could be generated by a previous workflow step. + value: '1Gi' + - - name: generate + template: whalesay + arguments: + parameters: + - name: pvc-name + value: '{{steps.generate-volume.outputs.parameters.pvc-name}}' + - - name: print + template: print-message + arguments: + parameters: + - name: pvc-name + value: '{{steps.generate-volume.outputs.parameters.pvc-name}}' + + - name: generate-volume + inputs: parameters: - - name: pvc-name - valueFrom: - jsonPath: '{.metadata.name}' + - name: pvc-size resource: action: create + setOwnerReference: true manifest: | apiVersion: v1 kind: PersistentVolumeClaim @@ -94,62 +112,42 @@ See https://argo-workflows.readthedocs.io/en/latest/walk-through/volumes/ resources: requests: storage: '{{inputs.parameters.pvc-size}}' - setOwnerReference: true - - container: - args: - - echo generating message in volume; cowsay hello world | tee /mnt/vol/hello_world.txt - command: - - sh - - -c - image: docker/whalesay:latest - volumeMounts: - - mountPath: /mnt/vol - name: workdir + outputs: + parameters: + - name: pvc-name + valueFrom: + jsonPath: '{.metadata.name}' + + - name: whalesay inputs: parameters: - - name: pvc-name - name: whalesay + - name: pvc-name volumes: - - name: workdir - persistentVolumeClaim: - claimName: '{{inputs.parameters.pvc-name}}' - - container: - args: - - echo getting message from volume; find /mnt/vol; cat /mnt/vol/hello_world.txt - command: - - sh - - -c - image: alpine:latest + - name: workdir + persistentVolumeClaim: + claimName: '{{inputs.parameters.pvc-name}}' + container: + image: docker/whalesay:latest + command: [sh, -c] + args: ["echo generating message in volume; cowsay hello world | tee /mnt/vol/hello_world.txt"] volumeMounts: - - mountPath: /mnt/vol - name: workdir + - name: workdir + mountPath: /mnt/vol + + - name: print-message inputs: - parameters: - - name: pvc-name - name: print-message - volumes: - - name: workdir - persistentVolumeClaim: - claimName: '{{inputs.parameters.pvc-name}}' - - name: generate-and-use-volume - steps: - - - arguments: - parameters: - - name: pvc-size - value: 1Gi - name: generate-volume - template: generate-volume - - - arguments: - parameters: - - name: pvc-name - value: '{{steps.generate-volume.outputs.parameters.pvc-name}}' - name: generate - template: whalesay - - - arguments: - parameters: + parameters: - name: pvc-name - value: '{{steps.generate-volume.outputs.parameters.pvc-name}}' - name: print - template: print-message + volumes: + - name: workdir + persistentVolumeClaim: + claimName: '{{inputs.parameters.pvc-name}}' + container: + image: alpine:latest + command: [sh, -c] + args: ["echo getting message from volume; find /mnt/vol; cat /mnt/vol/hello_world.txt"] + volumeMounts: + - name: workdir + mountPath: /mnt/vol ``` diff --git a/examples/workflows/template-level-volume.yaml b/examples/workflows/template-level-volume.yaml index c0d87e5cc..5032067bb 100644 --- a/examples/workflows/template-level-volume.yaml +++ b/examples/workflows/template-level-volume.yaml @@ -5,17 +5,35 @@ metadata: spec: entrypoint: generate-and-use-volume templates: - - inputs: - parameters: - - name: pvc-size - name: generate-volume - outputs: + - name: generate-and-use-volume + steps: + - - name: generate-volume + template: generate-volume + arguments: + parameters: + - name: pvc-size + # In a real-world example, this could be generated by a previous workflow step. + value: '1Gi' + - - name: generate + template: whalesay + arguments: + parameters: + - name: pvc-name + value: '{{steps.generate-volume.outputs.parameters.pvc-name}}' + - - name: print + template: print-message + arguments: + parameters: + - name: pvc-name + value: '{{steps.generate-volume.outputs.parameters.pvc-name}}' + + - name: generate-volume + inputs: parameters: - - name: pvc-name - valueFrom: - jsonPath: '{.metadata.name}' + - name: pvc-size resource: action: create + setOwnerReference: true manifest: | apiVersion: v1 kind: PersistentVolumeClaim @@ -26,60 +44,40 @@ spec: resources: requests: storage: '{{inputs.parameters.pvc-size}}' - setOwnerReference: true - - container: - args: - - echo generating message in volume; cowsay hello world | tee /mnt/vol/hello_world.txt - command: - - sh - - -c - image: docker/whalesay:latest - volumeMounts: - - mountPath: /mnt/vol - name: workdir + outputs: + parameters: + - name: pvc-name + valueFrom: + jsonPath: '{.metadata.name}' + + - name: whalesay inputs: parameters: - - name: pvc-name - name: whalesay + - name: pvc-name volumes: - - name: workdir - persistentVolumeClaim: - claimName: '{{inputs.parameters.pvc-name}}' - - container: - args: - - echo getting message from volume; find /mnt/vol; cat /mnt/vol/hello_world.txt - command: - - sh - - -c - image: alpine:latest + - name: workdir + persistentVolumeClaim: + claimName: '{{inputs.parameters.pvc-name}}' + container: + image: docker/whalesay:latest + command: [sh, -c] + args: ["echo generating message in volume; cowsay hello world | tee /mnt/vol/hello_world.txt"] volumeMounts: - - mountPath: /mnt/vol - name: workdir + - name: workdir + mountPath: /mnt/vol + + - name: print-message inputs: - parameters: - - name: pvc-name - name: print-message - volumes: - - name: workdir - persistentVolumeClaim: - claimName: '{{inputs.parameters.pvc-name}}' - - name: generate-and-use-volume - steps: - - - arguments: - parameters: - - name: pvc-size - value: 1Gi - name: generate-volume - template: generate-volume - - - arguments: - parameters: - - name: pvc-name - value: '{{steps.generate-volume.outputs.parameters.pvc-name}}' - name: generate - template: whalesay - - - arguments: - parameters: + parameters: - name: pvc-name - value: '{{steps.generate-volume.outputs.parameters.pvc-name}}' - name: print - template: print-message + volumes: + - name: workdir + persistentVolumeClaim: + claimName: '{{inputs.parameters.pvc-name}}' + container: + image: alpine:latest + command: [sh, -c] + args: ["echo getting message from volume; find /mnt/vol; cat /mnt/vol/hello_world.txt"] + volumeMounts: + - name: workdir + mountPath: /mnt/vol diff --git a/examples/workflows/upstream/title-and-descriptin-with-markdown.upstream.yaml b/examples/workflows/upstream/title-and-descriptin-with-markdown.upstream.yaml new file mode 100644 index 000000000..ff25ccdf3 --- /dev/null +++ b/examples/workflows/upstream/title-and-descriptin-with-markdown.upstream.yaml @@ -0,0 +1,19 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Workflow +metadata: + generateName: title-and-description-with-markdown- + labels: + workflows.argoproj.io/archive-strategy: "false" + annotations: + workflows.argoproj.io/title: "**Test Title**" + workflows.argoproj.io/description: | + `This is a simple hello world example.` + You can also run it in Python: https://couler-proj.github.io/couler/examples/#hello-world +spec: + entrypoint: whalesay + templates: + - name: whalesay + container: + image: docker/whalesay:latest + command: [cowsay] + args: ["hello world"]