generated from 2i2c-org/hub-user-image-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jupyter_server_config_extra_tmpl.py
40 lines (36 loc) · 1.29 KB
/
jupyter_server_config_extra_tmpl.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import os
from pathlib import Path
import hubbleds
import logging
logging.getLogger('tornado.access').disabled = True
NB_PATH = Path(hubbleds.__file__).parent / "HubbleDS.ipynb"
SERVICE_PREFIX = os.environ["JUPYTERHUB_SERVICE_PREFIX"]
CDS_API_KEY = "${CDS_API_KEY}"
c.ServerProxy.servers = {
"hubble": {
"command": [
"voila",
f"{NB_PATH.resolve()}",
"--port={port}",
"--no-browser",
"--Voila.base_url={base_url}hubble/",
"--Voila.server_url=/",
"--Voila.tornado_settings={{'allow_origin': '*'}}",
"--VoilaConfiguration.template=cosmicds-default",
"--VoilaConfiguration.theme=dark",
# "--VoilaConfiguration.enable_nbextensions=true",
"--VoilaConfiguration.file_allowlist=['.*']",
"--VoilaConfiguration.show_tracebacks=true",
# "--VoilaConfiguration.http_keep_alive_timeout=5",
# "--MappingKernelManager.cull_interval=240",
# "--MappingKernelManager.cull_idle_timeout=600",
# "--ExecutePreprocessor.timeout=300"
],
"absolute_url": False,
"launcher_entry": {"title": "Hubble Data Story"},
"timeout": 30,
"environment": {
"CDS_API_KEY": CDS_API_KEY
}
},
}