Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 39538
1
###############################################################################
2
#
3
# CoCalc: Collaborative Calculation in the Cloud
4
#
5
# Copyright (C) 2016, Sagemath Inc.
6
#
7
# This program is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation, either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
#
20
###############################################################################
21
22
23
###
24
Compute related schema stuff (see compute.coffee)
25
26
Here's a picture of the finite state machine defined below:
27
28
----------[closing] ------- --------- [stopping] <--------
29
\|/ \|/ |
30
[closed] --> [opening] --> [opened] --> [starting] --> [running]
31
/|\ /|\
32
| |
33
\|/ \|/
34
[saving] [pending] [saving]
35
36
The icon names below refer to font-awesome, and are used in the UI.
37
38
###
39
40
exports.COMPUTE_STATES =
41
closed:
42
desc : 'Project is in cold storage, and will take longer than normal to start.'
43
icon : 'stop' # font awesome icon
44
display : 'Offline' # displayed name for users
45
stable : true
46
to :
47
open : 'opening'
48
commands : ['open', 'move', 'status', 'destroy', 'mintime']
49
50
opened:
51
desc : 'Project is available and ready to start.'
52
icon : 'stop'
53
display : 'Stopped'
54
stable : true
55
to :
56
start : 'starting'
57
close : 'closing'
58
save : 'saving'
59
commands : ['start', 'close', 'save', 'copy_path', 'mkdir', 'directory_listing', 'read_file', 'network', 'mintime', 'disk_quota', 'compute_quota', 'status', 'migrate_live']
60
61
pending:
62
desc : 'Finding a place to run your project. If nothing becomes available, reduce dedicated RAM or CPU, pay for members only hosting, or contact support.'
63
icon : 'times-rectangle'
64
display : 'Pending'
65
stable : true
66
to :
67
stop : 'stopping'
68
command : ['stop']
69
70
running:
71
desc : 'Project is running.'
72
icon : 'edit'
73
display : 'Running'
74
stable : true
75
to :
76
stop : 'stopping'
77
save : 'saving'
78
commands : ['stop', 'save', 'address', 'copy_path', 'mkdir', 'directory_listing', 'read_file', 'network', 'mintime', 'disk_quota', 'compute_quota', 'status', 'migrate_live']
79
80
saving:
81
desc : 'Project is being copied to a central file server for longterm storage.'
82
icon : 'save'
83
display : 'Saving to server'
84
to : {}
85
timeout : 30*60
86
commands : ['address', 'copy_path', 'mkdir', 'directory_listing', 'read_file', 'network', 'mintime', 'disk_quota', 'compute_quota', 'status']
87
88
closing:
89
desc : 'Project is in the process of being closed.'
90
icon : 'close'
91
display : 'Closing'
92
to : {}
93
timeout : 5*60
94
commands : ['status', 'mintime']
95
96
opening:
97
desc : 'Project is being copied from cold storage, which may take several minutes depending on how many files you have.'
98
icon : 'gears'
99
display : 'Opening'
100
to : {}
101
timeout : 30*60
102
commands : ['status', 'mintime']
103
104
starting:
105
desc : 'Project is starting up.'
106
icon : 'flash'
107
display : 'Starting'
108
to :
109
save : 'saving'
110
timeout : 60
111
commands : ['save', 'copy_path', 'mkdir', 'directory_listing', 'read_file', 'network', 'mintime', 'disk_quota', 'compute_quota', 'status']
112
113
stopping:
114
desc : 'Project is stopping.'
115
icon : 'hand-stop-o'
116
display : 'Stopping'
117
to :
118
save : 'saving'
119
timeout : 60
120
commands : ['save', 'copy_path', 'mkdir', 'directory_listing', 'read_file', 'network', 'mintime', 'disk_quota', 'compute_quota', 'status']
121
122