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

Parallel state #291

Merged
merged 3 commits into from
Oct 28, 2024
Merged

Parallel state #291

merged 3 commits into from
Oct 28, 2024

Conversation

agrare
Copy link
Member

@agrare agrare commented Oct 21, 2024

This follows a similar pattern as Map, there are child workflows that are run by a single thread so multiple Task states can be running at once but no race condition on the Context hash as all updates are made by a single thread

$ exe/floe examples/parallel.asl 
I, [2024-10-21T13:17:32.089627 #170560]  INFO -- : Checking 1 workflows...
I, [2024-10-21T13:17:32.089772 #170560]  INFO -- : Running state: [Parallel:FunWithMath] with input [{}]...
I, [2024-10-21T13:17:32.090825 #170560]  INFO -- : Running state: [Task:Add] with input [{}]...
D, [2024-10-21T13:17:32.091039 #170560] DEBUG -- : Running docker run --detach --label execution_id\=280dc532-a244-4e44-b596-84fd0c7daeb2 --name floe-sleep-63013e56 docker.io/agrare/sleep:latest
I, [2024-10-21T13:17:32.422312 #170560]  INFO -- : Running state: [Task:Subtract] with input [{}]...
D, [2024-10-21T13:17:32.422417 #170560] DEBUG -- : Running docker run --detach --label execution_id\=280dc532-a244-4e44-b596-84fd0c7daeb2 --name floe-sleep-ea7bb500 docker.io/agrare/sleep:latest
I, [2024-10-21T13:17:42.661634 #170560]  INFO -- : Running state: [Task:Add] with input [{}]...Complete workflow - output: [{}]
I, [2024-10-21T13:17:43.257551 #170560]  INFO -- : Running state: [Task:Subtract] with input [{}]...Complete workflow - output: [{}]
I, [2024-10-21T13:17:43.307810 #170560]  INFO -- : Running state: [Parallel:FunWithMath] with input [{}]...Complete workflow - output: [[{},{}]]
I, [2024-10-21T13:17:43.307864 #170560]  INFO -- : Checking 1 workflows...Complete - 1 ready
[{},{}]

Fixes #287

@agrare agrare requested a review from Fryguy as a code owner October 21, 2024 17:18
@agrare agrare force-pushed the parallel_state branch 7 times, most recently from 5c48568 to 7d1de74 Compare October 25, 2024 16:42
@agrare agrare requested a review from kbrock October 25, 2024 17:22
@agrare agrare changed the title [WIP] Parallel state Parallel state Oct 25, 2024
@agrare agrare added the enhancement New feature or request label Oct 25, 2024
@@ -0,0 +1,25 @@
shared_examples_for "WorkflowBase" do
Copy link
Member

Choose a reason for hiding this comment

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

please rename file to shared/workflow_base

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 done

@kbrock kbrock merged commit e3a70fd into ManageIQ:master Oct 28, 2024
5 checks passed
@agrare agrare deleted the parallel_state branch October 28, 2024 18:10
agrare added a commit that referenced this pull request Oct 28, 2024
Added
- Add WorkflowBase base class for Workflow (#279)
- Add tool for using the aws stepfunctions simulator (#244)
- Implement Map state (#184)
- Add Map State Tolerated Failure (#282)
- Run Map iterations in parallel up to MaxConcurrency (#283)
- Implement Parallel State (#291)

Changed
- More granular compare_key and determine path at initialization time (#274)
- For Choice validation, use instance variables and not payload (#277)
- Return ExceedToleratedFailureThreshold if ToleratedFailureCount/Percentage is present (#285)

Fixed
- Fix case on log messages (#280)
- Handle either ToleratedFailureCount or ToleratedFailurePercentage (#284)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Parallel
2 participants