Skip to content

Commit

Permalink
Introduces PipelineConfig class with TTL configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo M. Oliveira <[email protected]>
  • Loading branch information
rimolive committed Oct 31, 2024
1 parent 6684b6d commit 961daf4
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 11 deletions.
6 changes: 3 additions & 3 deletions api/v2alpha1/go/cachekey/cache_key.pb.go

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

24 changes: 18 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.

1 change: 1 addition & 0 deletions api/v2alpha1/pipeline_spec.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1104,4 +1104,5 @@ message PlatformDeploymentConfig {
// Spec for pipeline-level config options. See PipelineConfig DSL class.
message PipelineConfig {
// TODO add pipeline-level configs
int32 pipelineTtl = 1;
}
5 changes: 5 additions & 0 deletions sdk/python/kfp/compiler/pipeline_spec_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,11 @@ def _merge_pipeline_config(pipelineConfig: pipeline_config.PipelineConfig,
# '<some pipeline config option>': pipelineConfig.<get that value>,
# }}, platformSpec.platforms['kubernetes'])

pipeline_config_json = json_format.ParseDict(
{'pipelineConfig': {
'pipelineTtl': pipelineConfig.get_ttl(),
}}, platformSpec.platforms['kubernetes'])

return platformSpec


Expand Down
6 changes: 4 additions & 2 deletions sdk/python/kfp/dsl/pipeline_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
class PipelineConfig:
"""PipelineConfig contains pipeline-level config options."""

def __init__(self):
pass
def __init__(self, ttl=None):
self.ttl, ttl

# TODO add pipeline level configs
def set_pipeline_ttl(self, ttl: int):
self.ttl = ttl

0 comments on commit 961daf4

Please sign in to comment.