feat(sdk/backend): support PipelineChannel in set_env_variable#13034
feat(sdk/backend): support PipelineChannel in set_env_variable#13034JerT33 wants to merge 1 commit intokubeflow:masterfrom
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
3a98889 to
b048202
Compare
There was a problem hiding this comment.
Pull request overview
Adds end-to-end support for using PipelineChannel values as task environment variables by wiring them through the compiled IR and resolving the resulting {{$.inputs.parameters[...]}} placeholders at runtime in the v2 driver. This fits into KFP’s existing “compiler-injected input + placeholder substitution” mechanism used for other dynamic container fields.
Changes:
- SDK: Allow
PipelineChannelinPipelineTask.set_env_variable()and track channel dependencies. - Compiler: Inject env-var channel references into task inputs and convert env values to
{{$.inputs.parameters[...]}}placeholders. - Backend: Resolve env-var placeholders during pod spec patch generation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| sdk/python/kfp/dsl/pipeline_task.py | Expands set_env_variable to accept PipelineChannel and register channel inputs. |
| sdk/python/kfp/compiler/pipeline_spec_builder.py | Adds env-var channel injection into task inputs and converts env values via placeholder conversion. |
| backend/src/v2/driver/driver.go | Resolves env var values at runtime using executor input before creating the pod spec patch. |
You can also share your feedback on Copilot code review. Take the survey.
b048202 to
b8255d2
Compare
There was a problem hiding this comment.
Pull request overview
Adds end-to-end support for using PipelineChannel values in PipelineTask.set_env_variable, so dynamic env vars compile correctly and are resolved at runtime by the v2 driver.
Changes:
- SDK: broaden
set_env_variableto acceptPipelineChanneland track channel inputs. - Compiler: inject env-var channel references into task inputs and convert env values to IR placeholders.
- Backend driver: resolve
{{$.inputs.parameters[...]}}placeholders in container env var values at runtime.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/kfp/dsl/pipeline_task_test.py | Adds SDK-level unit test for PipelineChannel env var support. |
| sdk/python/kfp/dsl/pipeline_task.py | Updates set_env_variable API to accept PipelineChannel and register channel inputs. |
| sdk/python/kfp/compiler/pipeline_spec_builder.py | Injects env var channels into task inputs and converts env values to placeholders. |
| sdk/python/kfp/compiler/compiler_test.py | Adds compiler regression test ensuring env var compiles to pipelinechannel--... placeholder wiring. |
| backend/src/v2/driver/driver.go | Resolves env var input-parameter placeholders in initPodSpecPatch. |
You can also share your feedback on Copilot code review. Take the survey.
b8255d2 to
03b7bb9
Compare
There was a problem hiding this comment.
Pull request overview
Adds end-to-end support for using dynamic PipelineChannel values in task environment variables, spanning DSL task configuration, compiler placeholder conversion/injection, and backend runtime resolution so env vars evaluate to concrete values inside the running pod.
Changes:
- SDK (DSL):
PipelineTask.set_env_variablenow acceptsPipelineChannelvalues and registers any referenced channels as task channel inputs. - Compiler: detects pipeline channels embedded in env var values, injects the required task inputs, and converts env var channel placeholders to IR input placeholders.
- Backend (driver): resolves
{{$.inputs.parameters[...]}}placeholders in container env var values at runtime before constructing the pod spec.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/kfp/dsl/pipeline_task.py | Accepts PipelineChannel in set_env_variable and tracks referenced channels for compilation/topology. |
| sdk/python/kfp/dsl/pipeline_task_test.py | Adds unit coverage for set_env_variable with a PipelineParameterChannel. |
| sdk/python/kfp/compiler/pipeline_spec_builder.py | Injects env var channel references into task inputs and converts env var values to IR placeholders. |
| sdk/python/kfp/compiler/compiler_test.py | Adds compiler tests asserting env var placeholder conversion + injected inputs in the compiled YAML. |
| backend/src/v2/driver/driver.go | Resolves input-parameter placeholders in env var values when building the pod spec patch. |
You can also share your feedback on Copilot code review. Take the survey.
Signed-off-by: JerT33 <trestjeremiah@gmail.com> compiler updates Signed-off-by: JerT33 <trestjeremiah@gmail.com> address copilot feedback Signed-off-by: JerT33 <trestjeremiah@gmail.com> fix tests Signed-off-by: JerT33 <trestjeremiah@gmail.com> fix formatting Signed-off-by: JerT33 <trestjeremiah@gmail.com>
03b7bb9 to
8e436b9
Compare
Description of your changes:
PipelineChannelinset_env_variableand register channel inputsresolvePodSpecInputRuntimeParameterLive Cluster Testing Evidence:
SDK
Before:
After:
Driver
Before:
After:
Checklist: