CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/compute/cloud/hyperstack/specs.tsx
Views: 687
1
import NVIDIA from "@cocalc/frontend/compute/nvidia";
2
import { capitalize, commas, plural } from "@cocalc/util/misc";
3
import { toGPU } from "./util";
4
import { humanFlavor } from "@cocalc/util/compute/cloud/hyperstack/flavor";
5
import { optionKey } from "@cocalc/util/compute/cloud/hyperstack/pricing";
6
import { DEFAULT_DISK } from "@cocalc/util/compute/cloud/hyperstack/api-types";
7
import { Tooltip } from "antd";
8
9
export default function Specs({
10
diskSizeGb,
11
flavor_name,
12
region_name,
13
priceData,
14
}) {
15
const data = priceData?.options[optionKey({ flavor_name, region_name })];
16
17
if (data == null) {
18
return (
19
<div>
20
{flavor_name} in {region_name}
21
</div>
22
);
23
}
24
return (
25
<span>
26
Standard {humanFlavor(flavor_name)} with{" "}
27
{data.gpu ? (
28
<>
29
<NVIDIA gpu={toGPU(data.gpu)} count={data.gpu_count} />,{" "}
30
</>
31
) : (
32
""
33
)}
34
{data.cpu} {plural(data.cpu, "vCPU")}, {commas(data.ram)} GB RAM,{" "}
35
{commas(diskSizeGb ?? DEFAULT_DISK)} GB persistent SSD disk
36
{data.ephemeral ? (
37
<Tooltip
38
title={`The ephemeral disk is mounted at /ephemeral, and is deleted when the compute server is shutdown or rebooted. Part of this disk is also used for caching.`}
39
>
40
{" "}
41
and {commas(data.ephemeral)} GB ephemeral disk
42
</Tooltip>
43
) : undefined}{" "}
44
in {capitalize(region_name.toLowerCase().split("-")[0])}.
45
</span>
46
);
47
}
48
49