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

NIM storage size field update #3318

Merged
Merged
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
@@ -1,6 +1,7 @@
import React from 'react';
import { HelperText, HelperTextItem, StackItem } from '@patternfly/react-core';
import PVSizeField from '~/pages/projects/components/PVSizeField';
import { MEMORY_UNITS_FOR_SELECTION } from '~/utilities/valueUnits';

type NIMPVCSizeSectionProps = {
pvcSize: string;
Expand All @@ -14,12 +15,16 @@
size={pvcSize}
setSize={(value: string) => setPvcSize(value)}
label="NVIDIA NIM storage size"
options={MEMORY_UNITS_FOR_SELECTION.filter((option) => option.unit !== 'Mi')} // Filtering out 'Mi'

Check warning on line 18 in frontend/src/pages/modelServing/screens/projects/NIMServiceModal/NIMPVCSizeSection.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/pages/modelServing/screens/projects/NIMServiceModal/NIMPVCSizeSection.tsx#L18

Added line #L18 was not covered by tests
/>
<HelperText>
<HelperTextItem>
Specify the size of the cluster storage instance that will be created to store the
downloaded NVIDIA NIM.
</HelperTextItem>
<HelperTextItem>
Make sure your storage size is greater than the NIM size specified by NVIDIA.
</HelperTextItem>
</HelperText>
</StackItem>
);
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/pages/projects/components/PVSizeField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { FormGroup, FormHelperText, HelperText, HelperTextItem } from '@patternfly/react-core';
import { ExclamationTriangleIcon } from '@patternfly/react-icons';
import ValueUnitField from '~/components/ValueUnitField';
import { MEMORY_UNITS_FOR_SELECTION } from '~/utilities/valueUnits';
import { MEMORY_UNITS_FOR_SELECTION, UnitOption } from '~/utilities/valueUnits';

type PVSizeFieldProps = {
fieldID: string;
Expand All @@ -11,6 +11,7 @@ type PVSizeFieldProps = {
setSize: (size: string) => void;
currentSize?: string;
label?: string;
options?: UnitOption[];
};

const PVSizeField: React.FC<PVSizeFieldProps> = ({
Expand All @@ -20,6 +21,7 @@ const PVSizeField: React.FC<PVSizeFieldProps> = ({
setSize,
currentSize,
label = 'Persistent storage size',
options = MEMORY_UNITS_FOR_SELECTION,
}) => (
<FormGroup label={label} fieldId={fieldID} data-testid={fieldID}>
<ValueUnitField
Expand All @@ -28,7 +30,7 @@ const PVSizeField: React.FC<PVSizeFieldProps> = ({
menuAppendTo={menuAppendTo}
onChange={(value) => setSize(value)}
validated={currentSize ? 'warning' : 'default'}
options={MEMORY_UNITS_FOR_SELECTION}
options={options}
value={size}
/>
{currentSize && (
Expand Down
Loading