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

Add VMs to Topology View #5041

Merged
merged 2 commits into from Apr 18, 2020

Conversation

jeff-phillips-18
Copy link
Member

Fixes:
https://issues.redhat.com/browse/ODC-3329
https://issues.redhat.com/browse/ODC-3497

Analysis / Root cause:
As a developer I want to quickly know which of my workloads are based on VMs.

As a developer I expect every node in topology to be selectable and show some details in the side panel. I want to quickly access information about my VMs.

Solution Description:
Add virtual machine items to the topology view. When a VM node is selected, show its details in the side panel.

Screen shots / Gifs for design review:
image

image

image

image

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

cc @openshift/team-devconsole-ux @serenamarie125 @sspeiche @jelkosz

/kind feature

@openshift-ci-robot openshift-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. component/core Related to console core functionality labels Apr 14, 2020
@openshift-ci-robot openshift-ci-robot added component/dev-console Related to dev-console component/knative Related to knative-plugin component/kubevirt Related to kubevirt-plugin component/shared Related to console-shared labels Apr 14, 2020
@jeff-phillips-18 jeff-phillips-18 force-pushed the vm-topology branch 2 times, most recently from f358b18 to d500587 Compare April 14, 2020 20:06
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 14, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 14, 2020
Copy link
Contributor

@serenamarie125 serenamarie125 left a comment

Choose a reason for hiding this comment

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

@jeff-phillips-18 can you add screenshots of the Actions menu & if you've implemented the context sensitive actions within topology?

@serenamarie125
Copy link
Contributor

fyi @Veethika @matthewcarleton

@jeff-phillips-18
Copy link
Member Author

@serenamarie125

image

image

@matthewcarleton
Copy link
Contributor

@serenamarie125

image

image

This is looking great @jeff-phillips-18 !
A few questions:
Should the badge be "V" or "VM"
Can we change it so in the details it only says "Pod" and not "Pods"
For the actions I think we can drop the repetitive "Virtual Machine"

@jeff-phillips-18
Copy link
Member Author

This is looking great @jeff-phillips-18 !
A few questions:
Should the badge be "V" or "VM"
Can we change it so in the details it only says "Pod" and not "Pods"
For the actions I think we can drop the repetitive "Virtual Machine"

This is all done within the plugin already. The badge comes from the model, the side panel details show is the same as the details panel for a VM, and the actions are defined in the existing kebab actions.

@matthewcarleton
Copy link
Contributor

matthewcarleton commented Apr 15, 2020

This is looking great @jeff-phillips-18 !
A few questions:
Should the badge be "V" or "VM"
Can we change it so in the details it only says "Pod" and not "Pods"
For the actions I think we can drop the repetitive "Virtual Machine"

This is all done within the plugin already. The badge comes from the model, the side panel details show is the same as the details panel for a VM, and the actions are defined in the existing kebab actions.

ah, ok thanks. I'll file a bug on the CNV side then.
So I would see the same results in the details view via the admin perspective then?

@jeff-phillips-18
Copy link
Member Author

ah, ok thanks. I'll file a bug on the CNV side then.
So I would see the same results in the details view via the admin perspective then?

Correct

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 16, 2020
@matthewcarleton
Copy link
Contributor

ah, ok thanks. I'll file a bug on the CNV side then.
So I would see the same results in the details view via the admin perspective then?

Correct

oh interesting this is what we see in the VM details view for the badge and the pod. Would this be customized to achieve it?
Screen Shot 2020-04-16 at 9 25 28 AM

VM_STATUS_V2V_CONVERSION_IN_PROGRESS,
VM_STATUS_V2V_CONVERSION_PENDING,
VM_STATUS_VMI_WAITING,
} from '../../../statuses/vm/constants';
Copy link

Choose a reason for hiding this comment

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

very recently 2 new more statuses were added: VM_STATUS_V2V_VM_IMPORT_IN_PROGRESS (should go under kubevirt-m-importing) and VM_STATUS_V2V_VM_IMPORT_ERROR (should go under kubevirt-m-error)

@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 16, 2020
@jeff-phillips-18
Copy link
Member Author

@matthewcarleton Fixed the badge in the side panel.

@jelkosz Added those statuses.

@jeff-phillips-18
Copy link
Member Author

@matthewcarleton The Pod on the Details tab is the same. For the Resources tab we use a shared component to list the pods for a resource, hence Pods even if it is a list of one. If you feel strongly, I can adjust it to be able to show just Pod for this particular case.

@matthewcarleton
Copy link
Contributor

@jeff-phillips-18 it's very nitpicky I know so if will delay this getting in then don't worry about it. It really just comes down to VMs only ever using one pod so having Pod(s) could be a bit misleading.

@serenamarie125
Copy link
Contributor

@jeff-phillips-18 it's very nitpicky I know so if will delay this getting in then don't worry about it. It really just comes down to VMs only ever using one pod so having Pod(s) could be a bit misleading.

