Skip to content

Commit

Permalink
DRAFT WIP - do not merge - demonstration of PipelineConfig
Browse files Browse the repository at this point in the history
Demonstration of proposed KFP DSL PipelineConfig class.

Signed-off-by: Greg Sheremeta <[email protected]>
  • Loading branch information
gregsheremeta committed Aug 17, 2024
1 parent f160004 commit ba657de
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
25 changes: 19 additions & 6 deletions api/v2alpha1/go/pipelinespec/pipeline_spec.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/v2alpha1/pipeline_spec.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1058,5 +1058,5 @@ message PlatformDeploymentConfig {

// Spec for pipeline-level config options. See PipelineConfig DSL class.
message PipelineConfig {
// TODO add pipeline-level configs
string example_pipeline_config = 1;
}
4 changes: 3 additions & 1 deletion sdk/python/kfp/compiler/pipeline_spec_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,9 @@ def create_pipeline_spec(

# pipeline-level config options
pipeline_config_spec = pipeline_spec_pb2.PipelineConfig()
# TODO add pipeline-level config options
if pipeline_config.example_pipeline_config is not None and pipeline_config.example_pipeline_config != "":
pipeline_config_spec.example_pipeline_config = pipeline_config.example_pipeline_config


pipeline_spec.root.CopyFrom(
_build_component_spec_from_component_spec_structure(component_spec))
Expand Down
10 changes: 8 additions & 2 deletions sdk/python/kfp/dsl/pipeline_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ class PipelineConfig:
"""PipelineConfig contains pipeline-level config options."""

def __init__(self):
pass
self.example_pipeline_config = "some-important-value"

# TODO add pipeline level configs
def set_example_pipeline_config(self, example_pipeline_config: str):
"""Example of a pipeline-level config option.
Args:
example_pipeline_config: example setting to set in the PipelineConfig spec
"""
self.example_pipeline_config = example_pipeline_config
return self

0 comments on commit ba657de

Please sign in to comment.