// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import React from 'react'; import { StyleRulesCallback, WithStyles, withStyles, Card, CardContent, Typography, Grid } from '@material-ui/core'; import { ArvadosTheme } from 'common/custom-theme'; import { ResourceIcon } from 'components/icon/icon'; import { RootState } from 'store/store'; import { connect } from 'react-redux'; import { ClusterConfigJSON } from 'common/config'; import { NotFoundView } from 'views/not-found-panel/not-found-panel'; import { formatCWLResourceSize, formatCost, formatFileSize } from 'common/formatters'; import { DetailsAttribute } from 'components/details-attribute/details-attribute'; import { DefaultCodeSnippet } from 'components/default-code-snippet/default-code-snippet'; type CssRules = 'root' | 'infoBox' | 'instanceType'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { width: "calc(100% + 20px)", margin: "0 -10px", overflow: 'auto' }, infoBox: { padding: "0 10px 10px", }, instanceType: { padding: "10px", }, }); type InstanceTypesPanelConnectedProps = {config: ClusterConfigJSON}; type InstanceTypesPanelRootProps = InstanceTypesPanelConnectedProps & WithStyles; const mapStateToProps = ({auth}: RootState): InstanceTypesPanelConnectedProps => ({ config: auth.config.clusterConfig, }); export const InstanceTypesPanel = withStyles(styles)(connect(mapStateToProps)( ({ config, classes }: InstanceTypesPanelRootProps) => { const instances = config.InstanceTypes || {}; return These are the cloud compute instance types configured for this cluster. The core count and maximum RAM request correspond to the greatest values you can put in the CWL Workflow ResourceRequest{" "} {" "} and{" "} {" "} and still be scheduled on that instance type. {Object.keys(instances).length > 0 ? Object.keys(instances) .sort((a, b) => { const typeA = instances[a]; const typeB = instances[b]; if (typeA.Price !== typeB.Price) { return typeA.Price - typeB.Price; } else { return typeA.ProviderType.localeCompare(typeB.ProviderType); } }).map((instanceKey) => { const instanceType = instances[instanceKey]; const diskRequest = instanceType.IncludedScratch; const ramRequest = instanceType.RAM - config.Containers.ReserveExtraRAM; return {instanceKey} {instanceType.CUDA && instanceType.CUDA.DeviceCount > 0 ? <> : <> } ; }) : } ; } ));