Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagecell
Path: blob/master/config_default.py
447 views
1
import os.path
2
3
4
# Location of the Sage executable
5
if 'SAGE_ROOT' in os.environ:
6
# Assume that the worker should run the same Sage
7
# that is used to run the web server
8
sage = os.path.join(os.environ["SAGE_ROOT"], "sage")
9
else:
10
# Assume both the web server and the worker have Sage in their paths
11
sage = "sage"
12
13
# Require the user to accept terms of service before evaluation
14
requires_tos = True
15
16
db = "sqlalchemy"
17
db_config = {"uri": "sqlite:///sqlite.db"}
18
19
# db = "web"
20
# db_config = {"uri": "http://localhost:8889"}
21
22
permalink_server = {
23
'db': 'sqlalchemy',
24
'db_config': {'uri': 'sqlite:///sqlite.db'}
25
}
26
27
pid_file = 'sagecell.pid'
28
permalink_pid_file = 'sagecell_permalink_server.pid'
29
30
dir = "/tmp/sagecell"
31
32
# Parameters for heartbeat channels checking whether a given kernel is alive.
33
# Setting first_beat lower than 1.0 may cause JavaScript errors.
34
beat_interval = 0.5
35
first_beat = 1.0
36
37
# Allowed idling between interactions with a kernel
38
max_timeout = 60 * 15
39
# Even an actively used kernel will be killed after this time
40
max_lifespan = 60 * 30
41
42
# Recommended settings for kernel providers
43
provider_settings = {
44
"max_kernels": 10,
45
"max_preforked": 1,
46
# The keys to resource_limits can be any available resources
47
# for the resource module. See http://docs.python.org/library/resource.html
48
# for more information (section 35.13.1)
49
# RLIMIT_AS is more of a suggestion than a hard limit in Mac OS X
50
# Also, Sage may allocate huge AS, making this limit pointless:
51
# https://groups.google.com/d/topic/sage-devel/1MM7UPcrW18/discussion
52
"preforked_rlimits": {
53
"RLIMIT_CPU": 30, # CPU time in seconds
54
},
55
}
56
57
# Location information for kernel providers
58
provider_info = {
59
"host": "localhost",
60
"username": None,
61
"python": sage + " -python",
62
"location": os.path.dirname(os.path.abspath(__file__))
63
}
64
65
providers = [provider_info]
66
67