Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK/Client - Supporting pipeline packages with multiple files #1207

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions sdk/python/kfp/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,12 @@ def _extract_pipeline_yaml(self, package_file):
if len(all_yaml_files) == 0:
raise ValueError('Invalid package. Missing pipeline yaml file in the package.')

if len(all_yaml_files) > 1:
raise ValueError('Invalid package. Multiple yaml files in the package.')
pipeline_file = all_yaml_files[0]
if 'pipeline.yaml' in all_yaml_files:
pipeline_file = 'pipeline.yaml'
else:
if len(all_yaml_files) > 1:
raise ValueError('Invalid package. There is no pipeline.yaml file and there are multiple yaml files.')

with tar.extractfile(all_yaml_files[0]) as f:
return yaml.load(f)
Expand All @@ -186,8 +190,12 @@ def _extract_pipeline_yaml(self, package_file):
if len(all_yaml_files) == 0:
raise ValueError('Invalid package. Missing pipeline yaml file in the package.')

if len(all_yaml_files) > 1:
raise ValueError('Invalid package. Multiple yaml files in the package.')
pipeline_file = all_yaml_files[0]
if 'pipeline.yaml' in all_yaml_files:
pipeline_file = 'pipeline.yaml'
else:
if len(all_yaml_files) > 1:
raise ValueError('Invalid package. There is no pipeline.yaml file and there are multiple yaml files.')

filename = zip.extract(all_yaml_files[0])
with open(filename, 'r') as f:
Expand Down