feat(pipelines): add pipelines client module #468
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 424 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.362
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #468"
general
weight: 0.35
abhijeet-dhumal
Fixes #182
This adds a
pipelinesclient module that wrapskubeflow.pipelines.PipelinesClientfrom SDK 0.5.0. With it an agent can find registered pipelines, start a run, follow it, read the task logs, and stop or retry a run. I kept to the tool list in the issue and followed the trainer module layout and CONVENTIONS.md.Tools
| Tool | What it does | How it's done | Persona |
|---|---|---|---|
|
list_pipelines| Lists registered pipelines, paged |PipelinesClient.list_pipelines| readonly ||
get_pipeline| One pipeline plus its last 20 versions |get_pipeline,list_pipeline_versions| readonly ||
list_pipeline_runs| Runs, filter by pipeline, experiment or status |list_runs| readonly ||
get_pipeline_run| State, error, params and task states of a run |get_run| readonly ||
get_pipeline_logs| Logs of the task pods of a run | pod names fromget_run, thenread_namespaced_pod_log| readonly ||
create_pipeline_run| Starts a run of a registered pipeline |get_pipeline, thenrun(Pipeline, ...)| data-scientist ||
stop_pipeline_run| Stops a running run |kfp_client().terminate_run| ml-engineer ||
retry_pipeline_run| Retries a failed or canceled run | kfp run APIrun_service_retry_run| ml-engineer |The three write tools return a preview first and only act with
confirmed=True, same as the trainer tools.Things the SDK doesn't cover
PipelinesClienthas no method for logs, stop or retry, so:get_pipeline_logsreads the pod names KFP stores on each task, then those pods' logs from themaincontainer (falls back to the default container). It only reads pods that belong to that run.stop_pipeline_runuses the publickfp_client().terminate_run(run_id).retry_pipeline_runuses the privatekfp_client()._run_api.run_service_retry_run(run_id); I pinned it insdk_contracts_test.pyso a kfp change shows up as a failing test.Safety
check_namespace_allowed(), then handed to the client. Fails closed if the default can't be resolved.run()as aPipelineobject. File paths and names ending in.yaml,.yml,.zip,.tgz,.tar.gzare rejected, because the SDK would otherwise read that file from the server's disk.KUBEFLOW_MCP_PIPELINES_URL,KUBEFLOW_MCP_PIPELINES_TOKEN), so an agent can't point the server at another endpoint.ml-engineer, the preview says it acts on any run in the namespace, and all three write tools are listed indocs/design/mutation-safety.md.The pipelines extra
kubeflow[pipelines]pulls kfp 2.17, which needskubernetes<31, and this repo pinskubernetes>=35, so the lock can't resolve (open KFP issue: kubeflow/pipelines#13390). kfp is imported lazily, the server starts fine without it, and the pipelines tools return a clear "install kubeflow[pipelines]" error. The supported install path (pip install . 'kubeflow[pipelines]') is documented in the README.Tests
Tests mock
PipelinesClient, so they run in CI without kfp or a cluster; the module sits at ~96% coverage.sdk_contracts_test.pypins the real kfp calls, but it only runs where kfp is installed.