From 7a501f484053ee185b1d2724391bcd2a87f8ebe9 Mon Sep 17 00:00:00 2001 From: gitdallas <5322142+gitdallas@users.noreply.github.com> Date: Fri, 10 May 2024 12:20:04 -0500 Subject: [PATCH] feat(mr): mr settings scaffolding Signed-off-by: gitdallas <5322142+gitdallas@users.noreply.github.com> --- backend/src/types.ts | 1 + backend/src/utils/constants.ts | 1 + docs/dashboard-config.md | 3 ++ frontend/src/__mocks__/mockDashboardConfig.ts | 3 ++ frontend/src/app/AppRoutes.tsx | 4 ++ frontend/src/concepts/areas/const.ts | 5 ++ frontend/src/concepts/areas/types.ts | 1 + frontend/src/k8sTypes.ts | 1 + .../ModelRegistrySettings.tsx | 50 +++++++++++++++++++ frontend/src/utilities/NavData.tsx | 10 ++++ ...dhdashboardconfigs.opendatahub.io.crd.yaml | 2 + .../odh-dashboard-config.yaml | 1 + .../odhdashboardconfig.yaml | 1 + 13 files changed, 83 insertions(+) create mode 100644 frontend/src/pages/modelRegistrySettings/ModelRegistrySettings.tsx diff --git a/backend/src/types.ts b/backend/src/types.ts index b487889eeb..2110f1c232 100644 --- a/backend/src/types.ts +++ b/backend/src/types.ts @@ -18,6 +18,7 @@ export type DashboardConfig = K8sResourceCommon & { disableInfo: boolean; disableSupport: boolean; disableClusterManager: boolean; + disableModelRegistryManager: boolean; disableTracking: boolean; disableBYONImageStream: boolean; disableISVBadges: boolean; diff --git a/backend/src/utils/constants.ts b/backend/src/utils/constants.ts index 4d39f675f1..412ee4c71e 100644 --- a/backend/src/utils/constants.ts +++ b/backend/src/utils/constants.ts @@ -43,6 +43,7 @@ export const blankDashboardCR: DashboardConfig = { disableInfo: false, disableSupport: false, disableClusterManager: false, + disableModelRegistryManager: false, disableTracking: true, disableBYONImageStream: false, disableISVBadges: false, diff --git a/docs/dashboard-config.md b/docs/dashboard-config.md index 7edd859781..e1d6092b52 100644 --- a/docs/dashboard-config.md +++ b/docs/dashboard-config.md @@ -14,6 +14,7 @@ The following are a list of features that are supported, along with there defaul | disableInfo | false | Removes the information panel in Explore Application section | | disableSupport | false | Disables components related to support. | | disableClusterManager | false | Disables cluster management section for admins | +| disableModelRegistryManager | false | Disables model registry management section for admins | | disableTracking | true | Disables telemetry UI data. Note for this feature to work you need woopra and segement.io configured | | disableBYONImageStream | false | Disables custom notebook images that are created via image streams | | disableISVBadges | false | Removes the badge that indicate if a product is ISV or not. | @@ -46,6 +47,7 @@ spec: disableInfo: false disableSupport: false disableClusterManager: false + disableModelRegistryManager: false disableTracking: true disableBYONImageStream: false disableISVBadges: false @@ -142,6 +144,7 @@ spec: enablement: true disableBYONImageStream: false disableClusterManager: false + disableModelRegistryManager: false disableISVBadges: false disableInfo: false disableSupport: false diff --git a/frontend/src/__mocks__/mockDashboardConfig.ts b/frontend/src/__mocks__/mockDashboardConfig.ts index e66920a0e2..378d9410e6 100644 --- a/frontend/src/__mocks__/mockDashboardConfig.ts +++ b/frontend/src/__mocks__/mockDashboardConfig.ts @@ -4,6 +4,7 @@ type MockDashboardConfigType = { disableInfo?: boolean; disableSupport?: boolean; disableClusterManager?: boolean; + disableModelRegistryManager?: boolean; disableTracking?: boolean; disableBYONImageStream?: boolean; disableISVBadges?: boolean; @@ -30,6 +31,7 @@ export const mockDashboardConfig = ({ disableInfo = false, disableSupport = false, disableClusterManager = false, + disableModelRegistryManager = false, disableTracking = false, disableBYONImageStream = false, disableISVBadges = false, @@ -66,6 +68,7 @@ export const mockDashboardConfig = ({ disableInfo, disableSupport, disableClusterManager, + disableModelRegistryManager, disableTracking, disableBYONImageStream, disableISVBadges, diff --git a/frontend/src/app/AppRoutes.tsx b/frontend/src/app/AppRoutes.tsx index a085876382..412cb0cdcb 100644 --- a/frontend/src/app/AppRoutes.tsx +++ b/frontend/src/app/AppRoutes.tsx @@ -53,6 +53,9 @@ const ClusterSettingsPage = React.lazy(() => import('../pages/clusterSettings/Cl const CustomServingRuntimeRoutes = React.lazy( () => import('../pages/modelServing/customServingRuntimes/CustomServingRuntimeRoutes'), ); +const ModelRegistrySettingsPage = React.lazy( + () => import('../pages/modelRegistrySettings/ModelRegistrySettings'), +); const GroupSettingsPage = React.lazy(() => import('../pages/groupSettings/GroupSettings')); const LearningCenterPage = React.lazy(() => import('../pages/learningCenter/LearningCenter')); const BYONImagesPage = React.lazy(() => import('../pages/BYONImages/BYONImages')); @@ -127,6 +130,7 @@ const AppRoutes: React.FC = () => { } /> } /> } /> + } /> } /> )} diff --git a/frontend/src/concepts/areas/const.ts b/frontend/src/concepts/areas/const.ts index 4a13cbbdc7..0e24efbcef 100644 --- a/frontend/src/concepts/areas/const.ts +++ b/frontend/src/concepts/areas/const.ts @@ -10,6 +10,11 @@ export const SupportedAreasStateMap: SupportedAreasState = { [SupportedArea.CLUSTER_SETTINGS]: { featureFlags: ['disableClusterManager'], }, + [SupportedArea.MODEL_REGISTRY_SETTINGS]: { + featureFlags: ['disableModelRegistryManager'], + requiredComponents: [StackComponent.MODEL_REGISTRY], + requiredCapabilities: [StackCapability.SERVICE_MESH, StackCapability.SERVICE_MESH_AUTHZ], + }, [SupportedArea.CUSTOM_RUNTIMES]: { featureFlags: ['disableCustomServingRuntimes'], reliantAreas: [SupportedArea.MODEL_SERVING], diff --git a/frontend/src/concepts/areas/types.ts b/frontend/src/concepts/areas/types.ts index bbfad94248..64254390f4 100644 --- a/frontend/src/concepts/areas/types.ts +++ b/frontend/src/concepts/areas/types.ts @@ -34,6 +34,7 @@ export enum SupportedArea { /* Admin areas */ BYON = 'bring-your-own-notebook', CLUSTER_SETTINGS = 'cluster-settings', + MODEL_REGISTRY_SETTINGS = 'model-registry-settings', USER_MANAGEMENT = 'user-management', ACCELERATOR_PROFILES = 'accelerator-profiles', diff --git a/frontend/src/k8sTypes.ts b/frontend/src/k8sTypes.ts index 2d3d3aedd6..ea7288f355 100644 --- a/frontend/src/k8sTypes.ts +++ b/frontend/src/k8sTypes.ts @@ -1196,6 +1196,7 @@ export type DashboardCommonConfig = { disableInfo: boolean; disableSupport: boolean; disableClusterManager: boolean; + disableModelRegistryManager: boolean; disableTracking: boolean; disableBYONImageStream: boolean; disableISVBadges: boolean; diff --git a/frontend/src/pages/modelRegistrySettings/ModelRegistrySettings.tsx b/frontend/src/pages/modelRegistrySettings/ModelRegistrySettings.tsx new file mode 100644 index 0000000000..b9d0cdbc9c --- /dev/null +++ b/frontend/src/pages/modelRegistrySettings/ModelRegistrySettings.tsx @@ -0,0 +1,50 @@ +import React from 'react'; +import { useNavigate } from 'react-router-dom'; +import { + Button, + EmptyState, + EmptyStateActions, + EmptyStateBody, + EmptyStateFooter, + EmptyStateHeader, + EmptyStateIcon, + EmptyStateVariant, +} from '@patternfly/react-core'; +import { PlusCircleIcon } from '@patternfly/react-icons'; +import ApplicationsPage from '~/pages/ApplicationsPage'; + +const ModelRegistrySettings: React.FC = () => { + const navigate = useNavigate(); + + return ( + + + } + headingLevel="h5" + /> + + You can create model registries for specific users or projects. + + + + + + + + + ); +}; + +export default ModelRegistrySettings; diff --git a/frontend/src/utilities/NavData.tsx b/frontend/src/utilities/NavData.tsx index 82dbc9f26e..e318608f18 100644 --- a/frontend/src/utilities/NavData.tsx +++ b/frontend/src/utilities/NavData.tsx @@ -150,6 +150,15 @@ const useCustomRuntimesNav = (): NavDataHref[] => }, ]); +const useModelRegisterySettingsNav = (): NavDataHref[] => + useAreaCheck(SupportedArea.MODEL_REGISTRY_SETTINGS, [ + { + id: 'settings-model-registry', + label: 'Model registry settings', + href: '/modelRegistrySettings', + }, + ]); + const useUserManagementNav = (): NavDataHref[] => useAreaCheck(SupportedArea.USER_MANAGEMENT, [ { @@ -174,6 +183,7 @@ const useSettingsNav = (): NavDataGroup[] => { ...useClusterSettingsNav(), ...useAcceleratorProfilesNav(), ...useCustomRuntimesNav(), + ...useModelRegisterySettingsNav(), ...useUserManagementNav(), ]; diff --git a/manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml b/manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml index 8a1b8dbe6f..580bab4b3e 100644 --- a/manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml +++ b/manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml @@ -33,6 +33,8 @@ spec: type: boolean disableClusterManager: type: boolean + disableModelRegistryManager: + type: boolean disableTracking: type: boolean disableBYONImageStream: diff --git a/manifests/overlays/odhdashboardconfig/odh-dashboard-config.yaml b/manifests/overlays/odhdashboardconfig/odh-dashboard-config.yaml index ef5b2b03f6..0f9ad040ed 100644 --- a/manifests/overlays/odhdashboardconfig/odh-dashboard-config.yaml +++ b/manifests/overlays/odhdashboardconfig/odh-dashboard-config.yaml @@ -8,6 +8,7 @@ spec: dashboardConfig: disableBYONImageStream: false disableClusterManager: false + disableModelRegistryManager: false disableISVBadges: false disableInfo: false disableSupport: false diff --git a/manifests/overlays/odhdashboardconfig/odhdashboardconfig.yaml b/manifests/overlays/odhdashboardconfig/odhdashboardconfig.yaml index aa15f080f5..de420af5b4 100644 --- a/manifests/overlays/odhdashboardconfig/odhdashboardconfig.yaml +++ b/manifests/overlays/odhdashboardconfig/odhdashboardconfig.yaml @@ -8,6 +8,7 @@ spec: dashboardConfig: disableBYONImageStream: false disableClusterManager: false + disableModelRegistryManager: false disableISVBadges: false disableInfo: false disableSupport: false