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

Cascade terminate/Purge Workflow Support #7340

Merged
merged 43 commits into from Jan 17, 2024

Conversation

shivamkm07
Copy link
Contributor

@shivamkm07 shivamkm07 commented Jan 2, 2024

Description

Support for cascade terminate/purge was added in DTF-Go: microsoft/durabletask-go#47.

This PR adds the support for the same in Dapr. Also it makes the cascade feature default i.e. when no option is provided, it would assume cascade terminate/purge true The related components-contrib PR is dapr/components-contrib#3296

Issue reference

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
@ItalyPaleAle
Copy link
Contributor

LGTM but all builds are failing

shivamkm07 and others added 4 commits January 2, 2024 22:20
Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Copy link

codecov bot commented Jan 3, 2024

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (994b037) 62.32% compared to head (87ef171) 62.35%.

Files Patch % Lines
pkg/runtime/wfengine/backends/actors/backend.go 0.00% 5 Missing ⚠️
pkg/api/http/workflow.go 80.00% 2 Missing and 2 partials ⚠️
pkg/runtime/wfengine/component.go 0.00% 2 Missing ⚠️
pkg/api/universal/workflow.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7340      +/-   ##
==========================================
+ Coverage   62.32%   62.35%   +0.02%     
==========================================
  Files         240      240              
  Lines       22055    22075      +20     
==========================================
+ Hits        13746    13765      +19     
- Misses       7156     7158       +2     
+ Partials     1153     1152       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mukundansundar mukundansundar added the autoupdate DaprBot will keep the Pull Request up to date with master branch label Jan 10, 2024
@mukundansundar mukundansundar added documentation required This issue needs documentation docs-needed This issue needs documentation. Automatically create a docs issue. labels Jan 12, 2024
dapr-bot and others added 5 commits January 15, 2024 11:42
Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
@shivamkm07
Copy link
Contributor Author

Integration test will fail in this PR for now. Will be resolved once #7385 is merged.

Should pass now

Copy link
Contributor

@mukundansundar mukundansundar left a comment

Choose a reason for hiding this comment

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

lgtm.
@cgillum Do we need the API to have cascade terminate by default?

Copy link
Contributor

@cgillum cgillum left a comment

Choose a reason for hiding this comment

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

My only question about this PR is whether we can make the parameter name be recursive instead of non_recursive. I understand that we like to default Boolean parameter values to false, but I wonder if it would actually be better to name the query string parameter to recursive and default its value to true.

