diff --git a/client/src/features/session/components/status/SessionStatusBadge.tsx b/client/src/features/session/components/status/SessionStatusBadge.tsx index 2b4c3f92f4..d268d4cf0a 100644 --- a/client/src/features/session/components/status/SessionStatusBadge.tsx +++ b/client/src/features/session/components/status/SessionStatusBadge.tsx @@ -26,6 +26,7 @@ import { PopoverHeader, UncontrolledPopover, } from "reactstrap"; + import { NotebookAnnotations } from "../../../../notebooks/components/session.types"; import { SessionStatus, SessionStatusState } from "../../sessions.types"; import { getSessionStatusColor } from "../../utils/sessionStatus.utils"; @@ -60,7 +61,7 @@ export default function SessionStatusBadge({ : "Paused Session"} - {message} + {defaultImage &&
A fallback image was used.
} {status === "hibernated" && ( @@ -93,6 +94,46 @@ export default function SessionStatusBadge({ ); } +interface PrettySessionErrorMessageProps { + message: string | null | undefined; +} + +export function PrettySessionErrorMessage({ + message, +}: PrettySessionErrorMessageProps) { + // eslint-disable-next-line spellcheck/spell-checker + if (message?.includes("Insufficient nvidia.com/gpu")) { + return ( + <> +

+ Scheduling error: there are not enough GPUs available to start or + resume the session. +

+

Original error message:

+

{message}

+ + ); + } + + if ( + message?.includes("nodes are available") || + message?.includes("The resource quota has been exceeded.") + ) { + return ( + <> +

+ Scheduling error: one or more compute resources have been exhausted in + the resource pool. +

+

Original error message:

+

{message}

+ + ); + } + + return <>{message}; +} + function displayedSessionStatus(status: SessionStatusState): string { return status === "running" ? "Running" diff --git a/client/src/notebooks/components/SessionListStatus.tsx b/client/src/notebooks/components/SessionListStatus.tsx index b203894343..48b42bb764 100644 --- a/client/src/notebooks/components/SessionListStatus.tsx +++ b/client/src/notebooks/components/SessionListStatus.tsx @@ -25,8 +25,10 @@ import { PopoverHeader, UncontrolledPopover, } from "reactstrap"; + import { Clipboard } from "../../components/clipboard/Clipboard"; import SessionHibernationStatusDetails from "../../features/session/components/status/SessionHibernationStatusDetails"; +import { PrettySessionErrorMessage } from "../../features/session/components/status/SessionStatusBadge"; import SessionStatusIcon from "../../features/session/components/status/SessionStatusIcon"; import SessionStatusText from "../../features/session/components/status/SessionStatusText"; import { SessionStatusState } from "../../features/session/sessions.types"; @@ -55,8 +57,7 @@ function SessionListRowStatusExtraDetails({ Kubernetes pod status - {details.message} -
+
); @@ -136,8 +137,7 @@ function SessionListRowStatusIconPopover({ Kubernetes pod status - {details.message} -
+
);