// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import React from 'react'; import { CustomStyleRulesCallback } from 'common/custom-theme'; import { WithStyles, withStyles, Card, CardHeader, IconButton, CardContent, Tooltip, Typography, Grid, Link, } from '@material-ui/core'; import { ArvadosTheme } from 'common/custom-theme'; import { CloseIcon, MaximizeIcon, ResourceIcon, UnMaximizeIcon, ShowChartIcon, } from 'components/icon/icon'; import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view'; import { connect } from 'react-redux'; import { Process } from 'store/processes/process'; import { NodeInstanceType } from 'store/process-panel/process-panel'; import { DetailsAttribute } from "components/details-attribute/details-attribute"; import { formatFileSize } from "common/formatters"; import { MountKind } from 'models/mount-types'; interface ProcessResourceCardDataProps { process: Process; nodeInfo: NodeInstanceType | null; usageReport: string | null; } type CssRules = "card" | "header" | "title" | "avatar" | "iconHeader" | "content" | "sectionH3" | "reportButton"; const styles: CustomStyleRulesCallback = (theme: ArvadosTheme) => ({ card: { height: '100%' }, header: { paddingBottom: "0px" }, title: { paddingTop: theme.spacing(0.5), }, avatar: { paddingTop: theme.spacing(0.5), }, iconHeader: { fontSize: '1.875rem', color: theme.customs.colors.greyL, }, content: { paddingTop: "0px", maxHeight: `calc(100% - ${theme.spacing(7.5)}px)`, overflow: "auto" }, sectionH3: { margin: "0.5em", color: theme.customs.colors.greyD, fontSize: "0.8125rem", textTransform: "uppercase", }, reportButton: { } }); type ProcessResourceCardProps = ProcessResourceCardDataProps & WithStyles & MPVPanelProps; export const ProcessResourceCard = withStyles(styles)(connect()( ({ classes, nodeInfo, usageReport, doHidePanel, doMaximizePanel, doUnMaximizePanel, panelMaximized, panelName, process, }: ProcessResourceCardProps) => { 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 } title={ Resources } action={
{usageReport && Resource usage report} {doUnMaximizePanel && panelMaximized && } {doMaximizePanel && !panelMaximized && } {doHidePanel && }
} />

Requested Resources

{process.container?.runtimeConstraints.cuda && process.container?.runtimeConstraints.cuda.device_count > 0 ? <> : null} {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}

Assigned Instance Type

{nodeInfo === null ? No instance type recorded : {nodeInfo.CUDA && nodeInfo.CUDA.DeviceCount > 0 && <> } }
* RAM available to the program is limited to Requested RAM, not Instance RAM
; } ));