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/util/compute-images.ts
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45// this is tied to the back-end setup of cocalc.com and only used if6// the "/customize" endpoint does not send a suitable "software" field.7// check frontend/customize.tsx for more details.89import * as schema from "./db-schema";1011// WARNING! Do not remove this from the public api. **It is used by kucalc12// in the (closed source) manage-actions Kubernetes backend.**13export const FALLBACK_COMPUTE_IMAGE = schema.FALLBACK_COMPUTE_IMAGE;1415const DEFAULT_COMPUTE_IMAGE = schema.DEFAULT_COMPUTE_IMAGE;1617// this array defines their ordering18const GROUPS = [19"Main",20"Ubuntu 22.04",21"Ubuntu 20.04",22"Ubuntu 18.04",23"Ubuntu 16.04",24] as const;2526type Group = (typeof GROUPS)[number];2728// names of old images, that won't trigger the "upgrade banner", pointing to the most recent end-of-life image of that series29export const DISMISS_IMG_1804 = "ubuntu1804";30export const DISMISS_IMG_2004 = "ubuntu2004-eol";31// names of old images triggering the upgrade banner to 22.0432export const UBUNTU2004_DEPRECATED = "ubuntu2004";33export const UBUNTU2004_DEV = "ubuntu2004-dev";34export const UBUNTU2204_DEV = "ubuntu2204-dev";3536export interface ComputeImage {37id: string; // the key under which it is stored in the database38title?: string;39short?: string; // a shorter title, show this when you also show the group40descr?: string;41group: string;42order?: number;43hidden?: boolean;44tag?: string;45registry?: string;46}4748interface ComputeImageProd49extends Omit<ComputeImage, "id" | "tag" | "registry"> {50group: Group;51}5253// NOTE: do not remove entries, to preserve rendering user-facing strings for older entries54// rather, mark them as {hidden: true}55const COMPUTE_IMAGES: { [key: string]: ComputeImageProd } = {56// "default" or "undefined" is what was used for "ubuntu1804" until summer 202057// 2020: DEFAULT_COMPUTE_IMAGE has been "ubuntu2004" until december 2022.58// 2022: DEFAULT_COMPUTE_IMAGE is now "ubuntu2204" and "ubuntu2004" became EOL.59[DEFAULT_COMPUTE_IMAGE]: {60order: 0,61title: "Ubuntu 22.04 (Default)",62short: "Ubuntu 22.04 (Default)",63descr: "Ubuntu 22.04 based software stack, regularly updated",64group: "Main",65},66[UBUNTU2204_DEV]: {67title: "Ubuntu 22.04 (Testing)",68short: "Ubuntu 22.04 (Testing)",69descr: "Upcoming Ubuntu 22.04 based software stack",70group: "Ubuntu 22.04",71},72default: {73order: 1,74title: "Ubuntu 18.04 (Deprecated)",75short: "Ubuntu 18.04 (Deprecated)",76descr: "Reached end of life in August 2020",77group: "Main",78hidden: true,79},80[DISMISS_IMG_1804]: {81// a synonym of "default", but with a specific functionality!82// we use it as a marker: if a "default" project (before the 20.04 upgrade) is set to stay at 18.04, this image is selected.83order: 2,84title: "Ubuntu 18.04 (EndOfLife)",85short: "Ubuntu 18.04 (EndOfLife)",86descr: "Reached end of life in August 2020",87group: "Main",88},89[DISMISS_IMG_2004]: {90order: 1,91title: "Ubuntu 20.04 (Deprecated)",92short: "Ubuntu 20.04 (Deprecated)",93descr: "Reached end of life in May 2023",94group: "Main",95},96[UBUNTU2004_DEPRECATED]: {97order: 1,98title: "Ubuntu 20.04 (Deprecated)",99short: "Ubuntu 20.04 (Deprecated)",100descr: "Reached end of life in May 2023",101group: "Main",102hidden: true, // any project that is set to "ubuntu2004" will be shown a banner → either update to ubuntu2204 or keep ubuntu2004-eol103},104"ubuntu2204-previous": {105title: "Ubuntu 22.04 (Previous)",106short: "Previous",107descr: "Slightly behind 22.04 (Current)",108group: "Ubuntu 22.04",109},110"ubuntu2004-previous": {111title: "Ubuntu 20.04 (Previous)",112short: "Previous",113descr: "Slightly behind 20.04 (Current)",114group: "Ubuntu 20.04",115hidden: true,116},117"ubuntu2204-2024-08-01": {118title: "Ubuntu 22.04 (2024-08-01)",119short: "2024-08-01",120descr: "Frozen on 2024-08-01 and no longer updated",121group: "Ubuntu 22.04",122},123"ubuntu2204-2024-05-13": {124title: "Ubuntu 22.04 (2024-05-13)",125short: "2024-05-13",126descr: "Frozen on 2024-05-13 and no longer updated",127group: "Ubuntu 22.04",128},129"ubuntu2204-2024-02-07": {130title: "Ubuntu 22.04 (2024-02-07)",131short: "2024-02-07",132descr: "Frozen on 2024-02-07 and no longer updated",133group: "Ubuntu 22.04",134},135"ubuntu2204-2023-01-09": {136title: "Ubuntu 22.04 (2023-01-09)",137short: "2023-01-09",138descr: "Frozen on 2023-01-09 and no longer updated",139group: "Ubuntu 22.04",140},141"ubuntu2204-2023-04-19": {142title: "Ubuntu 22.04 (2023-04-19)",143short: "2023-04-19",144descr: "Frozen on 2023-04-19 and no longer updated",145group: "Ubuntu 22.04",146},147"ubuntu2204-2023-05-15": {148title: "Ubuntu 22.04 (2023-05-15)",149short: "2023-05-15",150descr: "Frozen on 2023-05-15 and no longer updated",151group: "Ubuntu 22.04",152},153"ubuntu2204-2023-09-11": {154title: "Ubuntu 22.04 (2023-09-11)",155short: "2023-09-11",156descr: "Frozen on 2023-09-11 and no longer updated",157group: "Ubuntu 22.04",158},159[UBUNTU2004_DEV]: {160title: "Ubuntu 20.04 (Testing)",161short: "Testing",162descr: "Upcoming software changes – could be broken!",163group: "Ubuntu 20.04",164},165"ubuntu2004-2020-10-28": {166title: "Ubuntu 20.04 (2020-10-28)",167short: "2020-10-28",168group: "Ubuntu 20.04",169descr: "Frozen on 2020-10-28 and no longer updated",170},171"ubuntu2004-2020-12-09": {172title: "Ubuntu 20.04 (2020-12-09)",173short: "2020-12-09",174group: "Ubuntu 20.04",175descr: "Frozen on 2020-12-09 and no longer updated",176},177"ubuntu2004-2021-02-01": {178title: "Ubuntu 20.04 (2021-02-01)",179short: "2021-02-01",180group: "Ubuntu 20.04",181descr: "Frozen on 2021-02-01 and no longer updated",182},183"ubuntu2004-2021-05-31": {184title: "Ubuntu 20.04 (2021-05-31)",185short: "2021-05-31",186group: "Ubuntu 20.04",187descr: "Frozen on 2021-05-31 and no longer updated",188},189"ubuntu2004-2021-08-13": {190title: "Ubuntu 20.04 (2021-08-13)",191short: "2021-08-13",192group: "Ubuntu 20.04",193descr: "Frozen on 2021-08-13 and no longer updated",194},195"ubuntu2004-2021-10-10": {196title: "Ubuntu 20.04 (2021-10-10)",197short: "2021-10-10",198group: "Ubuntu 20.04",199descr: "Frozen on 2021-10-10 and no longer updated",200},201"ubuntu2004-2022-04-19": {202title: "Ubuntu 20.04 (2022-04-19)",203short: "2022-04-19",204group: "Ubuntu 20.04",205descr: "Frozen on 2022-04-19 and no longer updated",206},207"ubuntu2004-2022-08-17": {208title: "Ubuntu 20.04 (2022-08-17)",209short: "2022-08-17",210group: "Ubuntu 20.04",211descr: "Frozen on 2022-08-17 and no longer updated",212},213"ubuntu2004-2022-11-25": {214title: "Ubuntu 20.04 (2022-11-25)",215short: "2022-11-25",216group: "Ubuntu 20.04",217descr: "Frozen on 2022-11-25 and no longer updated",218},219previous: {220order: -2,221title: "Ubuntu 18.04 (Previous)",222short: "Previous",223descr: "Reached end of life in August 2020",224group: "Ubuntu 18.04",225hidden: true,226},227exp: {228order: -1,229title: "Ubuntu 18.04 (Experimental)",230short: "Experimental",231descr: "Reached end of life in August 2020",232group: "Ubuntu 18.04",233hidden: true,234},235"stable-2018-08-27": {236title: "Ubuntu 18.04 @ 2018-08-27",237short: "2018-08-27",238descr: "Frozen on 2018-08-27 and no longer updated",239group: "Ubuntu 18.04",240},241"stable-2019-01-12": {242title: "Ubuntu 18.04 @ 2019-01-12",243short: "2019-01-12",244descr: "Frozen on 2019-01-12 and no longer updated",245group: "Ubuntu 18.04",246},247"stable-2019-07-15": {248title: "Ubuntu 18.04 @ 2019-07-15",249short: "2019-07-15",250descr: "Frozen on 2019-07-15 and no longer updated",251group: "Ubuntu 18.04",252},253"stable-2019-10-25_ro": {254title: "Ubuntu 18.04 @ 2019-10-25",255short: "2019-10-25",256descr: "Frozen on 2019-10-25 and no longer updated",257group: "Ubuntu 18.04",258},259"stable-2019-12-15_ro": {260title: "Ubuntu 18.04 @ 2019-12-15",261short: "2019-12-15",262descr: "Frozen on 2019-12-15 and no longer updated",263group: "Ubuntu 18.04",264},265"stable-2020-01-26_ro": {266title: "Ubuntu 18.04 @ 2020-01-26",267short: "2020-01-26",268descr: "Frozen on 2020-01-26 and no longer updated",269group: "Ubuntu 18.04",270},271"stable-2020-07-31": {272title: "Ubuntu 18.04 @ 2020-07-31",273short: "2020-07-31",274descr: "Frozen on 2020-07-31 and no longer updated",275group: "Ubuntu 18.04",276},277old: {278order: 10,279title: "Old Ubuntu 16.04",280short: "Old software image",281descr: "In use until Summer 2018. No longer maintained!",282group: "Ubuntu 16.04",283},284} as const;285286export const FALLBACK_SOFTWARE_ENV = {287default: DEFAULT_COMPUTE_IMAGE,288groups: GROUPS,289environments: COMPUTE_IMAGES,290} as const;291292// this is purely fallback for the case, where the new software env code runs on-prem293// but no software is setup. it assumes projects were created with the DEFAULT_COMPUTE_IMAGE.294export const FALLBACK_ONPREM_ENV = {295default: DEFAULT_COMPUTE_IMAGE,296groups: ["Standard"],297environments: {298[DEFAULT_COMPUTE_IMAGE]: {299title: "Standard",300group: "Standard",301},302},303} as const;304305306