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/util/db-schema/instances.ts
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
/*
7
I think these two tables are is deprecated.
8
*/
9
10
import { Table } from "./types";
11
12
Table({
13
name: "instances",
14
rules: {
15
primary_key: "name",
16
},
17
fields: {
18
name: {
19
type: "string",
20
},
21
gce: {
22
type: "map",
23
},
24
gce_sha1: {
25
type: "string",
26
},
27
requested_preemptible: {
28
type: "boolean",
29
},
30
requested_status: {
31
type: "string",
32
desc: "One of 'RUNNING', 'TERMINATED'",
33
},
34
action: {
35
type: "map",
36
desc:
37
"{action:'start', started:timestamp, finished:timestamp, params:?, error:?, rule:?}",
38
date: ["started", "finished"],
39
},
40
},
41
});
42
43
Table({
44
name: "instance_actions_log",
45
rules: {
46
primary_key: "id",
47
},
48
fields: {
49
id: {
50
type: "uuid",
51
},
52
name: {
53
type: "string",
54
desc: "hostname of vm",
55
pg_type: "VARCHAR(63)",
56
},
57
action: {
58
type: "map",
59
desc: "same as finished action object for instances above",
60
date: ["started", "finished"],
61
},
62
},
63
});
64
65