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): Support namespaced pipelines from the UI. Closes #5084 #8831

Merged

Conversation

tasos-ale
Copy link
Contributor

@tasos-ale tasos-ale commented Feb 9, 2023

The purpose of this PR is to introduce namespaced pipelines in the pipelines frontend.
Design doc: https://docs.google.com/document/d/1fM4y2L1IVqVj-iiNjYFRRktdCh7FQXgU2XpaYLaqt-A/edit?resourcekey=0-kd5loyP7w3PBD0ug6ECmLQ#heading=h.x9snb54sjlu9

The pipelines list page now has two tabs, one that displays the private pipelines and one for shared.

Screenshot from 2023-02-09 12-31-07

Screenshot from 2023-02-09 12-31-38

The new run page now includes radio buttons that help create a private or shared pipeline.

Screenshot from 2023-02-09 12-32-17

Screenshot from 2023-02-09 12-32-41

Similar to the pipelines list, the choose pipeline dialog has two tabs.

Screenshot from 2023-02-09 12-33-07

Screenshot from 2023-02-09 12-33-34

Finally, the upload pipeline dialog includes radio buttons for a private and shared pipeline.

Screenshot from 2023-02-09 12-33-56

In single-user mode, the pipelines list page and the choose pipeline dialog have no tabs. The radio buttons should also be hidden.

Part of #4197
Closes #5084

/cc @jlyaoyuli @zijianjoy @chensun @StefanoFioravanzo @elikatsis

@zijianjoy
Copy link
Collaborator

Thank you for your PR, we need to hide the private/shared option in KFP standalone mode, and show them in full Kubeflow mode.

@tasos-ale
Copy link
Contributor Author

we need to hide the private/shared option in KFP standalone mode, and show them in full Kubeflow mode.

@zijianjoy currently, the radio buttons and the tabs are hidden in single-user mode. You are suggesting that I should also take into account the KFP_FLAGS.DEPLOYMENT when I toggle this functionality? And if yes, the "MARKETPLACE" and "undefined" deployments are considered standalone?