@matthewcarleton Jeff and I talked a bit about this. Here were the points we discussed:

  • We could show Pod if there is a single pod, and show Pods when there are more than 1. The problem with that is if people scale up and down, I think it would be really weird to see the title change as well. When we look at a List View page today, the page title is plural regardless of the # shown.
  • We could special case for VMs to always be Pod, but then it won't be consistent with other resources when there is only a single pod.

@jeff-phillips-18 jeff-phillips-18 force-pushed the vm-topology branch 2 times, most recently from be3e92e to 53e3685 Compare April 17, 2020 11:06
@jeff-phillips-18
Copy link
Member Author

/retest

@matthewcarleton
Copy link
Contributor

@jeff-phillips-18 it's very nitpicky I know so if will delay this getting in then don't worry about it. It really just comes down to VMs only ever using one pod so having Pod(s) could be a bit misleading.

@matthewcarleton Jeff and I talked a bit about this. Here were the points we discussed:

  • We could show Pod if there is a single pod, and show Pods when there are more than 1. The problem with that is if people scale up and down, I think it would be really weird to see the title change as well. When we look at a List View page today, the page title is plural regardless of the # shown.
  • We could special case for VMs to always be Pod, but then it won't be consistent with other resources when there is only a single pod.

ah I see what you're saying. I'm ok with Pods then.

getServicesForResource,
} from './resource-utils';

export class TransformResourceData {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can probably move this to dev-console now?

Comment on lines +73 to +79
{
isList: true,
kind: VirtualMachineModel.kind,
namespace,
prop: 'virtualMachines',
optional: true,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Another area required for inclusion through extensions.
This is so inefficient to understand the app labels :(

I wonder if we could just sift through our redux store of resources instead of fetching all these upfront.
Something to consider as tech debt.

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines 104 to 106
const knativeComponentFactoryRef = React.useRef<KnativeComponentFactory>(
new KnativeComponentFactory(serviceBinding),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

The pattern you had before was better so that we don't always create new objects just to have them GC'd.

Comment on lines +179 to +203
React.useEffect(() => {
if (!displayFiltersRef.current) {
displayFiltersRef.current = filters.display;
return;
}

if (
(filters.display.eventSources && !displayFiltersRef.current.eventSources) ||
(filters.display.virtualMachines && !displayFiltersRef.current.virtualMachines)
) {
action(() => {
visRef.current.getGraph().reset();
visRef.current.getGraph().layout();
})();
}
displayFiltersRef.current = filters.display;
}, [filters.display]);
Copy link
Contributor

Choose a reason for hiding this comment

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

This code is too specific when what we really want is to run layout on nodes that change visibility.
As discussed, an event to notify of visibility change to let the layout handle this much like add / remove of nodes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also discussed doing such changes in a future issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

properties: {
resources: virtualMachineConfigurations,
required: FLAG_KUBEVIRT,
utils: getVirtualMachines,
Copy link
Contributor

Choose a reason for hiding this comment

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

This calls a function which returns an empty object? why?

@@ -52,6 +57,43 @@ type ConsumedExtensions =

export const FLAG_KUBEVIRT = 'KUBEVIRT';

export const virtualMachineConfigurations = (namespace: string): FirehoseResource[] => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why export this function? It doesn't seem to be used anywhere externally.

@@ -49,7 +49,7 @@ export const isPodSchedulable = (pod: PodKind) => {
const isPodReady = (pod: PodKind): boolean =>
pod?.status?.phase === 'Running' && pod?.status?.containerStatuses?.every((s) => s.ready);

export const findVMIPod = (
export const getPodsForVMI = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really want a util to get all pods to display in the sidebar instead of just the one pod as displayed in their details page?

Comment on lines 43 to 44
<div className="row">
<div className="col-sm-6">
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we be using patternfly grid instead of bootstrap?

Comment on lines +54 to +73
<div className="overview__sidebar-pane-head resource-overview__heading">
<h1 className="co-m-pane__heading">
<div className="co-m-pane__name co-resource-item">
<ResourceIcon className="co-m-resource-icon--lg" kind={vmObj.kind} />
{name && (
<Link
to={resourcePathFromModel(modelFor(vmObj.kind), name, namespace)}
className="co-resource-item__resource-name"
>
{name}
</Link>
)}
</div>
{actions?.length && (
<div className="co-actions">
<ActionsMenu actions={actions} />
</div>
)}
</h1>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

These headings keep getting repeated. Create a tech debt to create a reusable component.
And maybe merge it with making the side panel more extensible.

Copy link
Member Author

Choose a reason for hiding this comment

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

@andrewballantyne
Copy link
Contributor

Needs rebase @jeff-phillips-18

@christianvogt
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 18, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, jeff-phillips-18

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 18, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 412f8ac into openshift:master Apr 18, 2020
@spadgett spadgett added this to the v4.5 milestone Apr 20, 2020
@jeff-phillips-18 jeff-phillips-18 deleted the vm-topology branch December 2, 2020 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/dev-console Related to dev-console component/knative Related to knative-plugin component/kubevirt Related to kubevirt-plugin component/shared Related to console-shared kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants