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

Epic: Support for multiple deviceClass on baremetal clusters #1662

Merged

Conversation

@vbnrh
Copy link
Member Author

vbnrh commented Nov 8, 2024

The alert that says, it may increase your expenses has been removed

@alfonsomthd
Copy link
Collaborator

The alert that says, it may increase your expenses has been removed

@vbnrh Then the screenshots are outdated, right? Can you put an updated one?
Also, I would put Fixes: <Jira-issue that contains the figma link.

@vbnrh
Copy link
Member Author

vbnrh commented Nov 8, 2024

The alert that says, it may increase your expenses has been removed

@vbnrh Then the screenshots are outdated, right? Can you put an updated one? Also, I would put Fixes: <Jira-issue that contains the figma link.

Screenshot 2024-11-08 at 1 57 01 PM Screenshot 2024-11-08 at 1 57 17 PM

Its the same, just the message on top got removed.
Figma link the description

@vbnrh vbnrh force-pushed the multiple-deviceclass-feature branch 10 times, most recently from a28a775 to 0a49e1d Compare November 8, 2024 12:47
@vbnrh vbnrh force-pushed the multiple-deviceclass-feature branch 3 times, most recently from 81b95fe to 2655757 Compare November 11, 2024 06:23
Comment on lines 41 to 48
const deviceSets: DeviceSet[] = storageCluster?.spec?.storageDeviceSets || [];
const installStorageClass =
deviceSets?.[0]?.dataPVCTemplate?.spec?.storageClassName;
const preSelectionFilter = React.useCallback(
(storageClasses: StorageClassResourceKind[]) =>
storageClasses.find((sc) => getName(sc) === installStorageClass),
[installStorageClass]
);
Copy link
Collaborator

@SanjalKatiyar SanjalKatiyar Nov 11, 2024

Choose a reason for hiding this comment

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

This check still doesn't make sense. Requirement of this feature is to use a "new" StorageClass, so we shouldn't auto-select "existing" StorageClass.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If anything we should filter out the "existing" StorageClasses from the dropdown.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Comment on lines 259 to 261
const [csv, csvLoaded, csvLoadError] = useFetchCsv({
specName: LSO_OPERATOR,
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't fetch CSV per row... do it once on the table level and pass it down to each row...

Copy link
Member Author

Choose a reason for hiding this comment

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

done

customKebabItems.push({
key: 'ATTACH_STORAGE',
value: t('Attach Storage'),
component: undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

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

"undefined" ??

Suggested change
component: undefined,
component: undefined,

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no component to render, need to navigate to url

Copy link
Member Author

Choose a reason for hiding this comment

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

Component is field is somehow required even though it is optional in the properties

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed it, the typing was not done properly

Comment on lines 175 to 179
} else if (actionKey === 'ATTACH_STORAGE') {
const url = `/odf/system/ns/${getNamespace(resource)}/${referenceForModel(
StorageClusterModel
)}/${getName(resource)}/~attachstorage`;
navigate(url);
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is shared directory, we can't have specific checks like actionKey === 'ATTACH_STORAGE' here...

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@SanjalKatiyar
Copy link
Collaborator

On Expandstorage UI

Show only LSO storageClasses that are not in the deviceSet

This make sense, LGTM.

on AddCapacity UI

Show only LSO storageClasses that is on device Set

Better to confirm with Eran whether we want to touch existing "Add Capacity" UI or keep that as it is (so that existing non-advanced user won't get confused).
(I personally don't want to make any changes to existing "Add Capacity" UI).

@parth-gr
Copy link
Member

Better to confirm with Eran whether we want to touch existing "Add Capacity" UI or keep that as it is (so that existing non-advanced user won't get confused).
(I personally don't want to make any changes to existing "Add Capacity" UI)

IMO for LSO usescase we should not add the new deviceSet using "Add Capacity", so we do not use the new LSO storageclass,
If we add new deviceSet from there the same device classes OSDs will be generated,
But the OSDs originally from differ in configuration and if used together, might be issues with balancing and performance.

But will open a thread for it

@vbnrh vbnrh force-pushed the multiple-deviceclass-feature branch from 2655757 to 6baf6e9 Compare November 11, 2024 11:09
Comment on lines 57 to 77
const getStorageClassesNotInDeviceSet = React.useCallback(
(
storageClasses: StorageClassResourceKind[],
deviceSets: DeviceSet[]
): string[] => {
const allStorageClasses = storageClasses.map(getName);
const deviceSetStorageClasses = deviceSets
.map((ds) => ds.dataPVCTemplate.spec.storageClassName)
.filter((name): name is string => Boolean(name));

return allStorageClasses.filter(
(scName) => !deviceSetStorageClasses.includes(scName)
);
},
[existingStorageClasses, storageCluster]
);

const preSelectionFilter = React.useCallback(
(storageClasses: StorageClassResourceKind[]) => {
const storageClassesNotInDeviceSet = getStorageClassesNotInDeviceSet(
storageClasses,
storageCluster?.spec?.storageDeviceSets || []
);
return storageClassesNotInDeviceSet[0];
},
[[getStorageClassesNotInDeviceSet]]
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

storageClassDropdownFilter is already filtering all the existing StorageClasses, you directly select 0th of that list.

Suggested change
const getStorageClassesNotInDeviceSet = React.useCallback(
(
storageClasses: StorageClassResourceKind[],
deviceSets: DeviceSet[]
): string[] => {
const allStorageClasses = storageClasses.map(getName);
const deviceSetStorageClasses = deviceSets
.map((ds) => ds.dataPVCTemplate.spec.storageClassName)
.filter((name): name is string => Boolean(name));
return allStorageClasses.filter(
(scName) => !deviceSetStorageClasses.includes(scName)
);
},
[existingStorageClasses, storageCluster]
);
const preSelectionFilter = React.useCallback(
(storageClasses: StorageClassResourceKind[]) => {
const storageClassesNotInDeviceSet = getStorageClassesNotInDeviceSet(
storageClasses,
storageCluster?.spec?.storageDeviceSets || []
);
return storageClassesNotInDeviceSet[0];
},
[[getStorageClassesNotInDeviceSet]]
);
const preSelectionFilter = React.useCallback(
(storageClasses: StorageClassResourceKind[]) => storageClasses?.[0];
},
[]
);

Copy link
Collaborator

Choose a reason for hiding this comment

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

no need to filter again...

@SanjalKatiyar
Copy link
Collaborator

LGTM other than comment #1662 (comment).
cc @bipuladh @alfonsomthd @GowthamShanmugam for final review and tagging.

@alfonsomthd
Copy link
Collaborator

The alert that says, it may increase your expenses has been removed

@vbnrh Then the screenshots are outdated, right? Can you put an updated one? Also, I would put Fixes: <Jira-issue that contains the figma link.

Can you please upload an updated screenshot?

@vbnrh
Copy link
Member Author

vbnrh commented Nov 11, 2024

The alert that says, it may increase your expenses has been removed

@vbnrh Then the screenshots are outdated, right? Can you put an updated one? Also, I would put Fixes: <Jira-issue that contains the figma link.

Can you please upload an updated screenshot?

Screenshot 2024-11-11 at 6 29 50 PM Screenshot 2024-11-11 at 6 30 15 PM Screenshot 2024-11-11 at 6 30 21 PM

@vbnrh vbnrh force-pushed the multiple-deviceclass-feature branch from 5b1187b to 6c5b40e Compare November 12, 2024 05:18
@vbnrh
Copy link
Member Author

vbnrh commented Nov 12, 2024

@bipuladh @SanjalKatiyar @alfonsomthd All comments addressed

@vbnrh vbnrh force-pushed the multiple-deviceclass-feature branch from 7553da0 to 9a70dc0 Compare November 13, 2024 09:46
@vbnrh vbnrh force-pushed the multiple-deviceclass-feature branch from 9a70dc0 to 4eab654 Compare November 13, 2024 09:57
@vbnrh
Copy link
Member Author

vbnrh commented Nov 13, 2024

/test odf-console-e2e-aws

1 similar comment
@vbnrh
Copy link
Member Author

vbnrh commented Nov 14, 2024

/test odf-console-e2e-aws

@parth-gr
Copy link
Member

cc @SanjalKatiyar

@SanjalKatiyar
Copy link
Collaborator

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm label Nov 14, 2024
Copy link
Contributor

openshift-ci bot commented Nov 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SanjalKatiyar, vbnrh

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

@SanjalKatiyar
Copy link
Collaborator

/test odf-console-e2e-aws

1 similar comment
@vbnrh
Copy link
Member Author

vbnrh commented Nov 14, 2024

/test odf-console-e2e-aws

@openshift-merge-bot openshift-merge-bot bot merged commit cb13092 into red-hat-storage:master Nov 14, 2024
5 checks passed
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.

5 participants