@@ -99,6 +99,7 @@ const (
workflowComponent = "workflowComponent"
workflowName = "workflowName"
instanceID = "instanceID"
nonRecursive = "non_recursive"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this recursive instead of non_recursive? It's harder for people to understand negatives.

Copy link
Contributor

Choose a reason for hiding this comment

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

the only concern I have here is, in general query string default parameters when not specified are the default values like false, 0 etc.
By defaulting to recursive terminate/purge and then asking users to set ?recursive=false does not seem intuitive to me, rather at that point setting ?non_recursive=true make it more intuitive IMO.

Copy link
Contributor

Choose a reason for hiding this comment

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

I kind of incline towards recursive set to true by default. Understanding this was quite easier for me.
Is there any reasoning behind keeping all flags to false by default, apart from general practice?

Copy link
Contributor

Choose a reason for hiding this comment

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

I personally agree with Mukundan that it's more intuitive when the default value of a boolean is false.

If the default value is "true", then you are introducing 3 states: set true, set false, null.

func (*ActorBackend) GetOrchestrationRuntimeState(context.Context, *backend.OrchestrationWorkItem) (*backend.OrchestrationRuntimeState, error) {
return nil, errors.New("not supported")
func (abe *ActorBackend) GetOrchestrationRuntimeState(ctx context.Context, owi *backend.OrchestrationWorkItem) (*backend.OrchestrationRuntimeState, error) {
state, err := LoadWorkflowState(ctx, abe.actorRuntime, string(owi.InstanceID), abe.config)
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason for implementing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cgillum this is required for cascade purge: we need to get list of sub-orchestrations to purge: https://github.com/microsoft/durabletask-go/blob/b58abfd02e48667ae6d8622de1531b322178b8b9/backend/backend.go#L135

@mukundansundar mukundansundar merged commit f9a2088 into dapr:master Jan 17, 2024
26 of 27 checks passed
Viktorsubota pushed a commit to Viktorsubota/dapr that referenced this pull request Jan 17, 2024
* Updating protos

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* enable recursive terminate/purge

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Updating dtf-go

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* updating contrib

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Correct proto generated files

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* update comment

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* implementing getOrchestrationRuntimeState

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding unit tests

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* make modtidy-all

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding recursive option in query parameter

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding integration test for workflow

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* fix bug in Creating sub-orchestrations

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Setting recursive/terminate purge to default and adding tests for same

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* linter fixes

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Removing fix from this PR

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* renaming  to

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* linter fixes

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

---------

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Loong Dai <long.dai@intel.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>
yaron2 pushed a commit that referenced this pull request Jan 19, 2024
* Cascade terminate/Purge Workflow Support (#7340)

* Updating protos

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* enable recursive terminate/purge

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Updating dtf-go

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* updating contrib

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Correct proto generated files

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* update comment

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* implementing getOrchestrationRuntimeState

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding unit tests

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* make modtidy-all

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding recursive option in query parameter

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding integration test for workflow

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* fix bug in Creating sub-orchestrations

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Setting recursive/terminate purge to default and adding tests for same

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* linter fixes

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Removing fix from this PR

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* renaming  to

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* linter fixes

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

---------

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Loong Dai <long.dai@intel.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>

* Add priorityClassName parameter to Helm chart

Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>

* Add priorityClassName to README doc

Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>

---------

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>
Co-authored-by: Shivam Kumar <shivamkm07@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Loong Dai <long.dai@intel.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Co-authored-by: Viktor Subota <viktor.subota@c.delinea.com>
whytem pushed a commit to whytem/dapr that referenced this pull request Jan 22, 2024
* Updating protos

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* enable recursive terminate/purge

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Updating dtf-go

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* updating contrib

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Correct proto generated files

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* update comment

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* implementing getOrchestrationRuntimeState

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding unit tests

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* make modtidy-all

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding recursive option in query parameter

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding integration test for workflow

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* fix bug in Creating sub-orchestrations

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Setting recursive/terminate purge to default and adding tests for same

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* linter fixes

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Removing fix from this PR

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* renaming  to

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* linter fixes

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

---------

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Loong Dai <long.dai@intel.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
whytem pushed a commit to whytem/dapr that referenced this pull request Jan 22, 2024
* Cascade terminate/Purge Workflow Support (dapr#7340)

* Updating protos

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* enable recursive terminate/purge

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Updating dtf-go

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* updating contrib

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Correct proto generated files

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* update comment

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* implementing getOrchestrationRuntimeState

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding unit tests

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* make modtidy-all

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding recursive option in query parameter

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding integration test for workflow

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* fix bug in Creating sub-orchestrations

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Setting recursive/terminate purge to default and adding tests for same

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* linter fixes

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Removing fix from this PR

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* renaming  to

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* linter fixes

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

---------

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Loong Dai <long.dai@intel.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>

* Add priorityClassName parameter to Helm chart

Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>

* Add priorityClassName to README doc

Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>

---------

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>
Co-authored-by: Shivam Kumar <shivamkm07@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Loong Dai <long.dai@intel.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Co-authored-by: Viktor Subota <viktor.subota@c.delinea.com>
elena-kolevska pushed a commit to elena-kolevska/dapr that referenced this pull request Jan 24, 2024
* Cascade terminate/Purge Workflow Support (dapr#7340)

* Updating protos

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* enable recursive terminate/purge

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Updating dtf-go

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* updating contrib

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Correct proto generated files

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* update comment

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* implementing getOrchestrationRuntimeState

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding unit tests

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* make modtidy-all

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding recursive option in query parameter

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding integration test for workflow

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* fix bug in Creating sub-orchestrations

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Setting recursive/terminate purge to default and adding tests for same

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* linter fixes

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Removing fix from this PR

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* renaming  to

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* linter fixes

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

---------

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Loong Dai <long.dai@intel.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>

* Add priorityClassName parameter to Helm chart

Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>

* Add priorityClassName to README doc

Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>

---------

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>
Co-authored-by: Shivam Kumar <shivamkm07@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Loong Dai <long.dai@intel.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Co-authored-by: Viktor Subota <viktor.subota@c.delinea.com>
elena-kolevska pushed a commit to elena-kolevska/dapr that referenced this pull request Jan 25, 2024
* Cascade terminate/Purge Workflow Support (dapr#7340)

* Updating protos

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* enable recursive terminate/purge

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Updating dtf-go

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* updating contrib

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Correct proto generated files

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* update comment

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* implementing getOrchestrationRuntimeState

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding unit tests

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* make modtidy-all

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding recursive option in query parameter

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Adding integration test for workflow

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* fix bug in Creating sub-orchestrations

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Setting recursive/terminate purge to default and adding tests for same

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* linter fixes

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* Removing fix from this PR

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* renaming  to

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

* linter fixes

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>

---------

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Loong Dai <long.dai@intel.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>

* Add priorityClassName parameter to Helm chart

Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>

* Add priorityClassName to README doc

Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>

---------

Signed-off-by: Shivam Kumar <shivamkm07@gmail.com>
Signed-off-by: Viktor Subota <viktor.subota@c.delinea.com>
Co-authored-by: Shivam Kumar <shivamkm07@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Loong Dai <long.dai@intel.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Co-authored-by: Viktor Subota <viktor.subota@c.delinea.com>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
@JoshVanL JoshVanL added this to the v1.13 milestone Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autoupdate DaprBot will keep the Pull Request up to date with master branch breaking-change This is a breaking change docs-needed This issue needs documentation. Automatically create a docs issue. documentation required This issue needs documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants