Skip to content

Add local pipeline run support to the CLI#1039

Draft
SharangC96 wants to merge 2 commits into
masterfrom
local-pipeline-run
Draft

Add local pipeline run support to the CLI#1039
SharangC96 wants to merge 2 commits into
masterfrom
local-pipeline-run

Conversation

@SharangC96
Copy link
Copy Markdown
Contributor

Summary

  • add clarifai pipeline run --local for running pipeline workflows on a local Kubernetes cluster
  • add local pipeline runner modules for preflight checks, image loading, spec adaptation, workflow submission, and log streaming
  • support local validation with sample multi-step pipeline runs on minikube

Testing

  • manual: clarifai pipeline run --local /tmp/test-local-pipeline
  • manual: verified chained two-step pipeline execution and log streaming on minikube

SharangC96 and others added 2 commits May 12, 2026 11:26
Introduce local pipeline execution that bypasses the Clarifai API and
submits Argo Workflows directly to a Minikube/K3s/kind cluster.

New modules in clarifai/runners/pipelines/local/:
- preflight.py: validates Docker, kubectl, Argo CRDs, cluster type detection
- image_loader.py: builds step Docker images and loads into local cluster
- spec_adapter.py: converts templateRef to inline templates for local execution
- secrets.py: creates K8s Secrets with Clarifai env vars
- submitter.py: submits Argo Workflow CR via kubectl
- log_streamer.py: streams pod logs in real-time with step prefixes
- runner.py: orchestrates the full local pipeline run

CLI changes:
- Add --local and --namespace flags to clarifai pipeline run
- When --local is set, skip all API calls and run locally

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
if result.returncode != 0:
raise RuntimeError(f'Failed to create secret {secret_name}: {result.stderr}')

logger.info(f'Created K8s secret {secret_name} in namespace {namespace}.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants