스텝 (Steps)
여러 스텝으로 이루어진 워크플로와 중첩된 워크플로를 만들 수 있고, 하나의 워크플로에 템플릿을 여러 개 정의할 수도 있습니다. 아래 예제의 주석을 참고하세요.
본문
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: steps-
spec:
entrypoint: hello-hello-hello
# 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: print-message
arguments:
parameters:
- name: message
value: "hello1"
- - name: hello2a # double dash => run after previous step
template: print-message
arguments:
parameters:
- name: message
value: "hello2a"
- name: hello2b # single dash => run in parallel with previous step
template: print-message
arguments:
parameters:
- name: message
value: "hello2b"
# This is the same template as from the previous example
- name: print-message
inputs:
parameters:
- name: message
container:
image: busybox
command: [echo]
args: ["{{inputs.parameters.message}}"]
위 워크플로는 "hello"의 세 가지 변형을 출력합니다.
hello-hello-hello 템플릿에는 세 개의 steps가 있습니다.
첫 번째 스텝인 hello1은 순차적으로 실행되고, 그다음 두 스텝인 hello2a와 hello2b는 서로 병렬로 실행됩니다.
argo get CLI 명령을 사용하면 실행 이력을 표시할 수 있습니다.
아래 예제 출력은 hello2a와 hello2b가 병렬로 실행되었음을 보여줍니다:
STEP TEMPLATE PODNAME DURATION MESSAGE
✔ steps-z2zdn hello-hello-hello
├───✔ hello1 print-message steps-z2zdn-27420706 2s
└─┬─✔ hello2a print-message steps-z2zdn-2006760091 3s
└─✔ hello2b print-message steps-z2zdn-2023537710 3s
더 알아보기 (Learn more)
- 이중 대시(
- -)는 새 스텝 그룹, 단일 대시는 같은 그룹 내 병렬 스텝을 의미합니다. argo get명령으로 스텝 실행 순서와 소요 시간을 트리 형태로 확인할 수 있습니다.