X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1d0297e01e0196d63b4fb42573e5bd6d1e1a31b9..90a80294d2f10e5aa9b7f33adc760ce55bbf4f04:/src/views/process-panel/process-resource-card.tsx diff --git a/src/views/process-panel/process-resource-card.tsx b/src/views/process-panel/process-resource-card.tsx index 79e600e7e0..41347d7ede 100644 --- a/src/views/process-panel/process-resource-card.tsx +++ b/src/views/process-panel/process-resource-card.tsx @@ -20,6 +20,7 @@ import { ArvadosTheme } from 'common/custom-theme'; import { CloseIcon, MaximizeIcon, + MemoryIcon, UnMaximizeIcon, ProcessIcon } from 'components/icon/icon'; @@ -28,21 +29,46 @@ import { connect } from 'react-redux'; import { Process } from 'store/processes/process'; import { NodeInstanceType } from 'store/process-panel/process-panel'; import { DefaultView } from 'components/default-view/default-view'; +import { DetailsAttribute } from "components/details-attribute/details-attribute"; +import { formatFileSize } from "common/formatters"; +import { InputCollectionMount } from 'store/processes/processes-actions'; +import { MountKind, TemporaryDirectoryMount } from 'models/mount-types'; interface ProcessResourceCardDataProps { process: Process; nodeInfo: NodeInstanceType | null; } -type CssRules = "card" | "header" | "title" | "avatar" | "iconHeader" | "content"; +type CssRules = "card" | "header" | "title" | "avatar" | "iconHeader" | "content" | "sectionH3"; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ - card: {}, - header: {}, - title: {}, - avatar: {}, - iconHeader: {}, - content: {} + card: { + height: '100%' + }, + header: { + paddingBottom: "0px" + }, + title: { + paddingTop: theme.spacing.unit * 0.5 + }, + avatar: { + paddingTop: theme.spacing.unit * 0.5 + }, + iconHeader: { + fontSize: '1.875rem', + color: theme.customs.colors.greyL, + }, + content: { + paddingTop: "0px", + maxHeight: `calc(100% - ${theme.spacing.unit * 7.5}px)`, + overflow: "auto" + }, + sectionH3: { + margin: "0.5em", + color: theme.customs.colors.greyD, + fontSize: "0.8125rem", + textTransform: "uppercase", + } }); type ProcessResourceCardProps = ProcessResourceCardDataProps & WithStyles & MPVPanelProps; @@ -50,7 +76,17 @@ type ProcessResourceCardProps = ProcessResourceCardDataProps & WithStyles { - const loading = nodeInfo === null; + const loading = false; + + let diskRequest = 0; + if (process.container?.mounts) { + for (const mnt in process.container.mounts) { + const mp = process.container.mounts[mnt]; + if (mp.kind === MountKind.TEMPORARY_DIRECTORY) { + diskRequest += mp.capacity; + } + } + } return } + avatar={} title={ Resources @@ -82,26 +118,113 @@ export const ProcessResourceCard = withStyles(styles)(connect()( } /> - <> - {/* raw is undefined until params are loaded */} - {loading && - - } - {/* Once loaded, either raw or params may still be empty - * Raw when all params are empty - * Params when raw is provided by containerRequest properties but workflow mount is absent for preview - */} - {!loading && - <> -
- stuff -
- } - {!loading && - - } - + + +

Requested Resources

+ + + + + + + + + + + + {process.container?.runtimeConstraints.keep_cache_ram && + process.container?.runtimeConstraints.keep_cache_ram > 0 ? + + + : null} + + {process.container?.runtimeConstraints.keep_cache_disk && + process.container?.runtimeConstraints.keep_cache_disk > 0 ? + + + : null} + + {process.container?.runtimeConstraints.API ? + + : null} + + {process.container?.runtimeConstraints.cuda && + process.container?.runtimeConstraints.cuda.device_count > 0 ? + <> + + + + + + + + + + : null} + +
+ + + +

Assigned Instance Type

+ {nodeInfo === null ? + No instance type recorded + + : + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {nodeInfo.CUDA.DeviceCount > 0 && + <> + + + + + + + + + + + + + + + + + + + } + } +
+
-
; + ; } ));