diff --git a/docs/cluster-workflow-templates.md b/docs/cluster-workflow-templates.md index d2d9e0d1570f..be4420dccba4 100644 --- a/docs/cluster-workflow-templates.md +++ b/docs/cluster-workflow-templates.md @@ -15,16 +15,16 @@ can be created cluster scoped like `ClusterRole` and can be accessed across all apiVersion: argoproj.io/v1alpha1 kind: ClusterWorkflowTemplate metadata: - name: cluster-workflow-template-whalesay-template + name: cluster-workflow-template-print-message spec: templates: - - name: whalesay-template + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] ``` @@ -41,14 +41,14 @@ kind: Workflow metadata: generateName: workflow-template-hello-world- spec: - entrypoint: whalesay + entrypoint: hello-world templates: - - name: whalesay + - name: hello-world steps: # You should only reference external "templates" in a "steps" or "dag" "template". - - - name: call-whalesay-template + - - name: call-print-message templateRef: # You can reference a "template" from another "WorkflowTemplate or ClusterWorkflowTemplate" using this field - name: cluster-workflow-template-whalesay-template # This is the name of the "WorkflowTemplate or ClusterWorkflowTemplate" CRD that contains the "template" you want - template: whalesay-template # This is the name of the "template" you want to reference + name: cluster-workflow-template-print-message # This is the name of the "WorkflowTemplate or ClusterWorkflowTemplate" CRD that contains the "template" you want + template: print-message # This is the name of the "template" you want to reference clusterScope: true # This field indicates this templateRef is pointing ClusterWorkflowTemplate arguments: # You can pass in arguments as normal parameters: @@ -70,19 +70,19 @@ kind: ClusterWorkflowTemplate metadata: name: cluster-workflow-template-submittable spec: - entrypoint: whalesay-template + entrypoint: print-message arguments: parameters: - name: message value: hello world templates: - - name: whalesay-template + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] ``` @@ -95,7 +95,7 @@ kind: Workflow metadata: generateName: cluster-workflow-template-hello-world- spec: - entrypoint: whalesay-template + entrypoint: print-message arguments: parameters: - name: message diff --git a/docs/configure-archive-logs.md b/docs/configure-archive-logs.md index 44f8be295816..705650431359 100644 --- a/docs/configure-archive-logs.md +++ b/docs/configure-archive-logs.md @@ -34,12 +34,12 @@ metadata: generateName: archive-location- spec: archiveLogs: true - entrypoint: whalesay + entrypoint: hello-world templates: - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] ``` @@ -51,12 +51,12 @@ kind: Workflow metadata: generateName: archive-location- spec: - entrypoint: whalesay + entrypoint: hello-world templates: - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] archiveLocation: archiveLogs: true diff --git a/docs/cron-workflows.md b/docs/cron-workflows.md index 4a0b4061386d..6bdbbca09876 100644 --- a/docs/cron-workflows.md +++ b/docs/cron-workflows.md @@ -20,9 +20,9 @@ spec: concurrencyPolicy: "Replace" startingDeadlineSeconds: 0 workflowSpec: - entrypoint: whalesay + entrypoint: date templates: - - name: whalesay + - name: date container: image: alpine:3.6 command: [sh, -c] diff --git a/docs/debug-pause.md b/docs/debug-pause.md index d5b565a4e978..460132378283 100644 --- a/docs/debug-pause.md +++ b/docs/debug-pause.md @@ -19,9 +19,9 @@ kind: Workflow metadata: generateName: pause-after- spec: - entrypoint: whalesay + entrypoint: argosay templates: - - name: whalesay + - name: argosay container: image: argoproj/argosay:v2 env: @@ -43,9 +43,9 @@ kind: Workflow metadata: generateName: pause-after- spec: - entrypoint: whalesay + entrypoint: argosay templates: - - name: whalesay + - name: argosay container: image: argoproj/argosay:v2 env: diff --git a/docs/events.md b/docs/events.md index 70e92e21d6f0..1e1bf1119157 100644 --- a/docs/events.md +++ b/docs/events.md @@ -40,7 +40,7 @@ The event endpoint will always return in under 10 seconds because the event will ## Workflow Template triggered by the event Before the binding between an event and a workflow template, you must create the workflow template that you want to trigger. -The following one takes in input the "message" parameter specified into the API call body, passed through the `WorkflowEventBinding` parameters section, and finally resolved here as the message of the `whalesay` image. +The following one takes in input the "message" parameter specified into the API call body, passed through the `WorkflowEventBinding` parameters section, and finally resolved here as the message of the `main` template. ```yaml apiVersion: argoproj.io/v1alpha1 @@ -56,8 +56,8 @@ spec: - name: message value: "{{workflow.parameters.message}}" container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] entrypoint: main ``` diff --git a/docs/memoization.md b/docs/memoization.md index 8c7f64959efd..02d6ee4dbb92 100644 --- a/docs/memoization.md +++ b/docs/memoization.md @@ -32,15 +32,15 @@ kind: Workflow metadata: generateName: memoized-workflow- spec: - entrypoint: whalesay + entrypoint: print-message templates: - - name: whalesay + - name: print-message memoize: key: "{{inputs.parameters.message}}" maxAge: "10s" cache: configMap: - name: whalesay-cache + name: print-message-cache ``` [Find a simple example for memoization here](https://github.com/argoproj/argo-workflows/blob/main/examples/memoize-simple.yaml). diff --git a/docs/rest-examples.md b/docs/rest-examples.md index 01e05376dd87..a15e1ccd231e 100644 --- a/docs/rest-examples.md +++ b/docs/rest-examples.md @@ -30,16 +30,16 @@ curl --request POST \ "spec": { "templates": [ { - "name": "whalesay", + "name": "hello-world", "arguments": {}, "inputs": {}, "outputs": {}, "metadata": {}, "container": { "name": "", - "image": "docker/whalesay:latest", + "image": "busybox", "command": [ - "cowsay" + "echo" ], "args": [ "hello world" @@ -48,7 +48,7 @@ curl --request POST \ } } ], - "entrypoint": "whalesay", + "entrypoint": "hello-world", "arguments": {} } } diff --git a/docs/synchronization.md b/docs/synchronization.md index 0897d96cb038..74776d5c800e 100644 --- a/docs/synchronization.md +++ b/docs/synchronization.md @@ -38,17 +38,17 @@ kind: Workflow metadata: generateName: synchronization-wf-level- spec: - entrypoint: whalesay + entrypoint: hello-world synchronization: semaphore: configMapKeyRef: name: my-config key: workflow templates: - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] ``` @@ -60,15 +60,15 @@ kind: Workflow metadata: generateName: synchronization-wf-level- spec: - entrypoint: whalesay + entrypoint: hello-world synchronization: mutex: name: workflow templates: - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] ``` diff --git a/docs/template-defaults.md b/docs/template-defaults.md index 677a66aee717..8a0962ebb019 100644 --- a/docs/template-defaults.md +++ b/docs/template-defaults.md @@ -24,7 +24,7 @@ spec: templates: - name: main container: - image: docker/whalesay:latest + image: busybox ``` [template defaults example](https://raw.githubusercontent.com/argoproj/argo-workflows/main/examples/template-defaults.yaml) diff --git a/docs/tolerating-pod-deletion.md b/docs/tolerating-pod-deletion.md index 30942fbb0fba..99a308821c6d 100644 --- a/docs/tolerating-pod-deletion.md +++ b/docs/tolerating-pod-deletion.md @@ -29,7 +29,7 @@ spec: templates: - name: main container: - image: docker/whalesay:latest + image: busybox command: - sleep - 30s diff --git a/docs/upgrading.md b/docs/upgrading.md index 68b4133d37cd..56531a0241a7 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -55,16 +55,17 @@ If you are incorrectly configured, the workflow controller will error on start-u #### Actions -You don't need to configure images that use v2 manifests anymore. You can just remove them (e.g. argoproj/argosay:v2): +You don't need to configure images that use v2 manifests anymore, such as `argoproj/argosay:v2`. +You can remove them: ```bash % docker manifest inspect argoproj/argosay:v2 -... +# ... "schemaVersion": 2, -... +# ... ``` -For v1 manifests (e.g. docker/whalesay:latest): +For v1 manifests, such as `docker/whalesay:latest`: ```bash % docker image inspect -f '{{.Config.Entrypoint}} {{.Config.Cmd}}' docker/whalesay:latest diff --git a/docs/variables.md b/docs/variables.md index bb86906f9fa3..5422f519b7c6 100644 --- a/docs/variables.md +++ b/docs/variables.md @@ -12,19 +12,19 @@ kind: Workflow metadata: generateName: hello-world-parameters- spec: - entrypoint: whalesay + entrypoint: print-message arguments: parameters: - name: message value: hello world templates: - - name: whalesay + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [ cowsay ] + image: busybox + command: [ echo ] args: [ "{{inputs.parameters.message}}" ] ``` diff --git a/docs/walk-through/artifacts.md b/docs/walk-through/artifacts.md index 893b1660e691..3dd004fd0b67 100644 --- a/docs/walk-through/artifacts.md +++ b/docs/walk-through/artifacts.md @@ -5,7 +5,7 @@ When running workflows, it is very common to have steps that generate or consume artifacts. Often, the output artifacts of one step may be used as input artifacts to a subsequent step. -The below workflow spec consists of two steps that run in sequence. The first step named `generate-artifact` will generate an artifact using the `whalesay` template that will be consumed by the second step named `print-message` that then consumes the generated artifact. +The below workflow spec consists of two steps that run in sequence. The first step named `generate-artifact` will generate an artifact using the `hello-world-to-file` template that will be consumed by the second step named `print-message-from-file` that then consumes the generated artifact. ```yaml apiVersion: argoproj.io/v1alpha1 @@ -18,9 +18,9 @@ spec: - name: artifact-example steps: - - name: generate-artifact - template: whalesay + template: hello-world-to-file - - name: consume-artifact - template: print-message + template: print-message-from-file arguments: artifacts: # bind message to the hello-art artifact @@ -28,11 +28,11 @@ spec: - name: message from: "{{steps.generate-artifact.outputs.artifacts.hello-art}}" - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["cowsay hello world | tee /tmp/hello_world.txt"] + args: ["echo hello world | tee /tmp/hello_world.txt"] outputs: artifacts: # generate hello-art artifact from /tmp/hello_world.txt @@ -40,7 +40,7 @@ spec: - name: hello-art path: /tmp/hello_world.txt - - name: print-message + - name: print-message-from-file inputs: artifacts: # unpack the message input artifact @@ -53,8 +53,8 @@ spec: args: ["cat /tmp/message"] ``` -The `whalesay` template uses the `cowsay` command to generate a file named `/tmp/hello-world.txt`. It then `outputs` this file as an artifact named `hello-art`. In general, the artifact's `path` may be a directory rather than just a file. The `print-message` template takes an input artifact named `message`, unpacks it at the `path` named `/tmp/message` and then prints the contents of `/tmp/message` using the `cat` command. -The `artifact-example` template passes the `hello-art` artifact generated as an output of the `generate-artifact` step as the `message` input artifact to the `print-message` step. DAG templates use the tasks prefix to refer to another task, for example `{{tasks.generate-artifact.outputs.artifacts.hello-art}}`. +The `hello-world-to-file` template uses the `echo` command to generate a file named `/tmp/hello-world.txt`. It then `outputs` this file as an artifact named `hello-art`. In general, the artifact's `path` may be a directory rather than just a file. The `print-message-from-file` template takes an input artifact named `message`, unpacks it at the `path` named `/tmp/message` and then prints the contents of `/tmp/message` using the `cat` command. +The `artifact-example` template passes the `hello-art` artifact generated as an output of the `generate-artifact` step as the `message` input artifact to the `print-message-from-file` step. DAG templates use the tasks prefix to refer to another task, for example `{{tasks.generate-artifact.outputs.artifacts.hello-art}}`. Optionally, for large artifacts, you can set `podSpecPatch` in the workflow spec to increase the resource request for the init container and avoid any Out of memory issues. diff --git a/docs/walk-through/custom-template-variable-reference.md b/docs/walk-through/custom-template-variable-reference.md index 0c4d0b2b1337..04cd2138183b 100644 --- a/docs/walk-through/custom-template-variable-reference.md +++ b/docs/walk-through/custom-template-variable-reference.md @@ -16,25 +16,24 @@ spec: - name: hello-hello-hello steps: - - name: hello1 - template: whalesay + template: print-message arguments: parameters: [{name: message, value: "hello1"}] - - name: hello2a - template: whalesay + template: print-message arguments: parameters: [{name: message, value: "hello2a"}] - name: hello2b - template: whalesay + template: print-message arguments: parameters: [{name: message, value: "hello2b"}] - - name: whalesay + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{user.username}}"] - ``` diff --git a/docs/walk-through/hello-world.md b/docs/walk-through/hello-world.md index beef6f120e53..d6508b7ddeac 100644 --- a/docs/walk-through/hello-world.md +++ b/docs/walk-through/hello-world.md @@ -1,34 +1,14 @@ # Hello World -Let's start by creating a very simple workflow template to echo "hello world" using the `docker/whalesay` container -image from Docker Hub. - -You can run this directly from your shell with a simple docker command: +Run this container directly from your shell with a `docker` command: ```bash -$ docker run docker/whalesay cowsay "hello world" - _____________ -< hello world > - ------------- - \ - \ - \ - ## . - ## ## ## == - ## ## ## ## === - /""""""""""""""""___/ === - ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ - \______ o __/ - \ \ __/ - \____\______/ - - -Hello from Docker! -This message shows that your installation appears to be working correctly. +$ docker run busybox echo "hello world" +hello world ``` -Below, we run the same container on a Kubernetes cluster using an Argo workflow template. Be sure to read the comments -as they provide useful explanations. +Below, run the same container on a Kubernetes cluster with a Workflow. +The comments provide useful explanations. ```yaml apiVersion: argoproj.io/v1alpha1 @@ -36,12 +16,12 @@ kind: Workflow # new type of k8s spec metadata: generateName: hello-world- # name of the workflow spec spec: - entrypoint: whalesay # invoke the whalesay template + entrypoint: hello-world # invoke the hello-world template templates: - - name: whalesay # name of the template + - name: hello-world # name of the template container: - image: docker/whalesay - command: [ cowsay ] + image: busybox + command: [ echo ] args: [ "hello world" ] resources: # limit the resources limits: @@ -49,8 +29,9 @@ spec: cpu: 100m ``` -Argo adds a new `kind` of Kubernetes spec called a `Workflow`. The above spec contains a single `template` -called `whalesay` which runs the `docker/whalesay` container and invokes `cowsay "hello world"`. The `whalesay` template -is the `entrypoint` for the spec. The entrypoint specifies the initial template that should be invoked when the workflow -spec is executed by Kubernetes. Being able to specify the entrypoint is more useful when there is more than one template -defined in the Kubernetes workflow spec. :-) +Argo adds a new `kind` of Kubernetes resource called a `Workflow`. + +The above spec contains a single `template` called `hello-world` which runs the `busybox` image and invokes `echo "hello world"`. +The `hello-world` template is the `entrypoint` for the spec. +The `entrypoint` specifies the first template to invoke when the workflow spec is executed. +Specifying the entrypoint is useful when there are multiple templates defined in the workflow spec. diff --git a/docs/walk-through/loops.md b/docs/walk-through/loops.md index 7b2093af40e9..3874946f2639 100644 --- a/docs/walk-through/loops.md +++ b/docs/walk-through/loops.md @@ -32,8 +32,8 @@ spec: - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world!"] ``` @@ -51,23 +51,23 @@ spec: templates: - name: loop-example steps: - - - name: print-message - template: whalesay + - - name: print-message-loop + template: print-message arguments: parameters: - name: message value: "{{item}}" - withItems: # invoke whalesay once for each item in parallel + withItems: # invoke print-message once for each item in parallel - hello world # item 1 - goodbye world # item 2 - - name: whalesay + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] ``` diff --git a/docs/walk-through/output-parameters.md b/docs/walk-through/output-parameters.md index 3515dbd46d4c..7455533f287b 100644 --- a/docs/walk-through/output-parameters.md +++ b/docs/walk-through/output-parameters.md @@ -13,7 +13,7 @@ spec: - name: output-parameter steps: - - name: generate-parameter - template: whalesay + template: hello-world-to-file - - name: consume-parameter template: print-message arguments: @@ -22,9 +22,9 @@ spec: - name: message value: "{{steps.generate-parameter.outputs.parameters.hello-param}}" - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] args: ["echo -n hello world > /tmp/hello_world.txt"] # generate the content of hello_world.txt outputs: @@ -38,8 +38,8 @@ spec: parameters: - name: message container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] ``` diff --git a/docs/walk-through/parameters.md b/docs/walk-through/parameters.md index 0d835ca8adfd..617a4502259c 100644 --- a/docs/walk-through/parameters.md +++ b/docs/walk-through/parameters.md @@ -8,28 +8,26 @@ kind: Workflow metadata: generateName: hello-world-parameters- spec: - # invoke the whalesay template with - # "hello world" as the argument - # to the message parameter - entrypoint: whalesay + # invoke the print-message template with "hello world" as the argument to the message parameter + entrypoint: print-message arguments: parameters: - name: message value: hello world templates: - - name: whalesay + - name: print-message inputs: parameters: - name: message # parameter declaration container: - # run cowsay with that message input parameter as args - image: docker/whalesay - command: [cowsay] + # run echo with that message input parameter as args + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] ``` -This time, the `whalesay` template takes an input parameter named `message` that is passed as the `args` to the `cowsay` command. In order to reference parameters (e.g., ``"{{inputs.parameters.message}}"``), the parameters must be enclosed in double quotes to escape the curly braces in YAML. +This time, the `print-message` template takes an input parameter named `message` that is passed as the `args` to the `echo` command. In order to reference parameters (e.g., ``"{{inputs.parameters.message}}"``), the parameters must be enclosed in double quotes to escape the curly braces in YAML. The argo CLI provides a convenient way to override parameters used to invoke the entrypoint. For example, the following command would bind the `message` parameter to "goodbye world" instead of the default "hello world". @@ -49,10 +47,10 @@ To run use following command: argo submit arguments-parameters.yaml --parameter-file params.yaml ``` -Command-line parameters can also be used to override the default entrypoint and invoke any template in the workflow spec. For example, if you add a new version of the `whalesay` template called `whalesay-caps` but you don't want to change the default entrypoint, you can invoke this from the command line as follows: +Command-line parameters can also be used to override the default entrypoint and invoke any template in the workflow spec. For example, if you add a new version of the `print-message` template called `print-message-caps` but you don't want to change the default entrypoint, you can invoke this from the command line as follows: ```bash -argo submit arguments-parameters.yaml --entrypoint whalesay-caps +argo submit arguments-parameters.yaml --entrypoint print-message-caps ``` By using a combination of the `--entrypoint` and `-p` parameters, you can call any template in the workflow spec with any parameter that you like. diff --git a/docs/walk-through/secrets.md b/docs/walk-through/secrets.md index e5f67e29a79e..fd69e67271a1 100644 --- a/docs/walk-through/secrets.md +++ b/docs/walk-through/secrets.md @@ -10,7 +10,7 @@ kind: Workflow metadata: generateName: secret-example- spec: - entrypoint: whalesay + entrypoint: print-secrets # To access secrets as files, add a volume entry in spec.volumes[] and # then in the container template spec, add a mount using volumeMounts. volumes: @@ -18,7 +18,7 @@ spec: secret: secretName: my-secret # name of an existing k8s secret templates: - - name: whalesay + - name: print-secrets container: image: alpine:3.7 command: [sh, -c] diff --git a/docs/walk-through/steps.md b/docs/walk-through/steps.md index 26c8c74ae7a5..2d040e13620b 100644 --- a/docs/walk-through/steps.md +++ b/docs/walk-through/steps.md @@ -11,39 +11,39 @@ metadata: spec: entrypoint: hello-hello-hello - # This spec contains two templates: hello-hello-hello and whalesay + # This spec contains two templates: hello-hello-hello and print-message templates: - name: hello-hello-hello # Instead of just running a container # This template has a sequence of steps steps: - - name: hello1 # hello1 is run before the following steps - template: whalesay + template: print-message arguments: parameters: - name: message value: "hello1" - - name: hello2a # double dash => run after previous step - template: whalesay + template: print-message arguments: parameters: - name: message value: "hello2a" - name: hello2b # single dash => run in parallel with previous step - template: whalesay + template: print-message arguments: parameters: - name: message value: "hello2b" # This is the same template as from the previous example - - name: whalesay + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] ``` @@ -57,7 +57,7 @@ The example output below shows that `hello2a` and `hello2b` ran in parallel: ```bash STEP TEMPLATE PODNAME DURATION MESSAGE ✔ steps-z2zdn hello-hello-hello - ├───✔ hello1 whalesay steps-z2zdn-27420706 2s - └─┬─✔ hello2a whalesay steps-z2zdn-2006760091 3s - └─✔ hello2b whalesay steps-z2zdn-2023537710 3s + ├───✔ hello1 print-message steps-z2zdn-27420706 2s + └─┬─✔ hello2a print-message steps-z2zdn-2006760091 3s + └─✔ hello2b print-message steps-z2zdn-2023537710 3s ``` diff --git a/docs/walk-through/suspending.md b/docs/walk-through/suspending.md index 55c179146dde..74a217ee9b65 100644 --- a/docs/walk-through/suspending.md +++ b/docs/walk-through/suspending.md @@ -19,13 +19,13 @@ spec: - name: suspend steps: - - name: build - template: whalesay + template: hello-world - - name: approve template: approve - - name: delay template: delay - - name: release - template: whalesay + template: hello-world - name: approve suspend: {} @@ -34,10 +34,10 @@ spec: suspend: duration: "20" # Must be a string. Default unit is seconds. Could also be a Duration, e.g.: "2m", "6h" - - name: whalesay + - name: hello-world container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] ``` diff --git a/docs/walk-through/volumes.md b/docs/walk-through/volumes.md index 8430cc92cac8..bd062d8fcd50 100644 --- a/docs/walk-through/volumes.md +++ b/docs/walk-through/volumes.md @@ -22,26 +22,26 @@ spec: - name: volumes-pvc-example steps: - - name: generate - template: whalesay + template: hello-world-to-file - - name: print - template: print-message + template: print-message-from-file - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["echo generating message in volume; cowsay hello world | tee /mnt/vol/hello_world.txt"] - # Mount workdir volume at /mnt/vol before invoking docker/whalesay + args: ["echo generating message in volume; echo hello world | tee /mnt/vol/hello_world.txt"] + # Mount workdir volume at /mnt/vol before invoking the container volumeMounts: # same syntax as k8s Pod spec - name: workdir mountPath: /mnt/vol - - name: print-message + - name: print-message-from-file container: image: alpine:latest command: [sh, -c] args: ["echo getting message from volume; find /mnt/vol; cat /mnt/vol/hello_world.txt"] - # Mount workdir volume at /mnt/vol before invoking docker/whalesay + # Mount workdir volume at /mnt/vol before invoking the container volumeMounts: # same syntax as k8s Pod spec - name: workdir mountPath: /mnt/vol @@ -82,20 +82,20 @@ spec: - name: volumes-existing-example steps: - - name: generate - template: whalesay + template: hello-world-to-file - - name: print - template: print-message + template: print-message-from-file - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["echo generating message in volume; cowsay hello world | tee /mnt/vol/hello_world.txt"] + args: ["echo generating message in volume; echo hello world | tee /mnt/vol/hello_world.txt"] volumeMounts: - name: workdir mountPath: /mnt/vol - - name: print-message + - name: print-message-from-file container: image: alpine:latest command: [sh, -c] @@ -126,13 +126,13 @@ spec: # In a real-world example, this could be generated by a previous workflow step. value: '1Gi' - - name: generate - template: whalesay + template: hello-world-to-file arguments: parameters: - name: pvc-name value: '{{steps.generate-volume.outputs.parameters.pvc-name}}' - - name: print - template: print-message + template: print-message-from-file arguments: parameters: - name: pvc-name @@ -161,7 +161,7 @@ spec: valueFrom: jsonPath: '{.metadata.name}' - - name: whalesay + - name: hello-world-to-file inputs: parameters: - name: pvc-name @@ -170,14 +170,14 @@ spec: persistentVolumeClaim: claimName: '{{inputs.parameters.pvc-name}}' container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["echo generating message in volume; cowsay hello world | tee /mnt/vol/hello_world.txt"] + args: ["echo generating message in volume; echo hello world | tee /mnt/vol/hello_world.txt"] volumeMounts: - name: workdir mountPath: /mnt/vol - - name: print-message + - name: print-message-from-file inputs: parameters: - name: pvc-name diff --git a/docs/workflow-concepts.md b/docs/workflow-concepts.md index 954a19f86963..f245fdd8eb90 100644 --- a/docs/workflow-concepts.md +++ b/docs/workflow-concepts.md @@ -26,13 +26,13 @@ kind: Workflow metadata: generateName: hello-world- # Name of this Workflow spec: - entrypoint: whalesay # Defines "whalesay" as the "main" template + entrypoint: hello-world # Defines "hello-world" as the "main" template templates: - - name: whalesay # Defining the "whalesay" template + - name: hello-world # Defines the "hello-world" template container: - image: docker/whalesay - command: [cowsay] - args: ["hello world"] # This template runs "cowsay" in the "whalesay" image with arguments "hello world" + image: busybox + command: [echo] + args: ["hello world"] # This template runs "echo" in the "busybox" image with arguments "hello world" ``` ### `template` Types @@ -50,10 +50,10 @@ Perhaps the most common template type, it will schedule a Container. The spec of Example: ```yaml - - name: whalesay + - name: hello-world container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] ``` diff --git a/docs/workflow-of-workflows.md b/docs/workflow-of-workflows.md index 296c42c58a9f..2137fec65732 100644 --- a/docs/workflow-of-workflows.md +++ b/docs/workflow-of-workflows.md @@ -8,7 +8,7 @@ The Workflow of Workflows pattern involves a parent workflow triggering one or m ## Examples -You can use `workflowTemplateRef` to trigger a workflow inline. +You can use `workflowTemplateRef` to trigger a workflow inline. 1. Define your workflow as a `workflowtemplate`. @@ -18,19 +18,19 @@ kind: WorkflowTemplate metadata: name: workflow-template-submittable spec: - entrypoint: whalesay-template + entrypoint: print-message arguments: parameters: - name: message value: hello world templates: - - name: whalesay-template + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] ``` @@ -80,7 +80,7 @@ spec: name: {{inputs.parameters.workflowtemplate}} successCondition: status.phase == Succeeded failureCondition: status.phase in (Failed, Error) - + - name: resource-with-argument inputs: parameters: @@ -102,5 +102,4 @@ spec: name: {{inputs.parameters.workflowtemplate}} successCondition: status.phase == Succeeded failureCondition: status.phase in (Failed, Error) - ``` diff --git a/docs/workflow-templates.md b/docs/workflow-templates.md index 9865fd892a89..66de9c71dd21 100644 --- a/docs/workflow-templates.md +++ b/docs/workflow-templates.md @@ -32,17 +32,17 @@ spec: - name: hello # The first "template" in this Workflow, it is referenced by "entrypoint" steps: # The type of this "template" is "steps" - - name: hello - template: whalesay # We reference our second "template" here + template: print-message # We reference our second "template" here arguments: parameters: [{name: message, value: "hello1"}] - - name: whalesay # The second "template" in this Workflow, it is referenced by "hello" + - name: print-message # The second "template" in this Workflow, it is referenced by "hello" inputs: parameters: - name: message container: # The type of this "template" is "container" - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] ``` @@ -69,19 +69,19 @@ kind: WorkflowTemplate metadata: name: workflow-template-submittable spec: - entrypoint: whalesay-template # Fields other than "arguments" and "templates" not supported in v2.4 - v2.6 + entrypoint: print-message # Fields other than "arguments" and "templates" not supported in v2.4 - v2.6 arguments: parameters: - name: message value: hello world templates: - - name: whalesay-template + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] ``` @@ -98,13 +98,13 @@ spec: - name: message value: hello world templates: - - name: whalesay-template + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] ``` @@ -142,8 +142,8 @@ spec: templates: - name: hello-world container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{workflow.parameters.global-parameter}}"] --- apiVersion: argoproj.io/v1alpha1 @@ -152,13 +152,13 @@ metadata: generateName: hello-world-wf-global-arg- spec: serviceAccountName: argo - entrypoint: whalesay + entrypoint: print-message arguments: parameters: - name: global-parameter value: hello templates: - - name: whalesay + - name: print-message steps: - - name: hello-world templateRef: @@ -182,8 +182,8 @@ spec: - name: msg value: "hello world" container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.msg}}"] --- apiVersion: argoproj.io/v1alpha1 @@ -191,9 +191,9 @@ kind: Workflow metadata: generateName: hello-world-local-arg- spec: - entrypoint: whalesay + entrypoint: print-message templates: - - name: whalesay + - name: print-message steps: - - name: hello-world templateRef: @@ -214,14 +214,14 @@ kind: Workflow metadata: generateName: workflow-template-hello-world- spec: - entrypoint: whalesay + entrypoint: hello-world templates: - - name: whalesay + - name: hello-world steps: # You should only reference external "templates" in a "steps" or "dag" "template". - - - name: call-whalesay-template + - - name: call-print-message templateRef: # You can reference a "template" from another "WorkflowTemplate" using this field name: workflow-template-1 # This is the name of the "WorkflowTemplate" CRD that contains the "template" you want - template: whalesay-template # This is the name of the "template" you want to reference + template: print-message # This is the name of the "template" you want to reference arguments: # You can pass in arguments as normal parameters: - name: message @@ -236,15 +236,15 @@ kind: Workflow metadata: generateName: workflow-template-hello-world- spec: - entrypoint: whalesay + entrypoint: hello-world templates: - - name: whalesay + - name: hello-world dag: tasks: - - name: call-whalesay-template + - name: call-print-message templateRef: name: workflow-template-1 - template: whalesay-template + template: print-message arguments: parameters: - name: message @@ -263,13 +263,13 @@ kind: Workflow metadata: generateName: workflow-template-hello-world- spec: - entrypoint: whalesay + entrypoint: hello-world templates: - - name: whalesay + - name: hello-world template: # You should NEVER use "template" here. Use it under a "steps" or "dag" template (see above). templateRef: # You should NEVER use "templateRef" here. Use it under a "steps" or "dag" template (see above). name: workflow-template-1 - template: whalesay-template + template: print-message arguments: # Arguments here are ignored. Use them under a "steps" or "dag" template (see above). parameters: - name: message @@ -295,7 +295,7 @@ kind: Workflow metadata: generateName: workflow-template-hello-world- spec: - entrypoint: whalesay-template + entrypoint: print-message arguments: parameters: - name: message @@ -314,7 +314,6 @@ metadata: spec: workflowTemplateRef: name: workflow-template-submittable - ``` ## Managing `WorkflowTemplates` diff --git a/examples/archive-location.yaml b/examples/archive-location.yaml index 3303e4923a5c..e14530de7e52 100644 --- a/examples/archive-location.yaml +++ b/examples/archive-location.yaml @@ -3,12 +3,12 @@ kind: Workflow metadata: generateName: archive-location- spec: - entrypoint: whalesay + entrypoint: hello-world templates: - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] # archiveLocation allows configuring the archive location for a specific step archiveLocation: diff --git a/examples/arguments-parameters-from-configmap.yaml b/examples/arguments-parameters-from-configmap.yaml index 58fdbe1079b9..39339ff41b7f 100644 --- a/examples/arguments-parameters-from-configmap.yaml +++ b/examples/arguments-parameters-from-configmap.yaml @@ -6,17 +6,16 @@ metadata: workflows.argoproj.io/test: "true" annotations: workflows.argoproj.io/description: | - This example demonstrates loading parameter values from configmap. - Note that the "simple-parameters" ConfigMap (defined in examples/configmaps/simple-parameters-configmap.yaml) - needs to be created first before submitting this workflow. + This example demonstrates loading parameter values from a ConfigMap. + Note that the "simple-parameters" ConfigMap (defined in `examples/configmaps/simple-parameters-configmap.yaml`) needs to be created first before submitting this workflow. workflows.argoproj.io/verify.py: | assert status["phase"] == "Succeeded" spec: serviceAccountName: argo - entrypoint: whalesay + entrypoint: print-message-from-configmap templates: - - name: whalesay + - name: print-message-from-configmap inputs: parameters: # Parameters can also be passed via configmap reference. @@ -26,5 +25,6 @@ spec: name: simple-parameters key: msg container: - image: argoproj/argosay:v2 - args: ["echo", "{{inputs.parameters.message}}"] + image: busybox + command: ["echo"] + args: ["{{inputs.parameters.message}}"] diff --git a/examples/arguments-parameters.yaml b/examples/arguments-parameters.yaml index 83e4b41246b3..a61e2e6acb9d 100644 --- a/examples/arguments-parameters.yaml +++ b/examples/arguments-parameters.yaml @@ -3,7 +3,7 @@ kind: Workflow metadata: generateName: arguments-parameters- spec: - entrypoint: whalesay + entrypoint: print-message # Parameters can be passed/overridden via the argo CLI. # To override the printed message, run `argo submit` with the -p option: # $ argo submit examples/arguments-parameters.yaml -p message="goodbye world" @@ -13,11 +13,11 @@ spec: value: hello world templates: - - name: whalesay + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] diff --git a/examples/artifact-disable-archive.yaml b/examples/artifact-disable-archive.yaml index 6cd74410486f..12633030be40 100644 --- a/examples/artifact-disable-archive.yaml +++ b/examples/artifact-disable-archive.yaml @@ -13,9 +13,9 @@ spec: - name: artifact-disable-archive steps: - - name: generate-artifact - template: whalesay + template: hello-world-to-file - - name: consume-artifact - template: print-message + template: print-message-from-files arguments: artifacts: - name: etc @@ -25,11 +25,11 @@ spec: - name: hello-txt-nc from: "{{steps.generate-artifact.outputs.artifacts.hello-txt-nc}}" - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["cowsay hello world | tee /tmp/hello_world.txt | tee /tmp/hello_world_nc.txt ; sleep 1"] + args: ["echo hello world | tee /tmp/hello_world.txt | tee /tmp/hello_world_nc.txt ; sleep 1"] outputs: artifacts: - name: etc @@ -47,7 +47,7 @@ spec: # no compression (also accepts the standard gzip 1 to 9 values) compressionLevel: 0 - - name: print-message + - name: print-message-from-files inputs: artifacts: - name: etc diff --git a/examples/artifact-passing-subpath.yaml b/examples/artifact-passing-subpath.yaml index 9f82e6b62785..9692876c44d9 100644 --- a/examples/artifact-passing-subpath.yaml +++ b/examples/artifact-passing-subpath.yaml @@ -11,7 +11,7 @@ spec: - name: artifact-example steps: - - name: generate-artifact - template: whalesay + template: hello-world-to-file - - name: list-artifact template: print-message-dir arguments: @@ -19,18 +19,18 @@ spec: - name: message from: "{{steps.generate-artifact.outputs.artifacts.hello-art}}" - - name: consume-artifact - template: print-message + template: print-message-from-file arguments: artifacts: - name: message from: "{{steps.generate-artifact.outputs.artifacts.hello-art}}" subPath: hello_world.txt - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["sleep 1; cowsay hello world | tee /tmp/hello_world.txt"] + args: ["sleep 1; echo hello world | tee /tmp/hello_world.txt"] outputs: artifacts: - name: hello-art @@ -48,7 +48,7 @@ spec: command: [sh, -c] args: ["ls /tmp/message"] - - name: print-message + - name: print-message-from-file inputs: artifacts: - name: message diff --git a/examples/artifact-passing.yaml b/examples/artifact-passing.yaml index 90fdeacd3728..68dc0095ea3d 100644 --- a/examples/artifact-passing.yaml +++ b/examples/artifact-passing.yaml @@ -10,25 +10,25 @@ spec: - name: artifact-example steps: - - name: generate-artifact - template: whalesay + template: hello-world-to-file - - name: consume-artifact - template: print-message + template: print-message-from-file arguments: artifacts: - name: message from: "{{steps.generate-artifact.outputs.artifacts.hello-art}}" - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["sleep 1; cowsay hello world | tee /tmp/hello_world.txt"] + args: ["sleep 1; echo hello world | tee /tmp/hello_world.txt"] outputs: artifacts: - name: hello-art path: /tmp/hello_world.txt - - name: print-message + - name: print-message-from-file inputs: artifacts: - name: message diff --git a/examples/artifact-repository-ref.yaml b/examples/artifact-repository-ref.yaml index a12aae6a53df..b79812e6c8ee 100644 --- a/examples/artifact-repository-ref.yaml +++ b/examples/artifact-repository-ref.yaml @@ -9,9 +9,9 @@ spec: templates: - name: main container: - image: docker/whalesay:latest + image: busybox command: [ sh, -c ] - args: [ "cowsay hello world | tee /tmp/hello_world.txt" ] + args: [ "echo hello world | tee /tmp/hello_world.txt" ] outputs: artifacts: - name: hello_world diff --git a/examples/artifactory-artifact.yaml b/examples/artifactory-artifact.yaml index 6f6fd549098c..e2df6e235e9d 100644 --- a/examples/artifactory-artifact.yaml +++ b/examples/artifactory-artifact.yaml @@ -14,19 +14,19 @@ spec: - name: artifact-example steps: - - name: generate-artifact - template: whalesay + template: hello-world-to-file - - name: consume-artifact - template: print-message + template: print-message-from-file arguments: artifacts: - name: message from: "{{steps.generate-artifact.outputs.artifacts.hello-art}}" - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["cowsay hello world | tee /tmp/hello_world.txt"] + args: ["echo hello world | tee /tmp/hello_world.txt"] outputs: artifacts: - name: hello-art @@ -40,7 +40,7 @@ spec: name: my-artifactory-credentials key: password - - name: print-message + - name: print-message-from-file inputs: artifacts: - name: message diff --git a/examples/cluster-workflow-template/cluster-wftmpl-dag.yaml b/examples/cluster-workflow-template/cluster-wftmpl-dag.yaml index 0fa7b717ddec..0bd63d808f7e 100644 --- a/examples/cluster-workflow-template/cluster-wftmpl-dag.yaml +++ b/examples/cluster-workflow-template/cluster-wftmpl-dag.yaml @@ -17,8 +17,8 @@ spec: tasks: - name: A templateRef: - name: cluster-workflow-template-whalesay-template - template: whalesay-template + name: cluster-workflow-template-print-message + template: print-message clusterScope: true arguments: parameters: @@ -27,8 +27,8 @@ spec: - name: B depends: "A" templateRef: - name: cluster-workflow-template-whalesay-template - template: whalesay-template + name: cluster-workflow-template-print-message + template: print-message clusterScope: true arguments: parameters: @@ -43,8 +43,8 @@ spec: - name: D depends: "B && C" templateRef: - name: cluster-workflow-template-whalesay-template - template: whalesay-template + name: cluster-workflow-template-print-message + template: print-message clusterScope: true arguments: parameters: diff --git a/examples/cluster-workflow-template/clustertemplates.yaml b/examples/cluster-workflow-template/clustertemplates.yaml index a3a13f75381c..7fb293489a1e 100644 --- a/examples/cluster-workflow-template/clustertemplates.yaml +++ b/examples/cluster-workflow-template/clustertemplates.yaml @@ -1,16 +1,16 @@ apiVersion: argoproj.io/v1alpha1 kind: ClusterWorkflowTemplate metadata: - name: cluster-workflow-template-whalesay-template + name: cluster-workflow-template-print-message spec: templates: - - name: whalesay-template + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] --- apiVersion: argoproj.io/v1alpha1 @@ -34,20 +34,20 @@ metadata: name: cluster-workflow-template-inner-steps spec: templates: - - name: whalesay-template + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] - name: inner-steps steps: - - name: inner-hello1 templateRef: - name: cluster-workflow-template-whalesay-template - template: whalesay-template + name: cluster-workflow-template-print-message + template: print-message clusterScope: true arguments: parameters: @@ -55,8 +55,8 @@ spec: value: "inner-hello1" - - name: inner-hello2a templateRef: - name: cluster-workflow-template-whalesay-template - template: whalesay-template + name: cluster-workflow-template-print-message + template: print-message clusterScope: true arguments: parameters: @@ -64,8 +64,8 @@ spec: value: "inner-hello2a" - name: inner-hello2b templateRef: - name: cluster-workflow-template-whalesay-template - template: whalesay-template + name: cluster-workflow-template-print-message + template: print-message clusterScope: true arguments: parameters: @@ -85,21 +85,21 @@ metadata: name: cluster-workflow-template-inner-dag spec: templates: - - name: whalesay-template + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] - name: inner-diamond dag: tasks: - name: inner-A templateRef: - name: cluster-workflow-template-whalesay-template - template: whalesay-template + name: cluster-workflow-template-print-message + template: print-message clusterScope: true arguments: parameters: @@ -107,14 +107,14 @@ spec: value: inner-A - name: inner-B depends: "inner-A" - template: whalesay-template + template: print-message arguments: parameters: - name: message value: inner-B - name: inner-C depends: "inner-A" - template: whalesay-template + template: print-message arguments: parameters: - name: message @@ -122,8 +122,8 @@ spec: - name: inner-D depends: "inner-B && inner-C" templateRef: - name: cluster-workflow-template-whalesay-template - template: whalesay-template + name: cluster-workflow-template-print-message + template: print-message clusterScope: true arguments: parameters: @@ -135,17 +135,17 @@ kind: ClusterWorkflowTemplate metadata: name: cluster-workflow-template-submittable spec: - entrypoint: whalesay-template + entrypoint: print-message arguments: parameters: - name: message value: hello world templates: - - name: whalesay-template + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] diff --git a/examples/cluster-workflow-template/mixed-cluster-namespaced-wftmpl-steps.yaml b/examples/cluster-workflow-template/mixed-cluster-namespaced-wftmpl-steps.yaml index 5b5a6024ca96..9b123e1886ca 100644 --- a/examples/cluster-workflow-template/mixed-cluster-namespaced-wftmpl-steps.yaml +++ b/examples/cluster-workflow-template/mixed-cluster-namespaced-wftmpl-steps.yaml @@ -9,8 +9,8 @@ spec: steps: - - name: hello1 templateRef: - name: workflow-template-whalesay-template - template: whalesay-template + name: workflow-template-print-message + template: print-message arguments: parameters: - name: message @@ -26,8 +26,8 @@ spec: value: "hello2a" - name: hello2b templateRef: - name: workflow-template-whalesay-template - template: whalesay-template + name: workflow-template-print-message + template: print-message arguments: parameters: - name: message diff --git a/examples/cluster-workflow-template/workflow-template-ref-with-entrypoint-arg-passing.yaml b/examples/cluster-workflow-template/workflow-template-ref-with-entrypoint-arg-passing.yaml index 5755b6f3b140..3b65134ec67f 100644 --- a/examples/cluster-workflow-template/workflow-template-ref-with-entrypoint-arg-passing.yaml +++ b/examples/cluster-workflow-template/workflow-template-ref-with-entrypoint-arg-passing.yaml @@ -3,13 +3,13 @@ kind: Workflow metadata: generateName: cluster-workflow-template-hello-world- spec: - entrypoint: whalesay-template + entrypoint: print-message arguments: parameters: - name: message value: "hello world" workflowTemplateRef: - name: cluster-workflow-template-whalesay-template + name: cluster-workflow-template-print-message clusterScope: true diff --git a/examples/colored-logs.yaml b/examples/colored-logs.yaml index 6c3d52749c69..fb379a0709ed 100644 --- a/examples/colored-logs.yaml +++ b/examples/colored-logs.yaml @@ -4,9 +4,9 @@ kind: Workflow metadata: generateName: colored-logs- spec: - entrypoint: whalesay + entrypoint: print-colors templates: - - name: whalesay + - name: print-colors script: image: python:3.7 command: ["python"] diff --git a/examples/continue-on-fail.yaml b/examples/continue-on-fail.yaml index b9244cdeec55..954d9c8e9642 100644 --- a/examples/continue-on-fail.yaml +++ b/examples/continue-on-fail.yaml @@ -11,20 +11,20 @@ spec: - name: workflow-ignore steps: - - name: A - template: whalesay + template: hello-world - - name: B - template: whalesay + template: hello-world - name: C template: intentional-fail continueOn: failed: true - - name: D - template: whalesay + template: hello-world - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] - name: intentional-fail diff --git a/examples/cron-backfill.yaml b/examples/cron-backfill.yaml index 3254971830d2..2f3c40fa0b97 100644 --- a/examples/cron-backfill.yaml +++ b/examples/cron-backfill.yaml @@ -17,7 +17,7 @@ spec: parameters: - name: date script: - image: docker/whalesay:latest + image: busybox command: - sh source: | diff --git a/examples/cron-workflow.yaml b/examples/cron-workflow.yaml index e0ed82b35ea4..7977b7777768 100644 --- a/examples/cron-workflow.yaml +++ b/examples/cron-workflow.yaml @@ -11,10 +11,10 @@ spec: failedJobsHistoryLimit: 4 # Default 1 suspend: false # Set to "true" to suspend scheduling workflowSpec: - entrypoint: whalesay + entrypoint: hello-world-with-time templates: - - name: whalesay + - name: hello-world-with-time container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["🕓 hello world. Scheduled on: {{workflow.scheduledTime}}"] diff --git a/examples/dag-continue-on-fail.yaml b/examples/dag-continue-on-fail.yaml index 7a1cb991fdff..b2245087a2ac 100644 --- a/examples/dag-continue-on-fail.yaml +++ b/examples/dag-continue-on-fail.yaml @@ -9,30 +9,30 @@ spec: dag: tasks: - name: A - template: whalesay + template: hello-world - name: B depends: "A" template: intentional-fail - name: C depends: "A" - template: whalesay + template: hello-world - name: D depends: "B.Failed && C" - template: whalesay + template: hello-world - name: E depends: "A" template: intentional-fail - name: F depends: "A" - template: whalesay + template: hello-world - name: G depends: "E && F" - template: whalesay + template: hello-world - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] - name: intentional-fail diff --git a/examples/dag-disable-failFast.yaml b/examples/dag-disable-failFast.yaml index 4fe5fd00ff32..662ce0547c9c 100644 --- a/examples/dag-disable-failFast.yaml +++ b/examples/dag-disable-failFast.yaml @@ -7,8 +7,8 @@ spec: templates: - name: a container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] - name: b retryStrategy: @@ -26,8 +26,8 @@ spec: args: ["echo intentional failure; exit 2"] - name: d container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] - name: statis dag: diff --git a/examples/dns-config.yaml b/examples/dns-config.yaml index 35a621864827..7286fe1c69b4 100644 --- a/examples/dns-config.yaml +++ b/examples/dns-config.yaml @@ -3,12 +3,12 @@ kind: Workflow # new type of k8s spec metadata: generateName: test-dns-config- # name of the workflow spec spec: - entrypoint: whalesay # invoke the whalesay template + entrypoint: hello-world # invoke the hello-world template templates: - - name: whalesay # name of the template + - name: hello-world # name of the template container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] resources: # limit the resources limits: @@ -19,4 +19,4 @@ spec: - 1.2.3.4 options: - name: ndots - value: "2" \ No newline at end of file + value: "2" diff --git a/examples/example-golang/main.go b/examples/example-golang/main.go index 054526558bfe..b19953f3bb01 100644 --- a/examples/example-golang/main.go +++ b/examples/example-golang/main.go @@ -23,13 +23,13 @@ var helloWorldWorkflow = wfv1.Workflow{ GenerateName: "hello-world-", }, Spec: wfv1.WorkflowSpec{ - Entrypoint: "whalesay", + Entrypoint: "hello-world", Templates: []wfv1.Template{ { - Name: "whalesay", + Name: "hello-world", Container: &corev1.Container{ - Image: "docker/whalesay:latest", - Command: []string{"cowsay", "hello world"}, + Image: "busybox", + Command: []string{"echo", "hello world"}, }, }, }, diff --git a/examples/exit-handler-dag-level.yaml b/examples/exit-handler-dag-level.yaml index 3daa9b8808f8..8bf59993442b 100644 --- a/examples/exit-handler-dag-level.yaml +++ b/examples/exit-handler-dag-level.yaml @@ -39,12 +39,12 @@ spec: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] - name: exit container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["task cleanup"] diff --git a/examples/exit-handler-step-level.yaml b/examples/exit-handler-step-level.yaml index 47a795dd5091..dd9b18e43496 100644 --- a/examples/exit-handler-step-level.yaml +++ b/examples/exit-handler-step-level.yaml @@ -11,31 +11,31 @@ spec: steps: - - name: hello1 onExit: exit - template: whalesay + template: print-message arguments: parameters: [{name: message, value: "hello1"}] - - name: hello2a onExit: exit - template: whalesay + template: print-message arguments: parameters: [{name: message, value: "hello2a"}] - name: hello2b onExit: exit - template: whalesay + template: print-message arguments: parameters: [{name: message, value: "hello2b"}] - name: exit container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["step cleanup"] - - name: whalesay + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] diff --git a/examples/forever.yaml b/examples/forever.yaml index ee3d7123411f..943f429cab74 100644 --- a/examples/forever.yaml +++ b/examples/forever.yaml @@ -8,5 +8,5 @@ spec: templates: - name: main container: - image: docker/whalesay:latest + image: busybox command: [sh, "-c", "for I in $(seq 1 1000) ; do echo $I ; sleep 1s; done"] diff --git a/examples/gc-ttl.yaml b/examples/gc-ttl.yaml index 1ec6e372bc5d..d660892ba54a 100644 --- a/examples/gc-ttl.yaml +++ b/examples/gc-ttl.yaml @@ -10,11 +10,11 @@ spec: secondsAfterCompletion: 10 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished secondsAfterSuccess: 5 # Time to live after workflow is successful secondsAfterFailure: 5 # Time to live after workflow fails - entrypoint: whalesay + entrypoint: hello-world templates: - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] diff --git a/examples/global-parameters-from-configmap-referenced-as-local-variable.yaml b/examples/global-parameters-from-configmap-referenced-as-local-variable.yaml index cb88898461e2..701ebd1c1caa 100644 --- a/examples/global-parameters-from-configmap-referenced-as-local-variable.yaml +++ b/examples/global-parameters-from-configmap-referenced-as-local-variable.yaml @@ -6,12 +6,11 @@ metadata: workflows.argoproj.io/test: "true" annotations: workflows.argoproj.io/description: | - This example demonstrates global parameter from configmap can be referenced as template local variable. - Note that the "simple-parameters" ConfigMap (defined in examples/configmaps/simple-parameters-configmap.yaml) - needs to be created first before submitting this workflow. + This example demonstrates how a global parameter from a ConfigMap can be referenced as a template local variable. + Note that the "simple-parameters" ConfigMap (defined in `examples/configmaps/simple-parameters-configmap.yaml`) needs to be created first before submitting this workflow. spec: serviceAccountName: argo - entrypoint: whalesay + entrypoint: print-message arguments: parameters: - name: message @@ -20,10 +19,11 @@ spec: name: simple-parameters key: msg templates: - - name: whalesay + - name: print-message inputs: parameters: - name: message container: - image: argoproj/argosay:v2 - args: ["echo", "{{inputs.parameters.message}}"] + image: busybox + command: ["echo"] + args: ["{{inputs.parameters.message}}"] diff --git a/examples/global-parameters-from-configmap.yaml b/examples/global-parameters-from-configmap.yaml index 8a90c143b833..4b8dc78114a2 100644 --- a/examples/global-parameters-from-configmap.yaml +++ b/examples/global-parameters-from-configmap.yaml @@ -6,12 +6,11 @@ metadata: workflows.argoproj.io/test: "true" annotations: workflows.argoproj.io/description: | - This example demonstrates loading global parameter values from configmap. - Note that the "simple-parameters" ConfigMap (defined in examples/configmaps/simple-parameters-configmap.yaml) - needs to be created first before submitting this workflow. + This example demonstrates loading global parameter values from a ConfigMap. + Note that the "simple-parameters" ConfigMap (defined in `examples/configmaps/simple-parameters-configmap.yaml`) needs to be created first before submitting this workflow. spec: serviceAccountName: argo - entrypoint: whalesay + entrypoint: print-message # Parameters can also be passed via configmap reference. arguments: parameters: @@ -22,7 +21,8 @@ spec: key: msg templates: - - name: whalesay + - name: print-message container: - image: argoproj/argosay:v2 - args: ["echo", "{{workflow.parameters.message}}"] + image: busybox + command: ["echo"] + args: ["{{workflow.parameters.message}}"] diff --git a/examples/global-parameters.yaml b/examples/global-parameters.yaml index 179a61b7e35e..f70384cc08d6 100644 --- a/examples/global-parameters.yaml +++ b/examples/global-parameters.yaml @@ -3,7 +3,7 @@ kind: Workflow metadata: generateName: global-parameters- spec: - entrypoint: whalesay1 + entrypoint: print-message # Parameters can be passed/overridden via the argo CLI. # To override the printed message, run `argo submit` with the -p option: # $ argo submit examples/arguments-parameters.yaml -p message="goodbye world" @@ -13,8 +13,8 @@ spec: value: hello world templates: - - name: whalesay1 + - name: print-message container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["{{workflow.parameters.message}}"] diff --git a/examples/hdfs-artifact.yaml b/examples/hdfs-artifact.yaml index 0031b756387f..93e8fe35c384 100644 --- a/examples/hdfs-artifact.yaml +++ b/examples/hdfs-artifact.yaml @@ -14,19 +14,19 @@ spec: - name: artifact-example steps: - - name: generate-artifact - template: whalesay + template: hello-world-to-file - - name: consume-artifact - template: print-message + template: print-message-from-hdfs arguments: artifacts: - name: message from: "{{steps.generate-artifact.outputs.artifacts.hello-art}}" - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["cowsay hello world | tee /tmp/hello_world.txt"] + args: ["echo hello world | tee /tmp/hello_world.txt"] outputs: artifacts: - name: hello-art @@ -51,7 +51,7 @@ spec: # key: krb5.conf # krbServicePrincipalName: hdfs/_HOST - - name: print-message + - name: print-message-from-hdfs inputs: artifacts: - name: message diff --git a/examples/hello-world.yaml b/examples/hello-world.yaml index 4e3eb9afa0f3..17827681b777 100644 --- a/examples/hello-world.yaml +++ b/examples/hello-world.yaml @@ -8,10 +8,10 @@ metadata: workflows.argoproj.io/description: | This is a simple hello world example. spec: - entrypoint: whalesay + entrypoint: hello-world templates: - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] diff --git a/examples/image-pull-secrets.yaml b/examples/image-pull-secrets.yaml index 853bb83c88c2..40ffde4fe9ef 100644 --- a/examples/image-pull-secrets.yaml +++ b/examples/image-pull-secrets.yaml @@ -6,12 +6,12 @@ kind: Workflow metadata: generateName: hello-world- spec: - entrypoint: whalesay + entrypoint: hello-world imagePullSecrets: - name: docker-registry-secret templates: - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] diff --git a/examples/loops-dag.yaml b/examples/loops-dag.yaml index 202807cbee6a..0a3f278a45c9 100644 --- a/examples/loops-dag.yaml +++ b/examples/loops-dag.yaml @@ -10,13 +10,13 @@ spec: dag: tasks: - name: A - template: whalesay + template: print-message arguments: parameters: - {name: message, value: A} - name: B depends: "A" - template: whalesay + template: print-message arguments: parameters: - {name: message, value: "{{item}}"} @@ -26,16 +26,16 @@ spec: - baz - name: C depends: "B" - template: whalesay + template: print-message arguments: parameters: - {name: message, value: C} - - name: whalesay + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] diff --git a/examples/loops.yaml b/examples/loops.yaml index 5a71ed67834c..605067ee93f6 100644 --- a/examples/loops.yaml +++ b/examples/loops.yaml @@ -7,8 +7,8 @@ spec: templates: - name: loop-example steps: - - - name: print-message - template: whalesay + - - name: print-message-loop + template: print-message arguments: parameters: - name: message @@ -17,11 +17,11 @@ spec: - hello world - goodbye world - - name: whalesay + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] diff --git a/examples/memoize-simple.yaml b/examples/memoize-simple.yaml index 3459adffaed9..01d98258a1a6 100644 --- a/examples/memoize-simple.yaml +++ b/examples/memoize-simple.yaml @@ -4,7 +4,7 @@ # retrieved from the cache to be "different world". # Note that you also need to update `creationTimestamp` in # `data.hello` to be within the `memoize.maxAge` if `maxAge` is specified in the workflow spec. -# +# # apiVersion: v1 # data: # cache-key: '{"nodeID":"memoized-hdckj","outputs":{"parameters":[{"name":"hello","value":"different world","valueFrom":{"path":"/tmp/hello_world.txt"}}],"exitCode":"0"},"creationTimestamp":"2021-10-12T15:14:04Z","lastHitTimestamp":"2021-10-12T15:14:04Z"}' @@ -18,9 +18,9 @@ kind: Workflow metadata: generateName: memoized- spec: - entrypoint: whalesay + entrypoint: world-to-file templates: - - name: whalesay + - name: world-to-file memoize: key: "cache-key" maxAge: "10s" @@ -28,9 +28,9 @@ spec: configMap: name: cache-config container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["cowsay world > /tmp/hello_world.txt"] + args: ["echo world > /tmp/hello_world.txt"] outputs: parameters: - name: hello diff --git a/examples/nested-workflow.yaml b/examples/nested-workflow.yaml index 0eaa49d037b6..3a36116d4191 100644 --- a/examples/nested-workflow.yaml +++ b/examples/nested-workflow.yaml @@ -33,10 +33,10 @@ spec: # container template which generates an output parameter and artifact - name: generate container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] args: [" - cowsay hello world | tee /tmp/my-output-artifact.txt && + echo hello world | tee /tmp/my-output-artifact.txt && echo 'my-output-parameter' > /tmp/my-output-parameter.txt "] outputs: diff --git a/examples/output-artifact-azure.yaml b/examples/output-artifact-azure.yaml index aae6c18cf455..294b8ac5d2fe 100644 --- a/examples/output-artifact-azure.yaml +++ b/examples/output-artifact-azure.yaml @@ -6,13 +6,13 @@ kind: Workflow metadata: generateName: output-artifact-s3- spec: - entrypoint: whalesay + entrypoint: hello-world-to-file templates: - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["cowsay hello world | tee /tmp/hello_world.txt"] + args: ["echo hello world | tee /tmp/hello_world.txt"] outputs: artifacts: - name: message diff --git a/examples/output-artifact-gcs.yaml b/examples/output-artifact-gcs.yaml index a9cfb0b51804..d5dbdfbebb58 100644 --- a/examples/output-artifact-gcs.yaml +++ b/examples/output-artifact-gcs.yaml @@ -7,13 +7,13 @@ kind: Workflow metadata: generateName: output-artifact-gcs- spec: - entrypoint: whalesay + entrypoint: hello-world-to-file templates: - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["cowsay hello world | tee /tmp/hello_world.txt"] + args: ["echo hello world | tee /tmp/hello_world.txt"] outputs: artifacts: - name: message @@ -25,7 +25,7 @@ spec: # resulting object has an accurate file extension and mime-type. If archive is set to # 'none', then preserve the appropriate file extension for the key name key: path/in/bucket/hello_world.txt.tgz - + # serviceAccountKeySecret is a secret selector. # It references the k8s secret named 'my-gcs-credentials'. # This secret is expected to have have the key 'serviceAccountKey', diff --git a/examples/output-artifact-s3.yaml b/examples/output-artifact-s3.yaml index b1e475803eaf..097a7df621e0 100644 --- a/examples/output-artifact-s3.yaml +++ b/examples/output-artifact-s3.yaml @@ -6,13 +6,13 @@ kind: Workflow metadata: generateName: output-artifact-s3- spec: - entrypoint: whalesay + entrypoint: hello-world-to-file templates: - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["cowsay hello world | tee /tmp/hello_world.txt"] + args: ["echo hello world | tee /tmp/hello_world.txt"] outputs: artifacts: - name: message diff --git a/examples/output-parameter.yaml b/examples/output-parameter.yaml index bd632597fc09..641bf2e5f54c 100644 --- a/examples/output-parameter.yaml +++ b/examples/output-parameter.yaml @@ -5,8 +5,8 @@ # instead of stdout (as with script templates). Secondly, there can # be multiple 'output.parameters.xxx' in a single template, versus # a single 'output.result' from a script template. -# -# In this example, the 'whalesay' template produces an output +# +# In this example, the 'hello-world-to-file' template produces an output # parameter named 'hello-param', taken from the file contents of # /tmp/hello_world.txt. This parameter is passed to a subsequent # step as an input parameter to the template, 'print-message'. @@ -20,7 +20,7 @@ spec: - name: output-parameter steps: - - name: generate-parameter - template: whalesay + template: hello-world-to-file - - name: consume-parameter template: print-message arguments: @@ -28,9 +28,9 @@ spec: - name: message value: "{{steps.generate-parameter.outputs.parameters.hello-param}}" - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] args: ["sleep 1; echo -n hello world > /tmp/hello_world.txt"] outputs: @@ -45,6 +45,6 @@ spec: parameters: - name: message container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] diff --git a/examples/parameter-aggregation-dag.yaml b/examples/parameter-aggregation-dag.yaml index 4a0220f0ca7f..e3fd4e15b63c 100644 --- a/examples/parameter-aggregation-dag.yaml +++ b/examples/parameter-aggregation-dag.yaml @@ -19,14 +19,14 @@ spec: value: "{{item}}" withItems: [1, 2, 3, 4] - name: print-nums - template: whalesay + template: print-message depends: "odd-or-even" arguments: parameters: - name: message value: "{{tasks.odd-or-even.outputs.parameters.num}}" - name: print-evenness - template: whalesay + template: print-message depends: "odd-or-even" arguments: parameters: @@ -46,7 +46,7 @@ spec: # Finally, print all numbers processed in the previous step - name: print depends: "divide-by-2" - template: whalesay + template: print-message arguments: parameters: - name: message @@ -90,12 +90,12 @@ spec: args: - echo $(({{inputs.parameters.num}}/2)) - # whalesay prints a number using whalesay - - name: whalesay + # print-message prints a number + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] diff --git a/examples/parameter-aggregation.yaml b/examples/parameter-aggregation.yaml index 9ef03f6ba97a..d823f183b413 100644 --- a/examples/parameter-aggregation.yaml +++ b/examples/parameter-aggregation.yaml @@ -18,13 +18,13 @@ spec: value: "{{item}}" withItems: [1, 2, 3, 4] - - name: print-nums - template: whalesay + template: print-message arguments: parameters: - name: message value: "{{steps.odd-or-even.outputs.parameters.num}}" - - name: print-evenness - template: whalesay + template: print-message arguments: parameters: - name: message @@ -41,7 +41,7 @@ spec: when: "{{item.evenness}} == even" # Finally, print all numbers processed in the previous step - - name: print - template: whalesay + template: print-message arguments: parameters: - name: message @@ -86,12 +86,12 @@ spec: #!/bin/sh echo $(({{inputs.parameters.num}}/2)) - # whalesay prints a number using whalesay - - name: whalesay + # print-message prints a number + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] diff --git a/examples/pod-metadata-wf-field.yaml b/examples/pod-metadata-wf-field.yaml index 6aa9fc98146c..684c14c73007 100644 --- a/examples/pod-metadata-wf-field.yaml +++ b/examples/pod-metadata-wf-field.yaml @@ -5,29 +5,29 @@ metadata: generateName: steps- spec: entrypoint: hello-hello-hello - + podMetadata: annotations: iam.amazonaws.com/role: role-arn labels: - app: whalesay + app: print-message tier: demo templates: - name: hello-hello-hello steps: - - name: hello1 - template: whalesay + template: print-message arguments: parameters: - name: message value: "hello1" - - name: whalesay + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] diff --git a/examples/pod-metadata.yaml b/examples/pod-metadata.yaml index 319cdece7873..7a46aed01bf3 100644 --- a/examples/pod-metadata.yaml +++ b/examples/pod-metadata.yaml @@ -10,23 +10,23 @@ spec: - name: hello-hello-hello steps: - - name: hello1 - template: whalesay + template: print-message arguments: parameters: - name: message value: "hello1" - - name: whalesay + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] metadata: annotations: iam.amazonaws.com/role: role-arn labels: - app: whalesay + app: print-message tier: demo diff --git a/examples/pod-spec-patch-wf-tmpl.yaml b/examples/pod-spec-patch-wf-tmpl.yaml index 052c7f664bb2..ea794b194a35 100644 --- a/examples/pod-spec-patch-wf-tmpl.yaml +++ b/examples/pod-spec-patch-wf-tmpl.yaml @@ -3,7 +3,7 @@ kind: Workflow metadata: generateName: pod-spec-patch- spec: - entrypoint: whalesay + entrypoint: hello-world arguments: parameters: - name: cpu-limit @@ -17,9 +17,9 @@ spec: limits: memory: "{{workflow.parameters.mem-limit}}" templates: - - name: whalesay + - name: hello-world podSpecPatch: '{"containers":[{"name":"main", "resources":{"limits":{"cpu": "{{workflow.parameters.cpu-limit}}" }}}]}' container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] diff --git a/examples/pod-spec-patch.yaml b/examples/pod-spec-patch.yaml index 083c7ca4622b..7456f1f77e9e 100644 --- a/examples/pod-spec-patch.yaml +++ b/examples/pod-spec-patch.yaml @@ -3,15 +3,15 @@ kind: Workflow metadata: generateName: pod-spec-patch- spec: - entrypoint: whalesay + entrypoint: hello-world arguments: parameters: - name: cpu-limit value: 100m templates: - - name: whalesay + - name: hello-world podSpecPatch: '{"containers":[{"name":"main", "resources":{"limits":{"cpu": "{{workflow.parameters.cpu-limit}}" }}}]}' container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] diff --git a/examples/pod-spec-yaml-patch.yaml b/examples/pod-spec-yaml-patch.yaml index 0d4a13d4f2ea..0c0e1e63d25e 100644 --- a/examples/pod-spec-yaml-patch.yaml +++ b/examples/pod-spec-yaml-patch.yaml @@ -3,7 +3,7 @@ kind: Workflow metadata: generateName: pod-spec-patch- spec: - entrypoint: whalesay + entrypoint: hello-world arguments: parameters: - name: mem-limit @@ -15,8 +15,8 @@ spec: limits: memory: "{{workflow.parameters.mem-limit}}" templates: - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] diff --git a/examples/step-level-timeout.yaml b/examples/step-level-timeout.yaml index fc9bfa3545ba..5d9dd0bebe43 100644 --- a/examples/step-level-timeout.yaml +++ b/examples/step-level-timeout.yaml @@ -4,24 +4,24 @@ kind: Workflow metadata: generateName: steps-tmpl-timeout- spec: - entrypoint: hello-hello-hello + entrypoint: sleep-sleep templates: - - name: hello-hello-hello + - name: sleep-sleep steps: - - - name: hello1 + - - name: sleep1 continueOn: error: true - template: whalesay + template: sleep arguments: parameters: [{name: timeout, value: "10s"}] - - name: hello2 + - name: sleep2 continueOn: failed: true - template: whalesay + template: sleep arguments: parameters: [{name: timeout, value: "10s"}] - - name: whalesay + - name: sleep timeout: "{{inputs.parameters.timeout}}" inputs: parameters: @@ -29,4 +29,4 @@ spec: container: image: alpine:latest command: [sh, -c] - args: ["sleep 30s"] \ No newline at end of file + args: ["sleep 30s"] diff --git a/examples/steps.yaml b/examples/steps.yaml index c0434f4644a6..c5ffd1c5531d 100644 --- a/examples/steps.yaml +++ b/examples/steps.yaml @@ -10,23 +10,23 @@ spec: - name: hello-hello-hello steps: - - name: hello1 - template: whalesay + template: print-message arguments: parameters: [{name: message, value: "hello1"}] - - name: hello2a - template: whalesay + template: print-message arguments: parameters: [{name: message, value: "hello2a"}] - name: hello2b - template: whalesay + template: print-message arguments: parameters: [{name: message, value: "hello2b"}] - - name: whalesay + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] diff --git a/examples/suspend-template-outputs.yaml b/examples/suspend-template-outputs.yaml index 7c33c2071722..15c1b369c964 100644 --- a/examples/suspend-template-outputs.yaml +++ b/examples/suspend-template-outputs.yaml @@ -18,7 +18,7 @@ spec: - - name: approve template: approve - - name: release - template: whalesay + template: print-message arguments: parameters: - name: message @@ -32,11 +32,11 @@ spec: valueFrom: supplied: {} - - name: whalesay + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] diff --git a/examples/suspend-template.yaml b/examples/suspend-template.yaml index 1a4dcbc7f566..d85dedfc975f 100644 --- a/examples/suspend-template.yaml +++ b/examples/suspend-template.yaml @@ -19,13 +19,13 @@ spec: - name: suspend steps: - - name: build - template: whalesay + template: hello-world - - name: approve template: approve - - name: delay template: delay - - name: release - template: whalesay + template: hello-world - name: approve suspend: {} @@ -34,8 +34,8 @@ spec: suspend: duration: "20" # Must be a string. Default unit is seconds. Could also be a Duration, e.g.: "2m", "6h" - - name: whalesay + - name: hello-world container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] diff --git a/examples/synchronization-mutex-wf-level.yaml b/examples/synchronization-mutex-wf-level.yaml index 30bae7caace9..f13b199c6aaa 100644 --- a/examples/synchronization-mutex-wf-level.yaml +++ b/examples/synchronization-mutex-wf-level.yaml @@ -5,13 +5,13 @@ kind: Workflow metadata: generateName: synchronization-wf-level- spec: - entrypoint: whalesay + entrypoint: hello-world synchronization: mutex: name: test templates: - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] diff --git a/examples/synchronization-wf-level.yaml b/examples/synchronization-wf-level.yaml index f0d58a5d7666..b7ed90a092ca 100644 --- a/examples/synchronization-wf-level.yaml +++ b/examples/synchronization-wf-level.yaml @@ -1,4 +1,4 @@ -# This example demonstrates the use of a Synchronization lock on workflow execution. Synchronization lock limits +# This example demonstrates the use of a Synchronization lock on workflow execution. Synchronization lock limits # the number of concurrent workflow execution in the namespace which has same Synchronization lock. Synchronization # limit value can be configured in configmap. # Eg.: @@ -14,15 +14,15 @@ kind: Workflow metadata: generateName: synchronization-wf-level- spec: - entrypoint: whalesay + entrypoint: hello-world synchronization: semaphore: configMapKeyRef: name: my-config key: workflow templates: - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] diff --git a/examples/template-defaults.yaml b/examples/template-defaults.yaml index d5e4caa8f106..b3902b05091d 100644 --- a/examples/template-defaults.yaml +++ b/examples/template-defaults.yaml @@ -13,19 +13,19 @@ spec: timeout: 30s # timeout value will be applied to all templates retryStrategy: # retryStrategy value will be applied to all templates limit: "2" - + templates: - name: main steps: - - name: retry-backoff template: retry-backoff - - - name: whalesay - template: whalesay + - - name: hello-world + template: hello-world - - name: whalesay + - name: hello-world container: - image: argoproj/argosay:v2 - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] - name: retry-backoff diff --git a/examples/template-on-exit.yaml b/examples/template-on-exit.yaml index 38a58ed8a0f5..c27d21a5f301 100644 --- a/examples/template-on-exit.yaml +++ b/examples/template-on-exit.yaml @@ -1,12 +1,12 @@ # Example showing a Step with an onExit template. The onExit template ("exitContainer") -# will run after the parent ("whalesay"), regardless of if it fails or succeeds. +# will run after the parent ("hello-world"), regardless of if it fails or succeeds. # This is also similarly possible with DAG Tasks # # STEP TEMPLATE PODNAME DURATION MESSAGE # ✔ container-on-exit-fp8r5 step-template -# ├───✔ stepA whalesay container-on-exit-fp8r5-2775884244 12s +# ├───✔ stepA hello-world container-on-exit-fp8r5-2775884244 12s # ├─✔ stepA.onExit exitContainer container-on-exit-fp8r5-2310719573 2s -# ├───✔ stepB whalesay container-on-exit-fp8r5-3252557200 3s +# ├───✔ stepB hello-world container-on-exit-fp8r5-3252557200 3s # └─✔ stepB.onExit exitContainer container-on-exit-fp8r5-949151358 2s # # Template onExit containers work for DAG Tasks and Steps. @@ -22,19 +22,19 @@ spec: steps: - - name: stepA onExit: exitContainer - template: whalesay + template: hello-world - - name: stepB onExit: exitContainer - template: whalesay + template: hello-world - - name: whalesay + - name: hello-world container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] - name: exitContainer container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["goodbye world"] diff --git a/examples/title-and-description-with-markdown.yaml b/examples/title-and-description-with-markdown.yaml index 7750e57919ad..249f1c1d9bcd 100644 --- a/examples/title-and-description-with-markdown.yaml +++ b/examples/title-and-description-with-markdown.yaml @@ -12,10 +12,10 @@ metadata: `This is a simple hello world example.` This is an embedded link to the docs: https://argo-workflows.readthedocs.io/en/latest/title-and-description/ spec: - entrypoint: whalesay + entrypoint: hello-world templates: - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] diff --git a/examples/volumes-pvc.yaml b/examples/volumes-pvc.yaml index 46c548195581..383f43a920eb 100644 --- a/examples/volumes-pvc.yaml +++ b/examples/volumes-pvc.yaml @@ -1,4 +1,4 @@ -# This example demonstrates the ability for a workflow to create a +# This example demonstrates the ability for a workflow to create a # temporary, ephemeral volume used by the workflow, and delete it # when the workflow completes. It uses the same volumeClaimTemplates # syntax as statefulsets. @@ -21,20 +21,20 @@ spec: - name: volumes-pvc-example steps: - - name: generate - template: whalesay + template: hello-world-to-file - - name: print - template: print-message + template: print-message-from-file - - name: whalesay + - name: hello-world-to-file container: - image: docker/whalesay:latest + image: busybox command: [sh, -c] - args: ["echo generating message in volume; cowsay hello world | tee /mnt/vol/hello_world.txt"] + args: ["echo generating message in volume; echo hello world | tee /mnt/vol/hello_world.txt"] volumeMounts: - name: workdir mountPath: /mnt/vol - - name: print-message + - name: print-message-from-file container: image: alpine:latest command: [sh, -c] diff --git a/examples/work-avoidance.yaml b/examples/work-avoidance.yaml index 20cf2a7f18f4..a565d37fb7ab 100644 --- a/examples/work-avoidance.yaml +++ b/examples/work-avoidance.yaml @@ -49,7 +49,7 @@ spec: name: my-minio-cred key: secretkey container: - image: docker/whalesay:latest + image: busybox command: - mkdir - -p @@ -63,7 +63,7 @@ spec: parameters: - name: num script: - image: docker/whalesay:latest + image: busybox command: - bash - -eux @@ -86,7 +86,7 @@ spec: - name: save-markers container: - image: docker/whalesay:latest + image: busybox command: - "true" volumeMounts: diff --git a/examples/workflow-template/dag.yaml b/examples/workflow-template/dag.yaml index d0ba34c88eda..12801a8ffa13 100644 --- a/examples/workflow-template/dag.yaml +++ b/examples/workflow-template/dag.yaml @@ -17,8 +17,8 @@ spec: tasks: - name: A templateRef: - name: workflow-template-whalesay-template - template: whalesay-template + name: workflow-template-print-message + template: print-message arguments: parameters: - name: message @@ -26,8 +26,8 @@ spec: - name: B depends: "A" templateRef: - name: workflow-template-whalesay-template - template: whalesay-template + name: workflow-template-print-message + template: print-message arguments: parameters: - name: message @@ -40,8 +40,8 @@ spec: - name: D depends: "B && C" templateRef: - name: workflow-template-whalesay-template - template: whalesay-template + name: workflow-template-print-message + template: print-message arguments: parameters: - name: message diff --git a/examples/workflow-template/hello-world.yaml b/examples/workflow-template/hello-world.yaml index 4d68103b39b3..19ecde3e2e6f 100644 --- a/examples/workflow-template/hello-world.yaml +++ b/examples/workflow-template/hello-world.yaml @@ -3,14 +3,14 @@ kind: Workflow metadata: generateName: workflow-template-hello-world- spec: - entrypoint: whalesay + entrypoint: hello-world-from-templateRef templates: - - name: whalesay + - name: hello-world-from-templateRef steps: - - - name: call-whalesay-template + - - name: call-print-message templateRef: - name: workflow-template-whalesay-template - template: whalesay-template + name: workflow-template-print-message + template: print-message arguments: parameters: - name: message diff --git a/examples/workflow-template/steps.yaml b/examples/workflow-template/steps.yaml index 87dd30d5bacc..e3bcee9a13b9 100644 --- a/examples/workflow-template/steps.yaml +++ b/examples/workflow-template/steps.yaml @@ -9,8 +9,8 @@ spec: steps: - - name: hello1 templateRef: - name: workflow-template-whalesay-template - template: whalesay-template + name: workflow-template-print-message + template: print-message arguments: parameters: - name: message @@ -25,8 +25,8 @@ spec: value: "hello2a" - name: hello2b templateRef: - name: workflow-template-whalesay-template - template: whalesay-template + name: workflow-template-print-message + template: print-message arguments: parameters: - name: message diff --git a/examples/workflow-template/templates.yaml b/examples/workflow-template/templates.yaml index 5b69fc5d26bf..bdd465141221 100644 --- a/examples/workflow-template/templates.yaml +++ b/examples/workflow-template/templates.yaml @@ -1,17 +1,17 @@ apiVersion: argoproj.io/v1alpha1 kind: WorkflowTemplate metadata: - name: workflow-template-whalesay-template + name: workflow-template-print-message spec: - entrypoint: whalesay-template + entrypoint: print-message templates: - - name: whalesay-template + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] --- apiVersion: argoproj.io/v1alpha1 @@ -35,34 +35,34 @@ metadata: name: workflow-template-inner-steps spec: templates: - - name: whalesay-template + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] - name: inner-steps steps: - - name: inner-hello1 templateRef: - name: workflow-template-whalesay-template - template: whalesay-template + name: workflow-template-print-message + template: print-message arguments: parameters: - name: message value: "inner-hello1" - - name: inner-hello2a templateRef: - name: workflow-template-whalesay-template - template: whalesay-template + name: workflow-template-print-message + template: print-message arguments: parameters: - name: message value: "inner-hello2a" - name: inner-hello2b - template: whalesay-template + template: print-message arguments: parameters: - name: message @@ -81,35 +81,35 @@ metadata: name: workflow-template-inner-dag spec: templates: - - name: whalesay-template + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] - name: inner-diamond dag: tasks: - name: inner-A templateRef: - name: workflow-template-whalesay-template - template: whalesay-template + name: workflow-template-print-message + template: print-message arguments: parameters: - name: message value: inner-A - name: inner-B depends: "inner-A" - template: whalesay-template + template: print-message arguments: parameters: - name: message value: inner-B - name: inner-C depends: "inner-A" - template: whalesay-template + template: print-message arguments: parameters: - name: message @@ -117,8 +117,8 @@ spec: - name: inner-D depends: "inner-B && inner-C" templateRef: - name: workflow-template-whalesay-template - template: whalesay-template + name: workflow-template-print-message + template: print-message arguments: parameters: - name: message @@ -129,17 +129,17 @@ kind: WorkflowTemplate metadata: name: workflow-template-submittable spec: - entrypoint: whalesay-template + entrypoint: print-message arguments: parameters: - name: message value: hello world templates: - - name: whalesay-template + - name: print-message inputs: parameters: - name: message container: - image: docker/whalesay - command: [cowsay] + image: busybox + command: [echo] args: ["{{inputs.parameters.message}}"] diff --git a/examples/workflow-template/workflow-archive-logs.yaml b/examples/workflow-template/workflow-archive-logs.yaml index e4df030a689a..ffcfe1bd5b27 100644 --- a/examples/workflow-template/workflow-archive-logs.yaml +++ b/examples/workflow-template/workflow-archive-logs.yaml @@ -5,10 +5,10 @@ metadata: spec: # archiveLogs allows configuring the archive location for the workflow archiveLogs: true - entrypoint: whalesay + entrypoint: hello-world templates: - - name: whalesay + - name: hello-world container: - image: docker/whalesay:latest - command: [cowsay] + image: busybox + command: [echo] args: ["hello world"] diff --git a/examples/workflow-template/workflow-template-ref-with-entrypoint-arg-passing.yaml b/examples/workflow-template/workflow-template-ref-with-entrypoint-arg-passing.yaml index 196622ebecea..bfa95ddde2e7 100644 --- a/examples/workflow-template/workflow-template-ref-with-entrypoint-arg-passing.yaml +++ b/examples/workflow-template/workflow-template-ref-with-entrypoint-arg-passing.yaml @@ -3,12 +3,12 @@ kind: Workflow metadata: generateName: workflow-template-hello-world- spec: - entrypoint: whalesay-template + entrypoint: print-message arguments: parameters: - name: message value: "hello world" workflowTemplateRef: - name: workflow-template-whalesay-template + name: workflow-template-print-message diff --git a/hack/test-examples.sh b/hack/test-examples.sh index 4b46fdc52a40..1848f3a5b41a 100755 --- a/hack/test-examples.sh +++ b/hack/test-examples.sh @@ -7,7 +7,7 @@ kubectl apply -f examples/configmaps/simple-parameters-configmap.yaml echo "Checking for banned images..." grep -lR 'workflows.argoproj.io/test' examples/* | while read f ; do echo " - $f" - test 0 == $(grep -o 'image: .*' $f | grep -cv 'argoproj/argosay:v2\|python:alpine3.6') + test 0 == $(grep -o 'image: .*' $f | grep -cv 'argoproj/argosay:v2\|python:alpine3.6\|busybox') done trap 'kubectl get wf' EXIT