Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/frontend/compute/cloud/google-cloud/specs.tsx
Views: 687
import { displayAcceleratorType } from "./accelerator";1import { plural } from "@cocalc/util/misc";2import { getMinDiskSizeGb } from "@cocalc/util/db-schema/compute-servers";34export default function Specs({ configuration, priceData, IMAGES }) {5const gpu = configuration.acceleratorType6? `${configuration.acceleratorCount ?? 1} ${displayAcceleratorType(7configuration.acceleratorType,8)} ${plural(configuration.acceleratorCount ?? 1, "GPU")}, `9: "";1011return (12<div>13{configuration.spot ? "Spot " : "Standard "} {configuration.machineType}{" "}14with {gpu}15{priceData ? (16<span>17<RamAndCpu18machineType={configuration.machineType}19priceData={priceData}20inline21/>22</span>23) : (24""25)}26, and a{" "}27{configuration.diskSizeGb ??28`at least ${getMinDiskSizeGb({ configuration, IMAGES })}`}{" "}29GB{" "}30{configuration.diskType?.includes("hyper") ? (31"hyperdisk"32) : (33<>34{(configuration.diskType ?? "pd-standard") != "pd-standard"35? " SSD "36: " HDD "}{" "}37disk38</>39)}{" "}40in {configuration.zone}.41</div>42);43}4445export function RamAndCpu({46machineType,47priceData,48style,49inline,50}: {51machineType: string;52priceData;53style?;54inline?: boolean;55}) {56const data = priceData.machineTypes[machineType];57if (data == null) return null;58const { memory } = data;59let { vcpu } = data;60if (!vcpu || !memory) return null;61if (machineType == "e2-micro") {62vcpu = "0.25-2";63} else if (machineType == "e2-small") {64vcpu = "0.5-2";65} else if (machineType == "e2-medium") {66vcpu = "1-2";67}68if (inline) {69return (70<span style={style}>71{vcpu} {plural(vcpu, "vCPU")}, {memory} GB RAM72</span>73);74}75return (76<div style={{ color: "#666", ...style }}>77<b>{plural(vcpu, "vCPU")}: </b>78<div79style={{ width: "65px", textAlign: "left", display: "inline-block" }}80>81{vcpu}82</div>83<b>Memory:</b> {memory} GB84</div>85);86}878889