diff --git a/frontend/src/__mocks__/mockDashboardConfig.ts b/frontend/src/__mocks__/mockDashboardConfig.ts index b388678b38..d84fad65bc 100644 --- a/frontend/src/__mocks__/mockDashboardConfig.ts +++ b/frontend/src/__mocks__/mockDashboardConfig.ts @@ -54,6 +54,7 @@ export const mockDashboardConfig = ({ modelMetricsNamespace: 'test-project', disablePipelines: false, disableProjectSharing: false, + disableAccelerators: false, }, notebookController: { enabled: true, diff --git a/frontend/src/app/AppRoutes.tsx b/frontend/src/app/AppRoutes.tsx index fc24d81c50..3ca1f88de7 100644 --- a/frontend/src/app/AppRoutes.tsx +++ b/frontend/src/app/AppRoutes.tsx @@ -37,6 +37,10 @@ const DependencyMissingPage = React.lazy( () => import('../pages/dependencies/DependencyMissingPage'), ); +const AcceleratorProfile = React.lazy( + () => import('../pages/acceleratorProfile/AcceleratorProfile'), +); + const AppRoutes: React.FC = () => { const { isAdmin, isAllowed } = useUser(); @@ -76,6 +80,7 @@ const AppRoutes: React.FC = () => { <> } /> } /> + } /> } /> } /> diff --git a/frontend/src/pages/acceleratorProfile/AcceleratorProfile.tsx b/frontend/src/pages/acceleratorProfile/AcceleratorProfile.tsx new file mode 100644 index 0000000000..59e10a09f2 --- /dev/null +++ b/frontend/src/pages/acceleratorProfile/AcceleratorProfile.tsx @@ -0,0 +1,73 @@ +import * as React from 'react'; +import { + Button, + ButtonVariant, + Flex, + FlexItem, + EmptyState, + EmptyStateIcon, + EmptyStateVariant, + EmptyStateBody, + PageSection, + PageSectionVariants, + Title, +} from '@patternfly/react-core'; +import { PlusCircleIcon } from '@patternfly/react-icons'; +import ApplicationsPage from '~/pages/ApplicationsPage'; +import useAccelerators from '~/pages/notebookController/screens/server/useAccelerators'; +import { useDashboardNamespace } from '~/redux/selectors'; + +const description = `Manage accelerator profile settings for users in your organization`; + +const AcceleratorProfile: React.FC = () => { + const { dashboardNamespace } = useDashboardNamespace(); + const [accelerators, loaded, loadError] = useAccelerators(dashboardNamespace); + + const isEmpty = !accelerators || accelerators.length === 0; + + const noAcceleratorProfilePageSection = ( + + + + + No available accelerator profiles yet + + + {/* eslint-disable-next-line react/no-unescaped-entities */} + You don't have any accelerator profiles yet. To get started, please ask your cluster + administrator about +
the accelerator availability in your cluster and create corresponding profiles in + Openshift Data Science. +
+ +
+
+ ); + + return ( + + + + {/* Todo: Create accelerator table */} + + + + ); +}; + +export default AcceleratorProfile; diff --git a/frontend/src/types.ts b/frontend/src/types.ts index 50898f5b44..a07cd36d99 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -91,6 +91,7 @@ export type DashboardCommonConfig = { disableCustomServingRuntimes: boolean; modelMetricsNamespace: string; disablePipelines: boolean; + disableAccelerators: boolean; }; export type NotebookControllerUserState = { diff --git a/frontend/src/utilities/NavData.tsx b/frontend/src/utilities/NavData.tsx index b0adb2931c..5e8d3a3461 100644 --- a/frontend/src/utilities/NavData.tsx +++ b/frontend/src/utilities/NavData.tsx @@ -53,6 +53,14 @@ const getSettingsNav = ( }); } + if (featureFlagEnabled(dashboardConfig.spec.dashboardConfig.disableAccelerators)) { + settingsNavs.push({ + id: 'accelerator-profile', + label: 'Accelerator profiles', + href: '/accelerators', + }); + } + if ( featureFlagEnabled(dashboardConfig.spec.dashboardConfig.disableCustomServingRuntimes) && featureFlagEnabled(dashboardConfig.spec.dashboardConfig.disableModelServing) diff --git a/manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml b/manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml index 8108ce32aa..62f913a1ff 100644 --- a/manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml +++ b/manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml @@ -53,6 +53,8 @@ spec: type: string disablePipelines: type: boolean + disableAccelerators: + type: boolean groupsConfig: type: object required: @@ -134,10 +136,10 @@ spec: notebookTolerationSettings: type: object properties: - enabled: - type: boolean - key: - type: string + enabled: + type: boolean + key: + type: string storageClassName: type: string templateOrder: