Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const createSteps = (
nodes,
createLocalVolumeSet,
connectionDetails,
optionalSettings,
} = state;
const { systemNamespace, externalStorage, deployment } = backingStorage;
const { encryption, kms } = securityAndNetwork;
Expand Down Expand Up @@ -73,6 +74,7 @@ export const createSteps = (
nodes={nodes}
systemNamespace={systemNamespace}
isTNFEnabled={isTNFEnabled}
enableNFS={optionalSettings.enableNFS}
/>
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ export const CapacityAndNodes: React.FC<CapacityAndNodesProps> = ({
systemNamespace,
infraType,
isTNFEnabled,
enableNFS,
}) => {
const {
capacity,
Expand Down Expand Up @@ -473,7 +474,13 @@ export const CapacityAndNodes: React.FC<CapacityAndNodesProps> = ({

const validations = isTNFEnabled
? []
: capacityAndNodesValidate(nodes, state, isNoProvisioner, osdAmount);
: capacityAndNodesValidate(
nodes,
state,
isNoProvisioner,
osdAmount,
enableNFS
);
const onProfileChange = React.useCallback(
(profile) => onResourceProfileChange(dispatch)(profile),
[dispatch]
Expand Down Expand Up @@ -528,6 +535,7 @@ export const CapacityAndNodes: React.FC<CapacityAndNodesProps> = ({
selectedNodes={nodes}
osdAmount={osdAmount}
isTNFEnabled={isTNFEnabled}
enableNFS={enableNFS}
/>
<EnableTaintNodes
dispatch={dispatch}
Expand Down Expand Up @@ -573,4 +581,5 @@ type CapacityAndNodesProps = {
infraType: InfraProviders;
systemNamespace: WizardState['backingStorage']['systemNamespace'];
isTNFEnabled: boolean;
enableNFS: boolean;
};
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ const selectOptions = (
t: TFunction,
forceLean: boolean,
osdAmount: number,
architecture?: string
architecture?: string,
enableNFS?: boolean
) =>
Object.entries(ResourceProfile).map((value: [string, ResourceProfile]) => {
const displayName = t('{{mode}} mode', { mode: value[0] });
let profile = value[1];
const { minCpu, minMem } = getResourceProfileRequirements(
profile,
osdAmount,
architecture
architecture,
enableNFS
);
const description = `CPUs required: ${minCpu}, Memory required: ${minMem} GiB`;
const isDisabled =
Expand Down Expand Up @@ -69,16 +71,18 @@ type ProfileRequirementsTextProps = {
selectedProfile: ResourceProfile;
osdAmount: number;
architecture?: string;
enableNFS?: boolean;
};

export const ProfileRequirementsText: React.FC<
ProfileRequirementsTextProps
> = ({ selectedProfile, osdAmount, architecture }) => {
> = ({ selectedProfile, osdAmount, architecture, enableNFS }) => {
const { t } = useCustomTranslation();
const { minCpu, minMem } = getResourceProfileRequirements(
selectedProfile,
osdAmount,
architecture
architecture,
enableNFS
);
return (
<Content>
Expand Down Expand Up @@ -126,6 +130,7 @@ type ConfigurePerformanceProps = {
selectedNodes: WizardNodeState[];
osdAmount?: number;
isTNFEnabled?: boolean;
enableNFS?: boolean;
};

const ConfigurePerformance: React.FC<ConfigurePerformanceProps> = ({
Expand All @@ -136,6 +141,7 @@ const ConfigurePerformance: React.FC<ConfigurePerformanceProps> = ({
selectedNodes,
osdAmount,
isTNFEnabled,
enableNFS,
}) => {
const { t } = useCustomTranslation();
const [availableNodes, availableNodesLoaded, availableNodesLoadError] =
Expand All @@ -156,7 +162,8 @@ const ConfigurePerformance: React.FC<ConfigurePerformanceProps> = ({
allCpu,
allMem,
osdAmount,
architecture
architecture,
enableNFS
)
) {
forceLean = true;
Expand All @@ -174,7 +181,8 @@ const ConfigurePerformance: React.FC<ConfigurePerformanceProps> = ({
getTotalCpu(selectedNodes),
getTotalMemoryInGiB(selectedNodes),
osdAmount,
architecture
architecture,
enableNFS
)
: true;
const validated =
Expand All @@ -199,7 +207,13 @@ const ConfigurePerformance: React.FC<ConfigurePerformanceProps> = ({
selectedKey={resourceProfile}
id="resource-profile"
className="odf-configure-performance__selector pf-v6-u-mb-md"
selectOptions={selectOptions(t, forceLean, osdAmount, architecture)}
selectOptions={selectOptions(
t,
forceLean,
osdAmount,
architecture,
enableNFS
)}
onChange={onResourceProfileChange}
validated={validated}
isDisabled={isTNFEnabled}
Expand All @@ -209,6 +223,7 @@ const ConfigurePerformance: React.FC<ConfigurePerformanceProps> = ({
selectedProfile={resourceProfile}
osdAmount={osdAmount}
architecture={architecture}
enableNFS={enableNFS}
/>
)}
</div>
Expand Down
3 changes: 2 additions & 1 deletion packages/odf/components/create-storage-system/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ const canJumpToNextStep = (
getTotalCpu(nodes),
getTotalMemoryInGiB(nodes),
osdAmount,
architecture
architecture,
optionalSettings.enableNFS
) &&
isValidCapacityAutoScalingConfig(
capacityAndNodes.capacityAutoScaling.enable,
Expand Down
11 changes: 8 additions & 3 deletions packages/odf/components/utils/common-odf-install-el.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ export const VALIDATIONS = (
resourceProfile?: ResourceProfile,
osdAmount?: number,
volumeValidationType?: VolumeTypeValidation,
architecture?: string
architecture?: string,
enableNFS?: boolean
): Validation => {
switch (type) {
case ValidationType.MINIMAL: {
const { minCpu, minMem } = getResourceProfileRequirements(
ResourceProfile.Balanced,
osdAmount,
architecture
architecture,
enableNFS
);
return {
variant: AlertVariant.warning,
Expand Down Expand Up @@ -222,6 +224,7 @@ export const ValidationMessage: React.FC<ValidationMessageProps> = ({
validation,
osdAmount,
architecture,
enableNFS,
}) => {
const { t } = useCustomTranslation();
const {
Expand All @@ -238,7 +241,8 @@ export const ValidationMessage: React.FC<ValidationMessageProps> = ({
resourceProfile,
osdAmount,
volumeValidationType,
architecture
architecture,
enableNFS
);
return actionLinkStep ? (
<Alert
Expand Down Expand Up @@ -268,6 +272,7 @@ type ValidationMessageProps = {
osdAmount?: number;
volumeValidationType?: VolumeTypeValidation;
architecture?: string;
enableNFS?: boolean;
};

export const getEncryptionLevel = (obj: EncryptionType, t: TFunction) => {
Expand Down
9 changes: 6 additions & 3 deletions packages/odf/components/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ export const capacityAndNodesValidate = (
nodes: WizardNodeState[],
state: WizardState['capacityAndNodes'],
isNoProvSC: boolean,
osdAmount: number
osdAmount: number,
enableNFS?: boolean
): ValidationType[] => {
const validations = [];
const {
Expand All @@ -189,7 +190,8 @@ export const capacityAndNodesValidate = (
totalCpu,
totalMemory,
osdAmount,
architecture
architecture,
enableNFS
)
) {
validations.push(ValidationType.RESOURCE_PROFILE);
Expand All @@ -200,7 +202,8 @@ export const capacityAndNodesValidate = (
totalCpu,
totalMemory,
osdAmount,
architecture
architecture,
enableNFS
)
) {
validations.push(ValidationType.MINIMAL);
Expand Down
15 changes: 15 additions & 0 deletions packages/odf/constants/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,21 @@ export const S390X_CPU_ADJUSTMENTS = {
},
};

/**
* NFS resource requirements to be added when NFS is enabled
*/
export const NFS_RESOURCE_REQUIREMENTS = {
minCpu: 6,
minMem: 16, // GiB
};

/**
* s390x specific NFS CPU requirements
*/
export const NFS_S390X_CPU_REQUIREMENT = {
minCpu: 3,
};

export enum DefaultRequestSize {
BAREMETAL = '1',
NON_BAREMETAL = '2Ti',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ import './configure-performance-modal.scss';
const getValidation = (
profile: ResourceProfile,
nodes: WizardNodeState[],
osdAmount: number
osdAmount: number,
enableNFS?: boolean
): ValidationType => {
if (!profile) {
return null;
Expand All @@ -56,7 +57,8 @@ const getValidation = (
getTotalCpu(nodes),
getTotalMemoryInGiB(nodes),
osdAmount,
architecture
architecture,
enableNFS
)
? null
: ValidationType.RESOURCE_PROFILE;
Expand All @@ -66,16 +68,18 @@ type ProfileRequirementsModalTextProps = {
selectedProfile: ResourceProfile;
osdAmount: number;
architecture?: string;
enableNFS?: boolean;
};

const ProfileRequirementsModalText: React.FC<
ProfileRequirementsModalTextProps
> = ({ selectedProfile, osdAmount, architecture }) => {
> = ({ selectedProfile, osdAmount, architecture, enableNFS }) => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

from where value of enableNFS flag comes from for this modal ??

const { t } = useCustomTranslation();
const { minCpu, minMem } = getResourceProfileRequirements(
selectedProfile,
osdAmount,
architecture
architecture,
enableNFS
);
return (
<Content>
Expand Down Expand Up @@ -134,21 +138,26 @@ const ConfigurePerformanceModal: React.FC<StorageClusterActionModalProps> = ({
)
.reduce((accumulator: number, current: number) => accumulator + current);
const architecture = getNodeArchitectureFromState(selectedNodes);
const enableNFS = storageCluster?.spec?.nfs?.enable || false;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@SanjalKatiyar please check now, I am checking for the spec.nfs.enable in the storageCluster CR


const onProfileChange = React.useCallback(
(newProfile: ResourceProfile): void => {
setResourceProfile(newProfile);
setValidation(getValidation(newProfile, selectedNodes, osdAmount));
setValidation(
getValidation(newProfile, selectedNodes, osdAmount, enableNFS)
);
},
[selectedNodes, osdAmount]
[selectedNodes, osdAmount, enableNFS]
);
const onRowSelected = React.useCallback(
(newNodes: NodeData[]) => {
const nodes = createWizardNodeState(newNodes);
setSelectedNodes(nodes);
setValidation(getValidation(resourceProfile, nodes, osdAmount));
setValidation(
getValidation(resourceProfile, nodes, osdAmount, enableNFS)
);
},
[resourceProfile, osdAmount]
[resourceProfile, osdAmount, enableNFS]
);

const submit = async (event: React.FormEvent<EventTarget>): Promise<void> => {
Expand Down Expand Up @@ -204,6 +213,7 @@ const ConfigurePerformanceModal: React.FC<StorageClusterActionModalProps> = ({
profileRequirementsText={ProfileRequirementsModalText}
selectedNodes={selectedNodes}
osdAmount={osdAmount}
enableNFS={enableNFS}
/>
<SelectNodesTable
nodes={selectedNodes}
Expand All @@ -219,6 +229,7 @@ const ConfigurePerformanceModal: React.FC<StorageClusterActionModalProps> = ({
validation={validation}
className="pf-v6-u-mt-md"
architecture={architecture}
enableNFS={enableNFS}
/>
)}
{errorMessage && (
Expand Down
Loading
Loading