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(frontend): Complete Sub-DAG implementation in KFPv2. #8326

Merged
merged 3 commits into from
Oct 11, 2022

Conversation

zijianjoy
Copy link
Collaborator

@zijianjoy zijianjoy commented Oct 2, 2022

Description of your changes:

  1. Fix the problem that DAG status icon was not updated in real time.
  2. Introduce mlmdId to the node, because there are multiple Executions/Artifacts with the same name, we need MLMD ID to identify runtime status within a MLMD object uniquely.
  3. Make sure the Execution chosen for node's runtime status has a matching parent_dag_id with the last element in breadcrumb layer's execution ID.
  4. Fix the styling of SubDAG status, so the status icon doesn't excess the border of Sub DAG.
  5. Add a new layer for listing iterations in ParallelFor DAG. For example: ParallelFor for-loop has two iterations: for-loop.0 and for-loop.1. Both iterations are rendered as Sub DAG nodes. And breadcrumb layer will show the iteration name if you open them.
  6. If the ParallelFor DAG is not executed, we still show the SubDAG content by skipping iteration layer.
  7. Render Artifact Node which is input of subDAG. Usually Artifact is an output of Execution. However, Artifact input of the current subDAG won't have an incoming edge. This PR draws Artifact input node and add an edges to connect it with downstream executions.
  8. Instead of changing flowElements in place, updateFlowElementsState() returns an updated flowElements with runtime status.

Video:

Screen.Recording.2022-10-01.at.11.57.43.PM.mov

Checklist:

elems: PipelineFlowElement[],
executions: Execution[],
events: Event[],
artifacts: Artifact[],
) {
): PipelineFlowElement[] {
// IMPORTANT: PipelineFlowElement update is in-place.
Copy link
Contributor

@jlyaoyuli jlyaoyuli Oct 10, 2022

Choose a reason for hiding this comment

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

In the current design, the element update is no longer in-place. Can you either remove the comment or change the comment? Thank you.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point! Removed the comment.

target: getTaskNodeKey(inputTaskKey),
arrowHeadType: ArrowHeadType.ArrowClosed,
};
flowGraph.push(edge);
}
Copy link
Contributor

@jlyaoyuli jlyaoyuli Oct 10, 2022

Choose a reason for hiding this comment

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

Can these two conditions also handle the input artifact -> subDAG and subDAG -> output artifact ?

Screen Shot 2022-10-10 at 10 06 40 AM

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

subDAG -> output artifact is able to be handled already before this PR. input artifact -> subDAG support is added in this PR.

}
return {};
}

function getTaskNameToExecution(executions: Execution[]): Map<string, Execution> {
const map = new Map<string, Execution>();
function getTaskNameToExecution(executions: Execution[]): Map<string, Execution[]> {
Copy link
Contributor

@jlyaoyuli jlyaoyuli Oct 10, 2022

Choose a reason for hiding this comment

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

(Correct me if I am wrong.) I think the function name getTaskNameToExecution is a little confusing, especially we are trying do some set works. Would it be better if we change the name to setTaskNameToExecution? If you think the updated function name is better, can you also change the names for other functions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

setXXX() is a naming pattern for changing existing object, which means executions: Execution[] parameter in this case. However, we are returning Map<string, Execution[]> which is the function caller tries to get, so I use getXXX() pattern here.

@jlyaoyuli
Copy link
Contributor

/lgtm
/approve
Thank you @zijianjoy for implementing the sub-DAG feature!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jlyaoyuli

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

@zijianjoy
Copy link
Collaborator Author

/test kubeflow-pipeline-e2e-test

@zijianjoy
Copy link
Collaborator Author

/retest

@google-oss-prow google-oss-prow bot removed the lgtm label Oct 11, 2022
@jlyaoyuli
Copy link
Contributor

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Oct 11, 2022
@google-oss-prow google-oss-prow bot merged commit 21cf640 into kubeflow:master Oct 11, 2022
jlyaoyuli pushed a commit to jlyaoyuli/pipelines that referenced this pull request Jan 5, 2023
)

* feat(frontend): Complete Sub-DAG implementation in KFPv2.

* remove comment
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