#3353 feat(remote): Support branch node execution sync
Pull request opened by
pingsutw
## Tracking issue
NA
## Why are the changes needed?
remote.sync_node_execution doesn't sync the branch node execution. This PR adds support it.
## What changes were proposed in this pull request?
sync branch nodes.
## How was this patch tested?
import flytekit
from flytekit import conditional
@flytekit.task
def calculate_circle_circumference(radius: float) -> float:
return 2 * 3.14 * radius # Task to calculate the circumference of a circle
@flytekit.task
def calculate_circle_area(radius: float) -> float:
return 3.14 * radius * radius # Task to calculate the area of a circle
@flytekit.workflow
def shape_properties(radius: float = 10.2) -> float:
return (
conditional("shape_properties")
.if_((radius >= 0.1) & (radius < 1.0))
.then(calculate_circle_circumference(radius=radius))
.else_()
.then(calculate_circle_area(radius=radius))
)
if
name == "__main__":
radius_small = 0.5
print(f"Circumference of circle (radius={radius_small}): {shape_properties(radius=radius_small)}")
radius_large = 3.0
print(f"Area of circle (radius={radius_large}): {shape_properties(radius=radius_large)}")
from flytekit import FlyteRemote, Config
execution_id = {
"project": "flytesnacks",
"domain": "development",
"name": "alldzhl684ngfwn88mwh"
}
remote = FlyteRemote(Config.auto(config_file="/Users/kevin/.flyte/config-demo.yaml"), "flytesnacks", "development")
execution = remote.fetch_execution(**execution_id)
remote.sync(execution, sync_nodes=True)
list_node = []
for node_name in execution.node_executions:
print(node_name)
list_node.append(execution.node_executions[node_name])
### Setup process
### Screenshots
## Check all the applicable boxes
• I updated the documentation accordingly.
• All new and existing tests passed.
• All commits are signed-off.
## Related PRs
## Docs link
https://bito.ai#summarystart|
### Summary by Bito
• This pull request introduces enhancements to the branch node execution synchronization within the Flyte remote module.
• It adds functionality to handle branch nodes during execution, ensuring that their inputs and outputs are correctly managed.
• The changes improve the overall execution flow and reliability of workflows that utilize branch nodes.
• Overall, this pull request touches on the Flyte remote module, introducing enhancements to branch node execution synchronization.
flyteorg/flytekit