-
Notifications
You must be signed in to change notification settings - Fork 300
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
expose subworkflow inputs, outputs in node execution #503
Conversation
Signed-off-by: cosmicBboy <[email protected]>
Signed-off-by: cosmicBboy <[email protected]>
Signed-off-by: cosmicBboy <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #503 +/- ##
==========================================
+ Coverage 85.00% 85.17% +0.17%
==========================================
Files 364 366 +2
Lines 27456 27762 +306
Branches 2243 2263 +20
==========================================
+ Hits 23339 23647 +308
+ Misses 3500 3492 -8
- Partials 617 623 +6
Continue to review full report at Codecov.
|
flytekit/control_plane/nodes.py
Outdated
def executions(self) -> _artifact_mixin.ExecutionArtifact: | ||
return self.task_executions or self.workflow_executions or [] | ||
def executions(self) -> List[_artifact_mixin.ExecutionArtifact]: | ||
return self.task_executions or list(self.subworkflow_node_executions.values()) or [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the latter half of this just self._subworkflow_node_executions? why the transformations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_subworkflow_node_executions
is a Dict mapping node id to node execution, so it needs to be transformed to output a list of node executions.
We could alternatively have executions
output a Union[List, Dict]
depending on whether it's task executions of subworkflow node executions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the property subworkflow_node_executions
is a Dict (see above)... we don't have to convert it into a dict, but I found it convenient to be able to access the subworkflow node executions by node_id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right but we don't necessarily need to access these through the property since it's all in the same class right? sorry this is a minor performance nit and not really worth refactoring :)
Signed-off-by: cosmicBboy <[email protected]>
for t in _iterate_task_executions(client, self.id) | ||
] | ||
# TODO: sync sub-workflows as well | ||
if self.metadata.is_parent_node: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this field true for the parent node of a dynamic workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need to test that... in another PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be false for dynamic workflows
Signed-off-by: cosmicBboy <[email protected]>
Signed-off-by: cosmicBboy <[email protected]>
Signed-off-by: cosmicBboy <[email protected]>
Signed-off-by: cosmicBboy <[email protected]>
* expose subworkflow inputs, outputs in node execution Signed-off-by: cosmicBboy <[email protected]> * fix lint Signed-off-by: cosmicBboy <[email protected]> * add docstring Signed-off-by: cosmicBboy <[email protected]> * add docstring to list_node_executions, update sync logic Signed-off-by: cosmicBboy <[email protected]> * add comment to subworkflow get_interface @wild-endeavor Signed-off-by: cosmicBboy <[email protected]> * update executions property Signed-off-by: cosmicBboy <[email protected]> * cache interface for node execution, redefine as property Signed-off-by: cosmicBboy <[email protected]> * fix lint Signed-off-by: cosmicBboy <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]>
* expose subworkflow inputs, outputs in node execution Signed-off-by: cosmicBboy <[email protected]> * fix lint Signed-off-by: cosmicBboy <[email protected]> * add docstring Signed-off-by: cosmicBboy <[email protected]> * add docstring to list_node_executions, update sync logic Signed-off-by: cosmicBboy <[email protected]> * add comment to subworkflow get_interface @wild-endeavor Signed-off-by: cosmicBboy <[email protected]> * update executions property Signed-off-by: cosmicBboy <[email protected]> * cache interface for node execution, redefine as property Signed-off-by: cosmicBboy <[email protected]> * fix lint Signed-off-by: cosmicBboy <[email protected]> Signed-off-by: wild-endeavor <[email protected]>
* expose subworkflow inputs, outputs in node execution Signed-off-by: cosmicBboy <[email protected]> * fix lint Signed-off-by: cosmicBboy <[email protected]> * add docstring Signed-off-by: cosmicBboy <[email protected]> * add docstring to list_node_executions, update sync logic Signed-off-by: cosmicBboy <[email protected]> * add comment to subworkflow get_interface @wild-endeavor Signed-off-by: cosmicBboy <[email protected]> * update executions property Signed-off-by: cosmicBboy <[email protected]> * cache interface for node execution, redefine as property Signed-off-by: cosmicBboy <[email protected]> * fix lint Signed-off-by: cosmicBboy <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> Signed-off-by: wild-endeavor <[email protected]>
Signed-off-by: cosmicBboy [email protected]
TL;DR
Add support for inspecting inputs and outputs of subworkflows in the control plane objects.
Type
Are all requirements met?
Complete description
As a user, I can get a
FlyteWorkflowExecution
and access the inputs and outputs of its child node executions, including subworkflows. This is enabled by adding support inFlyteNodeExecution
for determining whether it is associated with a task or a subworkflow via themetadata.is_parent_node
attribute.Tracking Issue
flyteorg/flyte#975
Follow-up issue
NA
OR
https://github.com/lyft/flyte/issues/