Argo Workflows
Argo Workflows
A Kubernetes-native workflow engine. Used for ML pipelines and CI/CD.
Argo Workflows
A Kubernetes-native workflow engine. Used for ML pipelines and CI/CD.
Argo Workflows is a Kubernetes-native workflow engine that defines and runs complex job pipelines in the form of a DAG (Directed Acyclic Graph). Each task runs as a container, and it can make full use of Kubernetes' scalability and resource management features.
The main use cases are ML pipelines, data processing, and CI/CD. For example, in an ML workflow, the steps "data collection -> preprocessing -> model training -> evaluation -> deployment" each run as an independent container, and dependencies between steps and data passing are managed. If a step fails, only that step can be retried, or the workflow can be restarted from a specific step.
The core concepts of Argo Workflows are Workflow (the entire pipeline), Template (a reusable task definition), Step/DAG (task ordering definition), and Artifact (data passing between tasks). Artifacts are stored in object storage such as S3, GCS, and MinIO, and files are exchanged between workflow steps.
When used together with ArgoCD (GitOps deployment), Argo Events (event-based triggers), and Argo Rollouts (progressive delivery), which are also Argo projects, you can build a complete cloud-native CI/CD/ML platform. It is also used as the internal engine of Kubeflow Pipelines.
# ml-pipeline.yaml - ML νμ΅ νμ΄νλΌμΈ μν¬νλ‘μ°
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: ml-pipeline-
spec:
entrypoint: ml-pipeline
# Artifact μ μ₯μ μ€μ
artifactRepositoryRef:
configMap: artifact-repositories
key: default-v1
# μν¬νλ‘μ° μ μ νλΌλ―Έν°
arguments:
parameters:
- name: dataset-version
value: "v2.1"
- name: model-name
value: "sentiment-classifier"
templates:
- name: ml-pipeline
dag:
tasks:
# 1λ¨κ³: λ°μ΄ν° λ€μ΄λ‘λ
- name: download-data
template: download
arguments:
parameters:
- name: version
value: "{{workflow.parameters.dataset-version}}"
# 2λ¨κ³: μ μ²λ¦¬ (download μλ£ ν)
- name: preprocess
template: preprocess
dependencies: [download-data]
arguments:
artifacts:
- name: raw-data
from: "{{tasks.download-data.outputs.artifacts.dataset}}"
# 3λ¨κ³: λͺ¨λΈ νμ΅ (μ μ²λ¦¬ μλ£ ν)
- name: train-model
template: train
dependencies: [preprocess]
arguments:
artifacts:
- name: processed-data
from: "{{tasks.preprocess.outputs.artifacts.processed}}"
# 4λ¨κ³: νκ°
- name: evaluate
template: evaluate
dependencies: [train-model]
# κ°λ³ ν
νλ¦Ώ μ μ
- name: download
inputs:
parameters:
- name: version
container:
image: myregistry/data-loader:latest
command: [python, download.py]
args: ["--version", "{{inputs.parameters.version}}"]
outputs:
artifacts:
- name: dataset
path: /data/output
- name: train
inputs:
artifacts:
- name: processed-data
path: /data/input
container:
image: myregistry/ml-trainer:latest
resources:
requests:
nvidia.com/gpu: 1
command: [python, train.py]
outputs:
artifacts:
- name: model
path: /models/output
ML Engineer: "The training pipeline keeps failing at the preprocessing step. Did you check the logs in the Argo UI?"
Junior: "Yes, it was an OOM. I raised the resource request to 8Gi and it passed."
Senior: "Then you can resubmit the failed workflow and it will restart from preprocessing. Since the data download has an artifact, it will be skipped."
Interviewer: "Do you have experience with ML pipeline orchestration?"
Candidate: "I built a daily training pipeline using Argo Workflows. I defined everything from data collection to model deployment as a DAG, and set a nodeSelector so that it is scheduled on GPU nodes. I integrated it with Argo Events so that the pipeline is triggered automatically when new data is uploaded to S3."
Take a mock interview on this topic β WIA SOOM AI Interview Β· Start for free
Reviewer: "Please add a retryStrategy to this workflow, so that it automatically retries if it fails due to a temporary network error."
Author: "I'll add retryStrategy: limit: 3, retryPolicy: Always. Should I add backoff as well?"