Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 39537
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
Define upgrades to projects.
24
###
25
26
# NOTE: This script ./upgrade-spec.coffee is copied into the Docker container
27
# in k8s/smc-project/manager/, so if you move or rename this script, you must
28
# also update that.
29
30
upgrades = exports.upgrades = {}
31
32
# these are the base quotas -- keep req_* commented out until they are also in params below.
33
# They are for future use for k8s
34
exports.DEFAULT_QUOTAS =
35
disk_quota : 3000
36
cores : 1
37
cpu_shares : 0
38
memory : 1000
39
memory_request : 0
40
mintime : 1800 # hour
41
network : 0
42
member_host : 0
43
44
upgrades.max_per_project =
45
disk_quota : 50000
46
memory : 8000
47
memory_request : 8000
48
cores : 4
49
network : 1
50
cpu_shares : 2048
51
mintime : 24*3600*90
52
member_host : 1
53
54
# In the params listed below you *MUST* define all of display, display_unit,
55
# display_factor, pricing_unit, pricing_factor, input_type, and desc! This
56
# is assumed elsewhere.
57
upgrades.params =
58
disk_quota :
59
display : 'Disk space'
60
unit : 'MB'
61
display_unit : 'MB'
62
display_factor : 1
63
pricing_unit : 'GB'
64
pricing_factor : 1/1000
65
input_type : 'number'
66
desc : 'The maximum amount of disk space (in MB) that a project may use.'
67
memory :
68
display : 'Shared RAM'
69
unit : 'MB'
70
display_unit : 'MB'
71
display_factor : 1
72
pricing_unit : 'GB'
73
pricing_factor : 1/1000
74
input_type : 'number'
75
desc : 'Upper bound on RAM that all processes in a project may use in total (shared with other projects; not guaranteed).'
76
memory_request :
77
display : 'Dedicated RAM'
78
unit : 'MB'
79
display_unit : 'MB'
80
display_factor : 1
81
pricing_unit : 'GB'
82
pricing_factor : 1/1000
83
input_type : 'number'
84
desc : "Guaranteed minimum amount of RAM that is dedicated to your project."
85
cores :
86
display : 'Shared CPU'
87
unit : 'core'
88
display_unit : 'core'
89
display_factor : 1
90
pricing_unit : 'core'
91
pricing_factor : 1
92
input_type : 'number'
93
desc : 'Upper bound on the number of shared CPU cores that your project may use (shared with other projects; not guaranteed).'
94
cpu_shares :
95
display : 'Dedicated CPU'
96
unit : 'core'
97
display_unit : 'core'
98
display_factor : 1/1024
99
pricing_unit : 'core'
100
pricing_factor : 1/1024
101
input_type : 'number'
102
desc : 'Guaranteed minimum number of CPU cores that are dedicated to your project.'
103
mintime :
104
display : 'Idle timeout'
105
unit : 'second'
106
display_unit : 'hour'
107
display_factor : 1/3600 # multiply internal by this to get what should be displayed
108
pricing_unit : 'day'
109
pricing_factor : 1/86400
110
input_type : 'number'
111
desc : 'If the project is not used for this long, then it will be automatically stopped.'
112
network :
113
display : 'Internet access'
114
unit : 'project'
115
display_unit : 'project'
116
display_factor : 1
117
pricing_unit : 'project'
118
pricing_factor : 1
119
input_type : 'checkbox'
120
desc : 'Full internet access enables a project to connect to the computers outside of CoCalc, download software packages, etc.'
121
member_host :
122
display : 'Member hosting'
123
unit : 'project'
124
display_unit : 'project'
125
display_factor : 1
126
pricing_unit : 'project'
127
pricing_factor : 1
128
input_type : 'checkbox'
129
desc : 'Runs this project on a member-only host that is NOT pre-emptible; it will not be randomly rebooted and has less users.'
130
131
upgrades.field_order = ['member_host', 'network', 'mintime', 'disk_quota',
132
'memory', 'memory_request',
133
'cores', 'cpu_shares']
134
135
# live_subscriptions is an array of arrays. Each array should have length a divisor of 12.
136
# The subscriptions will be displayed one row at a time.
137
upgrades.live_subscriptions = [['standard', 'premium', 'professional'],
138
['small_course', 'medium_course', 'large_course']]
139
140
upgrades.period_names =
141
month : 'month'
142
year : 'year'
143
month4 : '4 months'
144
year1 : 'year'
145
146
# TODO: change from "membership" to "subscription".
147
148
membership = upgrades.membership = {}
149
150
membership.professional = # a user that has a professional membership
151
icon : 'battery-full'
152
price :
153
month : 99
154
year : 999
155
cancel_at_period_end : false
156
benefits :
157
cores : 5
158
cpu_shares : 1024
159
disk_quota : 5000*20
160
member_host : 2*20
161
memory : 3000*20
162
memory_request : 1000*4
163
mintime : 24*3600*20
164
network : 10*20
165
166
membership.premium = # a user that has a premium membership
167
icon : 'battery-three-quarters'
168
price :
169
month : 49
170
year : 499
171
cancel_at_period_end : false
172
benefits :
173
cores : 2
174
cpu_shares : 512
175
disk_quota : 5000*8
176
member_host : 2*8
177
memory : 3000*8
178
memory_request : 1000*2
179
mintime : 24*3600*8
180
network : 10*8
181
182
membership.standard = # a user that has a standard membership
183
icon : 'battery-quarter'
184
price :
185
month : 7
186
year : 79
187
cancel_at_period_end : false
188
benefits :
189
cores : 0
190
cpu_shares : 0
191
disk_quota : 5000
192
member_host : 2
193
memory : 3000
194
memory_request : 0
195
mintime : 24*3600
196
network : 20
197
198
199
membership.large_course =
200
icon : 'battery-full'
201
price :
202
month4 : 999
203
year1 : 2499
204
cancel_at_period_end : true
205
benefits :
206
cores : 0
207
cpu_shares : 0
208
disk_quota : 0
209
memory : 0
210
memory_request : 0
211
member_host : 250
212
network : 250
213
214
membership.medium_course =
215
icon : 'battery-three-quarters'
216
price :
217
month4 : 399
218
year1 : 999
219
cancel_at_period_end : true
220
benefits :
221
cores : 0
222
cpu_shares : 0
223
disk_quota : 0
224
memory : 0
225
memory_request : 0
226
member_host : 70
227
network : 70
228
229
membership.small_course =
230
icon : 'battery-quarter'
231
price :
232
month4 : 199
233
year1 : 499
234
cancel_at_period_end : true
235
benefits :
236
cores : 0
237
cpu_shares : 0
238
disk_quota : 0
239
memory : 0
240
memory_request : 0
241
member_host : 25
242
network : 25
243
244
membership.student_course =
245
icon : 'graduation-cap'
246
price :
247
month4 : 9
248
cancel_at_period_end : true
249
benefits :
250
cores : 0
251
cpu_shares : 0
252
disk_quota : 0
253
memory : 0
254
memory_request : 0
255
member_host : 1
256
network : 1
257
258