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): support more than one exit handler per pipeline #8088

Conversation

connor-mccarthy
Copy link
Member

@connor-mccarthy connor-mccarthy commented Aug 1, 2022

Description of your changes:
Enables use of more than one exit handler per pipeline.

Checklist:

@connor-mccarthy connor-mccarthy requested a review from chensun August 1, 2022 15:07
@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

@connor-mccarthy
Copy link
Member Author

/retest

second_exit_task = print_op(message='Second exit handler has worked!')

with dsl.ExitHandler(second_exit_task):
print_op(message=message).after(first_exit_print_task)
Copy link
Member

Choose a reason for hiding this comment

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

The after usage is an interesting one. Normally we don't allow dependency reference across DAGs. I wonder if we should disallow this?
In any case, the run result you showed me doesn't reflect the same dependency.

Copy link
Member Author

Choose a reason for hiding this comment

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

Discussed offline and decided to disallow this to be consistent with dsl condition and looping

@connor-mccarthy connor-mccarthy marked this pull request as draft August 2, 2022 22:23
@connor-mccarthy connor-mccarthy force-pushed the enable-multiple-exit-handlers-per-pipeline branch from 99f335d to 16a415c Compare August 3, 2022 16:17
@google-oss-prow google-oss-prow bot added size/XL and removed size/L labels Aug 3, 2022
@connor-mccarthy
Copy link
Member Author

/test all

@connor-mccarthy connor-mccarthy force-pushed the enable-multiple-exit-handlers-per-pipeline branch from 455bb90 to 6151802 Compare August 3, 2022 16:39
@connor-mccarthy connor-mccarthy marked this pull request as ready for review August 3, 2022 16:39
@connor-mccarthy connor-mccarthy force-pushed the enable-multiple-exit-handlers-per-pipeline branch from 6151802 to be7d29f Compare August 3, 2022 16:41
@connor-mccarthy connor-mccarthy marked this pull request as draft August 3, 2022 17:36
@connor-mccarthy
Copy link
Member Author

/test all

@connor-mccarthy connor-mccarthy force-pushed the enable-multiple-exit-handlers-per-pipeline branch from be7d29f to d1e4aa8 Compare August 3, 2022 17:57
@connor-mccarthy
Copy link
Member Author

/retest

@connor-mccarthy connor-mccarthy marked this pull request as ready for review August 4, 2022 00:13
dependent_group = group_name_to_group.get(
upstream_groups[0], None)
if isinstance(dependent_group,
(tasks_group.Condition, tasks_group.ParallelFor)):
if isinstance(dependent_group, tasks_group.ParallelFor):
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we add ExitHandler to the check instead of removing Condition from it?

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, I was thinking about this the wrong way

Copy link
Member Author

@connor-mccarthy connor-mccarthy Aug 4, 2022

Choose a reason for hiding this comment

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

Added in e48de19

Also added support for nested exit handlers to this PR with d8ee0d2 and f64b684

@connor-mccarthy connor-mccarthy force-pushed the enable-multiple-exit-handlers-per-pipeline branch from d1e4aa8 to ba5340c Compare August 4, 2022 17:17
@connor-mccarthy connor-mccarthy force-pushed the enable-multiple-exit-handlers-per-pipeline branch from 24dc715 to debfe4b Compare August 9, 2022 16:40
@google-oss-prow google-oss-prow bot added size/XL and removed size/XXL labels Aug 9, 2022
@connor-mccarthy connor-mccarthy requested a review from chensun August 9, 2022 16:41
Copy link
Member

@chensun chensun left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks!

Maybe add a release note for this change?

@google-oss-prow google-oss-prow bot removed the lgtm label Aug 10, 2022
@chensun
Copy link
Member

chensun commented Aug 10, 2022

/lgtm
/approve

Thanks @connor-mccarthy !

@google-oss-prow google-oss-prow bot added the lgtm label Aug 10, 2022
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chensun

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

The pull request process is described 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 merged commit bdff332 into kubeflow:master Aug 10, 2022
bokleung pushed a commit to bokleung/pipelines that referenced this pull request Aug 15, 2022
…8088)

* add compiler test pipeline with multiple exit handlers

* remove blocker of multiple exit handlers

* move exit handler builder logic to pipeline_spec_builder

* build all exit handlers per pipeline

* add compiler test with IR inspection

* prevent usage of cross-pipeline after

* test cross-pipeline after is prevented

* update existing task dependency logic and tests

* add v2 sample test

* remove cross-pipeline .after

* prevent cross-dag data dependency for dsl features

* add compiler test pipeline with nested exit handlers

* add support for nested exit handlers

* clean up pipeline with nested exit handlers

* remove sample with multiple exit handlers

* remove compiler test with nested exit handlers

* add compilation guard against nested exit handlers in subdag

* update release notes
jlyaoyuli pushed a commit to jlyaoyuli/pipelines that referenced this pull request Jan 5, 2023
…8088)

* add compiler test pipeline with multiple exit handlers

* remove blocker of multiple exit handlers

* move exit handler builder logic to pipeline_spec_builder

* build all exit handlers per pipeline

* add compiler test with IR inspection

* prevent usage of cross-pipeline after

* test cross-pipeline after is prevented

* update existing task dependency logic and tests

* add v2 sample test

* remove cross-pipeline .after

* prevent cross-dag data dependency for dsl features

* add compiler test pipeline with nested exit handlers

* add support for nested exit handlers

* clean up pipeline with nested exit handlers

* remove sample with multiple exit handlers

* remove compiler test with nested exit handlers

* add compilation guard against nested exit handlers in subdag

* update release notes
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.

2 participants