Skip to content

Commit

Permalink
feat(mr): mr settings scaffolding
Browse files Browse the repository at this point in the history
Signed-off-by: gitdallas <[email protected]>
  • Loading branch information
gitdallas committed May 13, 2024
1 parent 93c0851 commit 7a501f4
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type DashboardConfig = K8sResourceCommon & {
disableInfo: boolean;
disableSupport: boolean;
disableClusterManager: boolean;
disableModelRegistryManager: boolean;
disableTracking: boolean;
disableBYONImageStream: boolean;
disableISVBadges: boolean;
Expand Down
1 change: 1 addition & 0 deletions backend/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const blankDashboardCR: DashboardConfig = {
disableInfo: false,
disableSupport: false,
disableClusterManager: false,
disableModelRegistryManager: false,
disableTracking: true,
disableBYONImageStream: false,
disableISVBadges: false,
Expand Down
3 changes: 3 additions & 0 deletions docs/dashboard-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down Expand Up @@ -46,6 +47,7 @@ spec:
disableInfo: false
disableSupport: false
disableClusterManager: false
disableModelRegistryManager: false
disableTracking: true
disableBYONImageStream: false
disableISVBadges: false
Expand Down Expand Up @@ -142,6 +144,7 @@ spec:
enablement: true
disableBYONImageStream: false
disableClusterManager: false
disableModelRegistryManager: false
disableISVBadges: false
disableInfo: false
disableSupport: false
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/__mocks__/mockDashboardConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ type MockDashboardConfigType = {
disableInfo?: boolean;
disableSupport?: boolean;
disableClusterManager?: boolean;
disableModelRegistryManager?: boolean;
disableTracking?: boolean;
disableBYONImageStream?: boolean;
disableISVBadges?: boolean;
Expand All @@ -30,6 +31,7 @@ export const mockDashboardConfig = ({
disableInfo = false,
disableSupport = false,
disableClusterManager = false,
disableModelRegistryManager = false,
disableTracking = false,
disableBYONImageStream = false,
disableISVBadges = false,
Expand Down Expand Up @@ -66,6 +68,7 @@ export const mockDashboardConfig = ({
disableInfo,
disableSupport,
disableClusterManager,
disableModelRegistryManager,
disableTracking,
disableBYONImageStream,
disableISVBadges,
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/app/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down Expand Up @@ -127,6 +130,7 @@ const AppRoutes: React.FC = () => {
<Route path="/clusterSettings" element={<ClusterSettingsPage />} />
<Route path="/acceleratorProfiles/*" element={<AcceleratorProfileRoutes />} />
<Route path="/servingRuntimes/*" element={<CustomServingRuntimeRoutes />} />
<Route path="/modelRegistrySettings" element={<ModelRegistrySettingsPage />} />
<Route path="/groupSettings" element={<GroupSettingsPage />} />
</>
)}
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/concepts/areas/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
1 change: 1 addition & 0 deletions frontend/src/concepts/areas/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Expand Down
1 change: 1 addition & 0 deletions frontend/src/k8sTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@ export type DashboardCommonConfig = {
disableInfo: boolean;
disableSupport: boolean;
disableClusterManager: boolean;
disableModelRegistryManager: boolean;
disableTracking: boolean;
disableBYONImageStream: boolean;
disableISVBadges: boolean;
Expand Down
50 changes: 50 additions & 0 deletions frontend/src/pages/modelRegistrySettings/ModelRegistrySettings.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<ApplicationsPage
title="Model Registry Settings"
description="Manage model registry settings for all users in your organization."
loaded
empty={false}
errorMessage="Unable to load model registry settings."
emptyMessage="No model registry settings found."
provideChildrenPadding
>
<EmptyState variant={EmptyStateVariant.lg}>
<EmptyStateHeader
titleText="No model registries"
icon={<EmptyStateIcon icon={PlusCircleIcon} />}
headingLevel="h5"
/>
<EmptyStateBody>
You can create model registries for specific users or projects.
</EmptyStateBody>
<EmptyStateFooter>
<EmptyStateActions>
<Button variant="primary" onClick={() => navigate('/modelRegistry')}>
Create model registry
</Button>
</EmptyStateActions>
</EmptyStateFooter>
</EmptyState>
</ApplicationsPage>
);
};

export default ModelRegistrySettings;
10 changes: 10 additions & 0 deletions frontend/src/utilities/NavData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ const useCustomRuntimesNav = (): NavDataHref[] =>
},
]);

const useModelRegisterySettingsNav = (): NavDataHref[] =>
useAreaCheck<NavDataHref>(SupportedArea.MODEL_REGISTRY_SETTINGS, [
{
id: 'settings-model-registry',
label: 'Model registry settings',
href: '/modelRegistrySettings',
},
]);

const useUserManagementNav = (): NavDataHref[] =>
useAreaCheck<NavDataHref>(SupportedArea.USER_MANAGEMENT, [
{
Expand All @@ -174,6 +183,7 @@ const useSettingsNav = (): NavDataGroup[] => {
...useClusterSettingsNav(),
...useAcceleratorProfilesNav(),
...useCustomRuntimesNav(),
...useModelRegisterySettingsNav(),
...useUserManagementNav(),
];

Expand Down
2 changes: 2 additions & 0 deletions manifests/crd/odhdashboardconfigs.opendatahub.io.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ spec:
type: boolean
disableClusterManager:
type: boolean
disableModelRegistryManager:
type: boolean
disableTracking:
type: boolean
disableBYONImageStream:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ spec:
dashboardConfig:
disableBYONImageStream: false
disableClusterManager: false
disableModelRegistryManager: false
disableISVBadges: false
disableInfo: false
disableSupport: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ spec:
dashboardConfig:
disableBYONImageStream: false
disableClusterManager: false
disableModelRegistryManager: false
disableISVBadges: false
disableInfo: false
disableSupport: false
Expand Down

0 comments on commit 7a501f4

Please sign in to comment.