-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MGMT-20061: Add OpenShift AI AMD bundle
This patch adds the operators needed by the OpenShift AI AMD bundle: AMD GPU and KMM. Related: https://issues.redhat.com/browse/MGMT-20061 Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
- Loading branch information
Showing
13 changed files
with
194 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/AmdGpuCheckbox.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import React, { useState } from 'react'; | ||
import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core'; | ||
import { getFieldId, PopoverIcon } from '../../../../common'; | ||
import { OcmCheckboxField } from '../../ui/OcmFormFields'; | ||
import { useNewFeatureSupportLevel } from '../../../../common/components/newFeatureSupportLevels'; | ||
import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge'; | ||
import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service'; | ||
|
||
const AMDGPU_FIELD_NAME = 'useAmdGpu'; | ||
|
||
const AmdGpuLabel = ({ | ||
disabledReason, | ||
supportLevel, | ||
}: { | ||
disabledReason?: string; | ||
supportLevel?: SupportLevel; | ||
}) => { | ||
return ( | ||
<> | ||
<Tooltip hidden={!disabledReason} content={disabledReason}> | ||
<span>Install AMD GPU </span> | ||
</Tooltip> | ||
<PopoverIcon | ||
id={AMDGPU_FIELD_NAME} | ||
component={'a'} | ||
bodyContent={'Requires at least one supported AMD GPU'} | ||
/> | ||
<NewFeatureSupportLevelBadge featureId="AMD_GPU" supportLevel={supportLevel} /> | ||
</> | ||
); | ||
}; | ||
|
||
const AmdGpuHelperText = () => { | ||
return ( | ||
<HelperText> | ||
<HelperTextItem variant="indeterminate"> | ||
Automate the management of AMD software components needed to provision and monitor GPUs.{' '} | ||
</HelperTextItem> | ||
</HelperText> | ||
); | ||
}; | ||
|
||
const AmdGpuCheckbox = ({ disabledReason }: { disabledReason?: string }) => { | ||
const fieldId = getFieldId(AMDGPU_FIELD_NAME, 'input'); | ||
const featureSupportLevel = useNewFeatureSupportLevel(); | ||
const [disabledReasonAmdGpu, setDisabledReason] = useState<string | undefined>(); | ||
|
||
React.useEffect(() => { | ||
const reason = featureSupportLevel.getFeatureDisabledReason('AMD_GPU'); | ||
setDisabledReason(reason); | ||
}, [featureSupportLevel]); | ||
|
||
return ( | ||
<FormGroup isInline fieldId={fieldId}> | ||
<OcmCheckboxField | ||
name={AMDGPU_FIELD_NAME} | ||
label={ | ||
<AmdGpuLabel | ||
disabledReason={disabledReason ? disabledReason : disabledReasonAmdGpu} | ||
supportLevel={featureSupportLevel.getFeatureSupportLevel('AMD_GPU')} | ||
/> | ||
} | ||
helperText={<AmdGpuHelperText />} | ||
isDisabled={!!disabledReason || !!disabledReasonAmdGpu} | ||
/> | ||
</FormGroup> | ||
); | ||
}; | ||
|
||
export default AmdGpuCheckbox; |
68 changes: 68 additions & 0 deletions
68
libs/ui-lib/lib/ocm/components/clusterConfiguration/operators/KmmCheckbox.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import React, { useState } from 'react'; | ||
import { FormGroup, HelperText, HelperTextItem, Tooltip } from '@patternfly/react-core'; | ||
import { getFieldId, PopoverIcon } from '../../../../common'; | ||
import { OcmCheckboxField } from '../../ui/OcmFormFields'; | ||
import { useNewFeatureSupportLevel } from '../../../../common/components/newFeatureSupportLevels'; | ||
import NewFeatureSupportLevelBadge from '../../../../common/components/newFeatureSupportLevels/NewFeatureSupportLevelBadge'; | ||
import { SupportLevel } from '@openshift-assisted/types/./assisted-installer-service'; | ||
|
||
const KMM_FIELD_NAME = 'useKmm'; | ||
|
||
const KmmLabel = ({ | ||
disabledReason, | ||
supportLevel, | ||
}: { | ||
disabledReason?: string; | ||
supportLevel?: SupportLevel; | ||
}) => { | ||
return ( | ||
<> | ||
<Tooltip hidden={!disabledReason} content={disabledReason}> | ||
<span>Install Kernel Module Management </span> | ||
</Tooltip> | ||
<PopoverIcon | ||
id={KMM_FIELD_NAME} | ||
component={'a'} | ||
bodyContent={'No additional requirements needed'} | ||
/> | ||
<NewFeatureSupportLevelBadge featureId="KMM" supportLevel={supportLevel} /> | ||
</> | ||
); | ||
}; | ||
|
||
const KmmHelperText = () => { | ||
return ( | ||
<HelperText> | ||
<HelperTextItem variant="indeterminate">Management of kernel modules. </HelperTextItem> | ||
</HelperText> | ||
); | ||
}; | ||
|
||
const KmmCheckbox = ({ disabledReason }: { disabledReason?: string }) => { | ||
const fieldId = getFieldId(KMM_FIELD_NAME, 'input'); | ||
const featureSupportLevel = useNewFeatureSupportLevel(); | ||
const [disabledReasonKmm, setDisabledReason] = useState<string | undefined>(); | ||
|
||
React.useEffect(() => { | ||
const reason = featureSupportLevel.getFeatureDisabledReason('KMM'); | ||
setDisabledReason(reason); | ||
}, [featureSupportLevel]); | ||
|
||
return ( | ||
<FormGroup isInline fieldId={fieldId}> | ||
<OcmCheckboxField | ||
name={KMM_FIELD_NAME} | ||
label={ | ||
<KmmLabel | ||
disabledReason={disabledReason ? disabledReason : disabledReasonKmm} | ||
supportLevel={featureSupportLevel.getFeatureSupportLevel('KMM')} | ||
/> | ||
} | ||
helperText={<KmmHelperText />} | ||
isDisabled={!!disabledReason || !!disabledReasonKmm} | ||
/> | ||
</FormGroup> | ||
); | ||
}; | ||
|
||
export default KmmCheckbox; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters