Harnessing Kubeflow Pipelines with Argo Workflows: A Practical Guide to Scalable, Reproducible ML Pipelines
Learn how Kubeflow Pipelines leverages Argo Workflows to build scalable, reproducible ML pipelines. Step‑by‑step guide, example code, trade‑offs, and a production checklist.
06 Mar 2026, 08:26 UTC

Problem: Scaling and Reproducibility in ML Pipelines
Data scientists often prototype models on a laptop, but production deployments require a robust workflow that can run at scale, retry failures, and produce identical results across runs. Without a clear execution engine, teams struggle with ad‑hoc scripts that are hard to audit and difficult to run on a Kubernetes cluster.
Thesis: Kubeflow Pipelines + Argo Workflows = Production‑Ready Workflows
Kubeflow Pipelines (KFP) ships with Argo Workflows as its underlying execution engine. This built‑in integration turns every pipeline step into a Kubernetes pod, automatically manages dependencies, and stores artifacts in a shared object store. The result is a declarative, versioned, and fully automated ML pipeline that can be run on any Kubernetes cluster with Argo installed.
1. How the Integration Works
When you submit a pipeline via the KFP SDK, the SDK translates the pipeline definition into an Argo Workflow YAML. Each component in the pipeline becomes a container step in the Workflow. Argo handles:
- Scheduling pods on the cluster
- Retry logic (configurable per step)
- Parallel execution based on dependencies
- Logging and status reporting through the Argo UI and REST API
Artifacts produced by a step are written to a shared object store (S3, GCS, MinIO, etc.) via the KFP SDK. The store URL is passed to the next step as an input, ensuring deterministic data flow.
2. Building a Minimal Pipeline
Below is a minimal example that trains a logistic regression model and uploads the trained weights. Replace the placeholder image names with your own.
from kfp import dsl
from kfp.components import create_component_from_func
# Component that trains a model
@create_component_from_func
def train_model(input_path: str, output_path: str):
import joblib, pandas as pd
df = pd.read_csv(input_path)
X, y = df.drop('label', axis=1), df['label']
from sklearn.linear_model import LogisticRegression
model = LogisticRegression().fit(X, y)
joblib.dump(model, output_path)
# Component that uploads the model
@create_component_from_func
def upload_model(model_path: str, output_path: str):
import shutil
shutil.copy(model_path, output_path)
@dsl.pipeline(name="simple-ml-pipeline")
def simple_pipeline():
train = train_model(
input_path="s3://my-bucket/data/train.csv",
output_path="/tmp/model.joblib"
)
upload = upload_model(
model_path="/tmp/model.joblib",
output_path="s3://my-bucket/models/model.joblib"
)
upload.after(train)
if __name__ == "__main__":
import kfp.compiler as compiler
compiler.Compiler().compile(simple_pipeline, "simple_pipeline.yaml")
After compiling, upload the YAML to your KFP deployment:
# kubectl apply -f simple_pipeline.yaml
# kubectl get workflows -n kubeflow
The Argo UI (usually https://argo.kubeflow.example.com) will show a Workflow named simple-ml-pipeline with two steps. Each step’s pod logs are accessible from the UI.
3. Trade‑offs & Limitations
- Argo Installation & RBAC: Argo must be installed separately and granted permissions to create pods and access the object store. Misconfigured RBAC can block pipeline execution.
- Artifact Volume: Large datasets or model files increase storage and network costs. Consider compressing artifacts or pruning intermediate files.
- Runtime Compatibility: Container images must match the cluster’s runtime (e.g., GPU drivers). Incompatible images may fail silently, producing empty artifacts.
- Debugging Complexity: While Argo provides logs, debugging a failing step may require inspecting the pod directly with
kubectl logsand verifying the correct container image was pulled.
4. Actionable Checklist for Production Adoption
- Verify Argo is Running –
kubectl get pods -n argoshould show the controller and server pods healthy. - Configure Object Store – Ensure the KFP config (or
kubeflow/config.yaml) points to a bucket with proper IAM policies. - Test a Minimal Pipeline – Compile and submit the example above; confirm the Workflow appears and succeeds.
- Set Retry Policies – In the SDK, use
retry_strategy=RetryStrategy(max_attempts=3)for idempotent steps. - Enable Auditing – Store pipeline definitions in Git and tag the KFP version; use the UI’s version history to rollback if needed.
- Monitor Resource Usage – Use Prometheus + Grafana dashboards to watch CPU/GPU consumption per step.
By following this checklist, teams can confidently move from prototype scripts to fully automated, reproducible ML pipelines that scale with their data and model complexity.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.