Tasos Alexiou added 13 commits February 10, 2023 15:17
Introduce the BuildInfo context and BuildInfoProvider class which is
going pass the build information from the "/healthz" endpoint across
the app.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
Get the BuildInfo information from React's context instead of making
the request to "/healthz" endpoint inside the SideNav component.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
Add the namespace optional parameter when uploading a new pipeline.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
Extend MD2Tabs component and add support for optional tooltips in
tab's headers.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
Make title property in ResourceSelector optional and hide the
toolbar if it is not defined.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
Add namespace as an option property in the PipelineList component.
When the namespace is available the PipelineList component will
display the namespaced pipelines.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
Remove the  UploadPipelineDialog from PipelineList component since
it is no longer used.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
Introduce the NamespacedAndSharedPipelines component which replaces
the PipelineList component as the main component for the pipelines
list page. This component displays both namespace and shared
pipelines using tabs. Also fix the menu highlighting for the new
page.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
Introduce the PrivateSharedSelector component that is going to help
if a new pipeline will be namespaced or shared.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
Introduce the PipelinesDialog component which is going to be used to
display both namespaced and shared pipelines using tabs.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
Update the NewPipelineVersion component and add support to create
namespaced pipelines.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
Use the PrivateSharedSelector in the upload pipeline dialog and
improve the wording in the helper texts. A user can now select if
the new pipeline is going to be in the current namespace or shared.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
Update the NewRun component and add support to create namespaced
pipelines when creating a new run. Use the pipelines dialog when
choosing namespaced or shared pipelines. Finally, disable the
pipeline version chooser when there is no pipeline selected.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
@tasos-ale tasos-ale force-pushed the feature-tasos-namespaced-pipelines branch from 46ff7ce to f315b65 Compare February 10, 2023 13:17
Comment on lines +60 to +62
if (!buildInfo?.apiServerMultiUser) {
return <PipelineList {...props} />;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is multi-user mode, I think we should show private and shared tab. The condition here shows a different logic. Would you like to explain the reason here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When apiServerMultiUser is false then we are not in multi-user mode and that is why we display a single tab.

Comment on lines +63 to +84
return (
<div className={classes(commonCss.page, padding(20, 't'))}>
<MD2Tabs
tabs={[
{
header: PipelineTabsHeaders.PRIVATE,
tooltip: PipelineTabsTooltips.PRIVATE,
},
{
header: PipelineTabsHeaders.SHARED,
tooltip: PipelineTabsTooltips.SHARED,
},
]}
selectedTab={props.view}
onSwitch={tabSwitched}
/>

{props.view === PrivateAndSharedTab.PRIVATE && <PrivatePipelineList {...props} />}

{props.view === PrivateAndSharedTab.SHARED && <PipelineList {...props} />}
</div>
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This part of logics will appear when it is not multi-user mode.

However, there is no concept of private in standalone mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This section is displayed when apiServerMultiUser is set to true, which means we are in a multi-user mode and we want to display the private and shared tab.

@@ -176,6 +167,8 @@ class PipelineList extends Page<{}, PipelineListState> {
request.pageSize,
request.sortBy,
request.filter,
this.props.namespace ? 'NAMESPACE' : undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure if the backend has already implemented the logics to support namespace-based listPipelines API call. cc @chensun to confirm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Namespaced pipelines are supported since #4835 PR.

Copy link
Collaborator

@zijianjoy zijianjoy left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thank you Tasos for the change! I only have one comment which can be a subsequent PR. Approving the current PR.

</BuildInfoContext.Provider>,
);
await TestUtils.flushPromises();
expect(tree).toMatchSnapshot();
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are moving away from snapshot test and prefer to validate certain UI component and actions in code. But we can fix it in subsequent PRs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zijianjoy I noticed that in the codebase both enzyme and testing-library are used. Do you accept both of them or do you have a preference for new tests?

Copy link
Collaborator

Choose a reason for hiding this comment

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

React testing library is preferred for writing new UI tests. Enzyme was used in the past but it only checks for the snapshot of a frontend page, without validating the UI interaction with user behavior. But since it is a large effort to migrate, we prefer to execute it gradually. Whenever we write new tests or update old tests, we should use React testing library to test critical use cases if possible.

Reference: #5118 (comment)

@google-oss-prow google-oss-prow bot added the lgtm label Feb 18, 2023
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zijianjoy

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

@tasos-ale
Copy link
Contributor Author

/retest

@google-oss-prow google-oss-prow bot merged commit 6996947 into kubeflow:master Feb 20, 2023
@kimwnasptd kimwnasptd deleted the feature-tasos-namespaced-pipelines branch February 20, 2023 09:49
jlyaoyuli pushed a commit to jlyaoyuli/pipelines that referenced this pull request Mar 9, 2023
…flow#5084 (kubeflow#8831)

* feat(frontend): Introduce BuildInfo context

Introduce the BuildInfo context and BuildInfoProvider class which is
going pass the build information from the "/healthz" endpoint across
the app.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

* feat(frontend): Use BuildInfo context in SideNav

Get the BuildInfo information from React's context instead of making
the request to "/healthz" endpoint inside the SideNav component.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

* feat(frontend): Add namespace optional parameter

Add the namespace optional parameter when uploading a new pipeline.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

* feat(frontend): Add tooltips in MD2Tabs component

Extend MD2Tabs component and add support for optional tooltips in
tab's headers.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

* feat(frontend): Make title property in ResourceSelector optional

Make title property in ResourceSelector optional and hide the
toolbar if it is not defined.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

* feat(frontend): Use namespace when displaying pipelines

Add namespace as an option property in the PipelineList component.
When the namespace is available the PipelineList component will
display the namespaced pipelines.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

* chore(frontend): Remove UploadPipelineDialog from PipelineList

Remove the  UploadPipelineDialog from PipelineList component since
it is no longer used.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

* feat(frontend): Introduce tabbed pipelines list page

Introduce the NamespacedAndSharedPipelines component which replaces
the PipelineList component as the main component for the pipelines
list page. This component displays both namespace and shared
pipelines using tabs. Also fix the menu highlighting for the new
page.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

* feat(frontend): Introduce PrivateSharedSelector component

Introduce the PrivateSharedSelector component that is going to help
if a new pipeline will be namespaced or shared.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

* feat(frontend): Introduce pipelines dialog

Introduce the PipelinesDialog component which is going to be used to
display both namespaced and shared pipelines using tabs.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

* feat(frontend): Add support for namespaced pipeline creation

Update the NewPipelineVersion component and add support to create
namespaced pipelines.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

* feat(frontend): Update upload pipeline dialog

Use the PrivateSharedSelector in the upload pipeline dialog and
improve the wording in the helper texts. A user can now select if
the new pipeline is going to be in the current namespace or shared.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

* feat(frontend): Add support for namespace pipelines in runs

Update the NewRun component and add support to create namespaced
pipelines when creating a new run. Use the pipelines dialog when
choosing namespaced or shared pipelines. Finally, disable the
pipeline version chooser when there is no pipeline selected.

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

* feat(frontend): Add support for namespace pipelines in runs V2

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>

---------

Signed-off-by: Tasos Alexiou <tasos@arrikto.com>
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.

[FR] Support namespaced pipelines from the UI
2 participants