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/next/components/store/quota-config-presets.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { IconName } from "@cocalc/frontend/components/icon";6import { Uptime } from "@cocalc/util/consts/site-license";7import { Paragraph } from "components/misc";8import A from "components/misc/A";9import { ReactNode } from "react";1011export type Preset = "standard" | "instructor" | "research";1213// Fields to be used to match a configured license against a pre-existing preset.14//15export const PRESET_MATCH_FIELDS: Record<string, string> = {16cpu: "CPU count",17disk: "disk space",18ram: "memory",19uptime: "idle timeout",20member: "member hosting",21};2223export interface PresetConfig {24icon: IconName;25name: string;26descr: ReactNode;27details: ReactNode;28cpu: number;29ram: number;30disk: number;31uptime: Uptime;32member: boolean;33expect: string[];34note?: ReactNode;35}3637type PresetEntries = {38[key in Preset]: PresetConfig;39};4041// some constants to keep text and preset in sync42const STANDARD_CPU = 1;43const STANDARD_RAM = 4;44const STANDARD_DISK = 3;4546const PRESET_STANDARD_NAME = "Standard";4748export const PRESETS: PresetEntries = {49standard: {50icon: "line-chart",51name: PRESET_STANDARD_NAME,52descr:53"is a good choice for most users to get started and students in a course",54expect: [55"Run 5-10 Jupyter Notebooks at once,",56"Edit LaTeX, Markdown, R Documents, and use VS Code,",57`${STANDARD_DISK} GB disk space is sufficient to store many files and small datasets.`,58],59note: (60<Paragraph type="secondary">61You can start with a "Run Limit" of one project. Later, when your usage62increases, you can easily edit your license at any time to change the63"Run Limit" or the quotas. Read more about{" "}64<A href={"https://doc.cocalc.com/licenses.html"}>Managing Licenses</A>{" "}65in our documentation.66</Paragraph>67),68details: (69<>70You can run 5-10 Jupyter Notebooks in a project at once, depending on71the kernel and memory usage. This quota is fine for editing LaTeX72documents, working with Sage Worksheets, using VS Code, and editing all73other document types. Also, {STANDARD_DISK} GB of disk space is74sufficient to store many files and a few small datasets.75</>76),77cpu: STANDARD_CPU,78ram: STANDARD_RAM,79disk: STANDARD_DISK,80uptime: "short",81member: true,82},83instructor: {84icon: "slides",85name: "Instructor",86descr: "is good for your instructor project when teaching a course",87expect: [88"Grade the work of students,",89"Run 10-20 Jupyter Notebooks at once¹,",90"Store the files of all students,",91"Make longer breaks without your project being shut down.",92],93note: (94<>95<Paragraph type="secondary">96For your instructor project, you only need one such license with a97"Run Limit" of 1. Apply that license via the{" "}98<A href={"https://doc.cocalc.com/project-settings.html#licenses"}>99project settings100</A>101. For the students, select a "{PRESET_STANDARD_NAME}" license with a102"Run Limit" of the number of students and distribute it via the{" "}103<A104href={105"https://doc.cocalc.com/teaching-upgrade-course.html#teacher-or-institute-pays-for-upgrades"106}107>108course configuration109</A>110.111</Paragraph>112<Paragraph type="secondary">113¹ Depends on the kernel; also, make sure to use the{" "}114<A115href={116"https://doc.cocalc.com/jupyter.html?highlight=halt%20button#use-the-halt-button-to-conserve-memory"117}118>119Halt button120</A>121.122</Paragraph>123</>124),125details: (126<>127The upgrade schema is suitable for grading the work of students: by128increasing the memory quota you can run many Jupyter Notebooks at the129same time – still, make sure to use the{" "}130<A131href={132"https://doc.cocalc.com/jupyter.html?highlight=halt%20button#use-the-halt-button-to-conserve-memory"133}134>135Halt button136</A>{" "}137to avoid exceeding the quota. Regarding disk space, distributing and138collecting files from many students adds up – hence the disk quota is139increased significantly! Finally, a longer idle-timeout will allow you140to make longer breaks without your project being shut down. You only141need a license with a "Run Limit" of one for your instructor project.142Apply that license via the{" "}143<A href={"https://doc.cocalc.com/project-settings.html#licenses"}>144project settings145</A>146, not the course configuration!147</>148),149cpu: 1,150ram: 2 * STANDARD_RAM,151disk: 15,152uptime: "medium",153member: true,154},155research: {156icon: "users",157name: "Researcher",158descr:159"is a good choice for intense professional usage or a research group",160expect: [161"Run many Jupyter Notebooks at once,",162"Run memory-intensive computations,",163"1 day idle-timeout is sufficient to not interrupt your work, and to execute long-running calculations.",164"More disk space also allows you to store larger datasets.",165],166note: (167<>168<Paragraph type="secondary">169If you need{" "}170<b>much more dedicated disk space, a GPU, more CPU or RAM</b>, you171should also{" "}172<b>173use <A href="/features/compute-server">compute servers</A>.174</b>175</Paragraph>176</>177),178details: (179<>180This configuration allows the project to run many Jupyter Notebooks at181once and run memory-intensive computations. An idle-timeout of one day182is sufficient to not interrupt your work; you can also execute183long-running calculations with this configuration. Increasing the disk184space quota also allows you to store larger datasets. If you need{" "}185<b>much more dedicated disk space, a GPU, more CPU or RAM</b>, you186should also{" "}187<b>188use a <A href="/features/compute-server">compute server</A>.189</b>190</>191),192cpu: 2,193ram: 10,194disk: 10,195uptime: "day",196member: true,197},198} as const;199200201