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

[WIP] feat(sdk): block using v2 @component decorator in v1 mode. Fixes #5967 #5989

Closed
wants to merge 11 commits into from

Conversation

NikeNano
Copy link
Member

@NikeNano NikeNano commented Jul 7, 2021

Description of your changes:
Fixes #5967

Checklist:

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign ji-yaqi after the PR has been reviewed.
You can assign the PR to them by writing /assign @ji-yaqi in a comment when ready.

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

@@ -678,6 +678,11 @@ def _create_dag_templates(self, pipeline, op_transformers=None, op_to_templates_
pipeline_name=self._pipeline_name_param,
pipeline_root=self._pipeline_root_param,
launcher_image=self._launcher_image)

if "Executor executes v2-based Python function components." in op.command[3] and\
Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to find a better solution for this, but there dont seems to be any variable indication when it is v2 '@component', WDYT @chensun?

Copy link
Member

@chensun chensun Jul 8, 2021

Choose a reason for hiding this comment

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

Right, this seems to be quite hacky and unreliable.

but there dont seems to be any variable indication when it is v2 '@component'

How about we add such an indicator variable when @component is used? WDYT?

BTW, thanks for picking up this work!

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that makes sense to me. A possible solution would be to set:

version: Optional[str] = 'google.com/cloud/pipelines/component/v1',

here:

it is a bit unclear for me what the version argument are used to describe today and is adding a google.com/cloud/pipelines/component/v2 is the right usage here. What are your thoughts @chensun?

Copy link
Contributor

Choose a reason for hiding this comment

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

The current plan is to have v2 be a hermetic namespace at some point (even if that means duplication of code across v1 and v2). So I don't think this is the right solution. How about, if v2 components are used, the v1 compiler should auto-compile in v2-compatible mode?

Copy link
Member Author

Choose a reason for hiding this comment

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

The current plan is to have v2 be a hermetic namespace at some point...

Could you elaborate on this @neuromage? What does this mean?

How about, if v2 components are used, the v1 compiler should auto-compile in v2-compatible mode?

I would prefer to keep the compiler selected by the users, I think it will be unclear for users(especially new users that are more prone to make this misstake) if the compiler are switched based upon the components.

Copy link
Contributor

Choose a reason for hiding this comment

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

@neuromage The following are known breaking changes of v2 compatible mode (some are planned to be resolved, but not all):

The user doesn't need to know v2 requires a different compilation mode.

I think you'll only be able to say this, until most of the above issues are resolved. Do you think that's the direction we will target?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think tracking all the breaking changes in one place is very useful, just filed #6133

Copy link
Member

Choose a reason for hiding this comment

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

@chensun What are your thoughts on this?

I think there might be some challenges to alter compilation mode based on feature usage, given this decorator isn't the only feature not compatible with v1. If we were to have the pattern of changing compilation mode based on usage. There would be more than one cases, and it would make it hard for users to understand what contributed to the compilation mode change.
So I think throwing an error would be okay for now, and we can revisit this later? @neuromage WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

ping @neuromage

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm ok to throw an error when compiling in v1 mode, but can we should ideally have a better way to detect this rather than looking at the docstrings. I think @chensun is planning for @component decorator to return a v2 class called BaseComponent so we can check for this and throw the error more reliably.

@google-oss-robot
Copy link

@NikeNano: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
kubeflow-pipelines-sdk-python37 6c1e530 link /test kubeflow-pipelines-sdk-python37
kubeflow-pipelines-sdk-python39 6c1e530 link /test kubeflow-pipelines-sdk-python39
kubeflow-pipelines-sdk-python38 6c1e530 link /test kubeflow-pipelines-sdk-python38
kubeflow-pipelines-sdk-python36 6c1e530 link /test kubeflow-pipelines-sdk-python36
kubeflow-pipelines-samples-v2 6c1e530 link /test kubeflow-pipelines-samples-v2
kubeflow-pipeline-sample-test 6c1e530 link /test kubeflow-pipeline-sample-test
kubeflow-pipeline-e2e-test 6c1e530 link /test kubeflow-pipeline-e2e-test

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.

@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the lifecycle/stale The issue / pull request is stale, any activities remove this label. label Mar 2, 2022
@rimolive
Copy link
Member

Closing this PR. No activity for more than a year.

/close

@stale stale bot removed the lifecycle/stale The issue / pull request is stale, any activities remove this label. label Mar 24, 2024
@google-oss-prow google-oss-prow bot closed this Mar 24, 2024
Copy link

@rimolive: Closed this PR.

In response to this:

Closing this PR. No activity for more than a year.

/close

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.

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.

[sdk] Block using v2 @component decorator in v1 mode.
6 participants