From f699dcec21d74d547f72ba624529d7e4d1d5babf Mon Sep 17 00:00:00 2001 From: Christian Vogt Date: Fri, 28 Jul 2023 13:08:23 -0400 Subject: [PATCH 01/42] show event details without last activity timestamp --- frontend/src/pages/projects/notebook/utils.ts | 6 +++++- frontend/src/types.ts | 1 + frontend/src/utilities/notebookControllerUtils.ts | 13 +++++++++---- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/projects/notebook/utils.ts b/frontend/src/pages/projects/notebook/utils.ts index 4619b959f7..5a361cbe20 100644 --- a/frontend/src/pages/projects/notebook/utils.ts +++ b/frontend/src/pages/projects/notebook/utils.ts @@ -124,7 +124,11 @@ export const useNotebookStatus = ( const events = useWatchNotebookEvents(notebook.metadata.namespace, podUid, spawnInProgress); const annotationTime = notebook?.metadata.annotations?.['notebooks.kubeflow.org/last-activity']; - const lastActivity = annotationTime ? new Date(annotationTime) : null; + const lastActivity = annotationTime + ? new Date(annotationTime) + : spawnInProgress || podUid + ? new Date(notebook.metadata.creationTimestamp ?? 0) + : null; if (!lastActivity) { // Notebook not started, we don't have a filter time, ignore diff --git a/frontend/src/types.ts b/frontend/src/types.ts index 75e6d1177a..4781bc9072 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -284,6 +284,7 @@ type K8sMetadata = { uid?: string; labels?: { [key: string]: string }; annotations?: { [key: string]: string }; + creationTimestamp?: string; }; /** diff --git a/frontend/src/utilities/notebookControllerUtils.ts b/frontend/src/utilities/notebookControllerUtils.ts index e643421dd0..1ae210e8f2 100644 --- a/frontend/src/utilities/notebookControllerUtils.ts +++ b/frontend/src/utilities/notebookControllerUtils.ts @@ -330,10 +330,15 @@ export const useNotebookStatus = ( evt.involvedObject.uid === currentUserNotebookPodUID, ); - const lastActivity = useLastActivity( - open, - notebook?.metadata.annotations?.['notebooks.kubeflow.org/last-activity'], - ); + const lastActivity = + useLastActivity( + open, + notebook?.metadata.annotations?.['notebooks.kubeflow.org/last-activity'], + ) || + (notebook && (spawnInProgress || isNotebookRunning) + ? new Date(notebook.metadata.creationTimestamp ?? 0) + : null); + if (!lastActivity) { // Notebook not started, we don't have a filter time, ignore return [null, []]; From 6937543a20d997650ea94396afe253966f6a06d9 Mon Sep 17 00:00:00 2001 From: Lucas Fernandez Date: Fri, 4 Aug 2023 00:46:11 +0200 Subject: [PATCH 02/42] Update release docs --- docs/releases.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/releases.md b/docs/releases.md index fe1135e76f..73974b2f95 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -74,6 +74,7 @@ Once we reach a date in which we want to do a release (see other sections for mo - Focusing on the `odh-dashboard` folder, we'll need to copy some files over to track the latest changes of this release - Test the latest version of the quay image ([our quay repo](https://quay.io/repository/opendatahub/odh-dashboard?tab=tags)) on a cluster to make sure the pods can come up and the Dashboard is accessible - Create a PR to include the following: + - Switch to the `incubation` branch in `odh-dashboard` - First delete everything in the folder -- git will do the diff of what changed for us - Copy all the child folders in the [manifest folder](../manifests) - Exclude the `overlays` folder as this is for internal testing purposes From 98d56643e8da88fb46c51dd706c11fe5fba204e6 Mon Sep 17 00:00:00 2001 From: Lucas Fernandez Date: Mon, 7 Aug 2023 16:12:02 +0200 Subject: [PATCH 03/42] Fix tls option --- manifests/base/routes.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/base/routes.yaml b/manifests/base/routes.yaml index f8fd2c267d..3fa0139035 100644 --- a/manifests/base/routes.yaml +++ b/manifests/base/routes.yaml @@ -10,7 +10,7 @@ spec: targetPort: 8443 tls: insecureEdgeTerminationPolicy: Redirect - termination: Reencrypt + termination: reencrypt to: kind: Service name: odh-dashboard From 48b3e91f893900a2cf44e7e9d2eb5b33c4e9de7a Mon Sep 17 00:00:00 2001 From: manaswinidas Date: Tue, 1 Aug 2023 15:25:21 +0530 Subject: [PATCH 04/42] Deploy model path field enhancements --- .../InferenceServiceModal/DataConnectionFolderPathField.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/DataConnectionFolderPathField.tsx b/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/DataConnectionFolderPathField.tsx index 3a060c095b..45b5fed918 100644 --- a/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/DataConnectionFolderPathField.tsx +++ b/frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/DataConnectionFolderPathField.tsx @@ -11,9 +11,9 @@ const DataConnectionFolderPathField: React.FC { - type validate = React.ComponentProps['validated']; + type Validate = React.ComponentProps['validated']; - const [validated, setValidated] = React.useState('default'); + const [validated, setValidated] = React.useState('default'); const handlePathChange = (folderPath: string) => { setFolderPath(folderPath); @@ -45,7 +45,7 @@ const DataConnectionFolderPathField: React.FC From 84c167e6dfe2e7342adaf462608aafbb489fca49 Mon Sep 17 00:00:00 2001 From: Juntao Wang Date: Tue, 8 Aug 2023 13:45:06 -0400 Subject: [PATCH 05/42] Auto scroll on expanding deployed models tab and auto expand when deploying models --- frontend/src/components/ScrollViewOnMount.tsx | 24 ++++++++++++------- .../screens/projects/ServingRuntimeTable.tsx | 7 +++++- .../ServingRuntimeTableExpandedSection.tsx | 4 +++- .../projects/ServingRuntimeTableRow.tsx | 14 ++++++----- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/ScrollViewOnMount.tsx b/frontend/src/components/ScrollViewOnMount.tsx index 2067fa91e7..d35cf7c85e 100644 --- a/frontend/src/components/ScrollViewOnMount.tsx +++ b/frontend/src/components/ScrollViewOnMount.tsx @@ -1,13 +1,19 @@ import * as React from 'react'; -const ScrollViewOnMount: React.FC = () => ( -
{ - if (elm) { - elm.scrollIntoView(); - } - }} - /> -); +type ScrollViewOnMountProps = { + shouldScroll: boolean; +}; + +const ScrollViewOnMount: React.FC = ({ shouldScroll }) => { + const ref = React.useRef(null); + + React.useEffect(() => { + if (shouldScroll && ref.current) { + ref.current?.scrollIntoView(); + } + }, [shouldScroll]); + + return
; +}; export default ScrollViewOnMount; diff --git a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeTable.tsx b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeTable.tsx index 8ab227620f..46bcec9a14 100644 --- a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeTable.tsx +++ b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeTable.tsx @@ -3,6 +3,7 @@ import Table from '~/components/table/Table'; import useTableColumnSort from '~/components/table/useTableColumnSort'; import { ServingRuntimeKind } from '~/k8sTypes'; import { ProjectDetailsContext } from '~/pages/projects/ProjectDetailsContext'; +import { ServingRuntimeTableTabs } from '~/pages/modelServing/screens/types'; import { columns } from './data'; import ServingRuntimeTableRow from './ServingRuntimeTableRow'; import DeleteServingRuntimeModal from './DeleteServingRuntimeModal'; @@ -25,6 +26,7 @@ const ServingRuntimeTable: React.FC = ({ const [deployServingRuntime, setDeployServingRuntime] = React.useState(); const [deleteServingRuntime, setDeleteServingRuntime] = React.useState(); const [editServingRuntime, setEditServingRuntime] = React.useState(); + const [expandedColumn, setExpandedColumn] = React.useState(); const { dataConnections: { data: dataConnections }, @@ -48,7 +50,9 @@ const ServingRuntimeTable: React.FC = ({ obj={modelServer} onDeleteServingRuntime={(obj) => setDeleteServingRuntime(obj)} onEditServingRuntime={(obj) => setEditServingRuntime(obj)} - onDeployModal={(obj) => setDeployServingRuntime(obj)} + onDeployModel={(obj) => setDeployServingRuntime(obj)} + expandedColumn={expandedColumn} + setExpandedColumn={setExpandedColumn} /> )} /> @@ -86,6 +90,7 @@ const ServingRuntimeTable: React.FC = ({ setDeployServingRuntime(undefined); if (submit) { refreshInferenceServices(); + setExpandedColumn(ServingRuntimeTableTabs.DEPLOYED_MODELS); } }} projectContext={{ diff --git a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeTableExpandedSection.tsx b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeTableExpandedSection.tsx index fa9850bed5..666a0f762e 100644 --- a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeTableExpandedSection.tsx +++ b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeTableExpandedSection.tsx @@ -59,7 +59,9 @@ const ServingRuntimeTableExpandedSection: React.FC )} - + ); diff --git a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeTableRow.tsx b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeTableRow.tsx index 8f1d66c2ba..d6629ffa9e 100644 --- a/frontend/src/pages/modelServing/screens/projects/ServingRuntimeTableRow.tsx +++ b/frontend/src/pages/modelServing/screens/projects/ServingRuntimeTableRow.tsx @@ -15,17 +15,19 @@ type ServingRuntimeTableRowProps = { obj: ServingRuntimeKind; onDeleteServingRuntime: (obj: ServingRuntimeKind) => void; onEditServingRuntime: (obj: ServingRuntimeKind) => void; - onDeployModal: (obj: ServingRuntimeKind) => void; + onDeployModel: (obj: ServingRuntimeKind) => void; + expandedColumn?: ServingRuntimeTableTabs; + setExpandedColumn: (column?: ServingRuntimeTableTabs) => void; }; const ServingRuntimeTableRow: React.FC = ({ obj, onDeleteServingRuntime, onEditServingRuntime, - onDeployModal, + onDeployModel, + expandedColumn, + setExpandedColumn, }) => { - const [expandedColumn, setExpandedColumn] = React.useState(); - const { inferenceServices: { data: inferenceServices, @@ -119,7 +121,7 @@ const ServingRuntimeTableRow: React.FC = ({ From 4d0bce286a02f1465161eeac232238f15d26fb70 Mon Sep 17 00:00:00 2001 From: Juntao Wang Date: Tue, 15 Aug 2023 14:54:49 -0400 Subject: [PATCH 13/42] Update resource name, display name and description when duplicating custom serving runtime --- .../CustomServingRuntimeAddTemplate.tsx | 41 +++++++++++++++---- .../CustomServingRuntimeTableRow.tsx | 2 +- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/frontend/src/pages/modelServing/customServingRuntimes/CustomServingRuntimeAddTemplate.tsx b/frontend/src/pages/modelServing/customServingRuntimes/CustomServingRuntimeAddTemplate.tsx index bb42ff04a0..47fac284d0 100644 --- a/frontend/src/pages/modelServing/customServingRuntimes/CustomServingRuntimeAddTemplate.tsx +++ b/frontend/src/pages/modelServing/customServingRuntimes/CustomServingRuntimeAddTemplate.tsx @@ -21,7 +21,10 @@ import { createServingRuntimeTemplateBackend, updateServingRuntimeTemplateBackend, } from '~/services/templateService'; -import { getServingRuntimeDisplayNameFromTemplate } from './utils'; +import { + getServingRuntimeDisplayNameFromTemplate, + getServingRuntimeNameFromTemplate, +} from './utils'; import { CustomServingRuntimeContext } from './CustomServingRuntimeContext'; type CustomServingRuntimeAddTemplateProps = { @@ -33,13 +36,35 @@ const CustomServingRuntimeAddTemplate: React.FC { const { dashboardNamespace } = useDashboardNamespace(); const { refreshData } = React.useContext(CustomServingRuntimeContext); - const { state } = useLocation(); + const { state }: { state?: { template: TemplateKind } } = useLocation(); + + const copiedServingRuntimeString = React.useMemo( + () => + state + ? YAML.stringify({ + ...state.template.objects[0], + metadata: { + ...state.template.objects[0].metadata, + name: `${getServingRuntimeNameFromTemplate(state.template)}-copy`, + annotations: { + ...state.template.objects[0].metadata.annotations, + 'openshift.io/display-name': `Copy of ${getServingRuntimeDisplayNameFromTemplate( + state.template, + )}`, + 'openshift.io/description': + state.template.objects[0].metadata.annotations?.['openshift.io/description'], + }, + }, + }) + : '', + [state], + ); - const stringifiedTemplate = existingTemplate - ? YAML.stringify(existingTemplate.objects[0]) - : state - ? YAML.stringify(state.template) - : ''; + const stringifiedTemplate = React.useMemo( + () => + existingTemplate ? YAML.stringify(existingTemplate.objects[0]) : copiedServingRuntimeString, + [copiedServingRuntimeString, existingTemplate], + ); const [code, setCode] = React.useState(stringifiedTemplate); const [loading, setIsLoading] = React.useState(false); const [error, setError] = React.useState(undefined); @@ -108,7 +133,7 @@ const CustomServingRuntimeAddTemplate: React.FC