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

feat(sdk): update component deserialization logic for custom artifacts (support custom artifact types pt. 3) #8181

Conversation

connor-mccarthy
Copy link
Member

Description of your changes:
This PR fixes component deserialization logic for components with input and output
artifacts.

Currently, the SDK cannot deserialize components with artifact inputs and does
not handle inputs and outputs correctly when deserializing v1 component YAML. This
fix is a requirement for supporting custom artifact types.

Checklist:

@google-oss-prow
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from connor-mccarthy by writing /assign @connor-mccarthy in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot requested a review from zijianjoy August 23, 2022 00:20
@connor-mccarthy connor-mccarthy force-pushed the support-deserializing-component-inputs branch from 02951fb to 220269b Compare August 23, 2022 00:34
@google-oss-prow google-oss-prow bot added size/L and removed size/M labels Aug 23, 2022
@connor-mccarthy connor-mccarthy force-pushed the support-deserializing-component-inputs branch from 220269b to 65e789b Compare August 23, 2022 01:25
type_ = 'Artifact'
outputs[utils.sanitize_input_name(
spec['name'])] = OutputSpec(type=type_)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes bring the v1 deserialization logic into alignment with the serialization logic (which falls back to system.Artifact, that way the read/write tests pass.

name: InputSpec.from_ir_parameter_dict(parameter_dict)
for name, parameter_dict in parameters.items()
}

artifacts = components_dict[component_key].get(
Copy link
Member Author

@connor-mccarthy connor-mccarthy Aug 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the changes required to correctly handle deserialization of components with artifact inputs.

This is the main reason for this PR. The other changes are to make the serialization/deserialization logic consistent w.r.t. treatment of artifacts. This inconsistency made it very hard for me to test changes related to #8172.

pipeline_func=my_pipeline, package_path='result.yaml')
pipeline_func=my_pipeline, package_path=target_yaml_file)

self.assertTrue(os.path.exists(target_yaml_file))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes were needed to align with the information compression that happens for artifacts (unknown artifacts get compressed to schema_title='system.Artifact').

This exception will not be thrown when SomeArbitraryArtifact gets loaded as system.Artifact.

@connor-mccarthy connor-mccarthy marked this pull request as ready for review August 23, 2022 01:35
@connor-mccarthy
Copy link
Member Author

/retest

1 similar comment
@connor-mccarthy
Copy link
Member Author

/retest

@connor-mccarthy connor-mccarthy marked this pull request as draft August 24, 2022 20:17
@connor-mccarthy connor-mccarthy changed the title feat(sdk): fix component deserialization logic feat(sdk): update component deserialization logic for custom artifacts (support custom artifact types pt. 2) Aug 24, 2022
@connor-mccarthy
Copy link
Member Author

/retest

@google-oss-prow
Copy link

@connor-mccarthy: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
kubeflow-pipelines-samples-v2 c107a3e link true /test kubeflow-pipelines-samples-v2

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@connor-mccarthy connor-mccarthy changed the title feat(sdk): update component deserialization logic for custom artifacts (support custom artifact types pt. 2) feat(sdk): update component deserialization logic for custom artifacts (support custom artifact types pt. 3) Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant