IPython Notebook: Fixing coding crimes for section names
[slapos.git] / software / ipython_notebook / instance.cfg
1 [buildout]
2 parts =
3   instance
4   publish-connection-parameter
5 ## Monitoring part XXX whe should not have to specify all parts like this
6 ## Parts to add for monitoring
7   certificate-authority
8   cron
9   cron-entry-monitor
10   cron-entry-rss
11   deploy-index
12   deploy-settings-cgi
13   deploy-status-cgi
14   deploy-status-history-cgi
15   setup-static-files
16   certificate-authority
17   zero-parameters
18   public-symlink
19   cgi-httpd-wrapper
20   cgi-httpd-graceful-wrapper
21   monitor-promise
22   monitor-instance-log-access
23 ## Monitor for ipython
24   monitor-current-log-access
25   monitor-deploy-set-password-cgi
26
27 extends = ${monitor-template:output}
28
29 eggs-directory = ${buildout:eggs-directory}
30 develop-eggs-directory = ${buildout:develop-eggs-directory}
31 offline = true
32
33 [slapconfiguration]
34 recipe = slapos.cookbook:slapconfiguration
35 computer = $${slap_connection:computer_id}
36 partition = $${slap_connection:partition_id}
37 url = $${slap_connection:server_url}
38 key = $${slap_connection:key_file}
39 cert = $${slap_connection:cert_file}
40
41 [instance-parameter]
42 port = 8888
43 host = $${slapconfiguration:ipv6-random}
44 cert_file = $${generate-certificate:cert_file}
45 key_file = $${generate-certificate:key_file}
46 logfile = $${directory:log}/ipython_notebook.log
47 notebook_dir = $${directory:notebook_dir}
48
49 [generate-certificate]
50 ; TODO: there is a slapos recipe to generate certificates. Use it instead
51 recipe = plone.recipe.command
52 command =
53   if [ ! -e $${instance-parameter:key_file} ]
54   then
55     ${openssl-output:openssl} req -x509 -nodes -days 3650 \
56       -subj "/C=AA/ST=X/L=X/O=Dis/CN=$${instance-parameter:host}" \
57       -newkey rsa:1024 -keyout $${instance-parameter:key_file} \
58       -out $${instance-parameter:cert_file}
59   fi
60 update-command = $${:command}
61 cert_file = $${directory:etc}/ipython_notebook_cert.crt
62 key_file = $${directory:etc}/ipython_notebook_cert.key
63
64 [instance]
65 recipe = slapos.cookbook:wrapper
66 command-line =
67   ${buildout:bin-directory}/ipython notebook
68   --no-browser
69   --matplotlib=inline
70   --ip=$${instance-parameter:host}
71   --port=$${instance-parameter:port}
72   --port-retries=0
73   --certfile=$${instance-parameter:cert_file}
74   --keyfile=$${instance-parameter:key_file}
75   --notebook-dir=$${instance-parameter:notebook_dir}
76   --logfile=$${instance-parameter:logfile}
77   --config=$${ipython-notebook-config:rendered}
78 wrapper-path = $${directory:service}/ipython_notebook
79 parameters-extra = true
80
81 [ipython-notebook-config]
82 recipe = slapos.recipe.template:jinja2
83 template = ${ipython-notebook-config:location}/${ipython-notebook-config:filename}
84 rendered = $${directory:etc}/ipython_notebook_config.py
85 mode = 0744
86 context =
87   raw config_cfg $${buildout:directory}/knowledge0.cfg
88
89 [monitor-current-log-access]
90 < = monitor-directory-access
91 source = $${instance-parameter:logfile}
92
93 [monitor-deploy-set-password-cgi]
94 recipe = slapos.recipe.template:jinja2
95 template = ${ipython-notebook-set-password:location}/${ipython-notebook-set-password:filename}
96 rendered = $${monitor-directory:knowledge0-cgi}/$${:filename}
97 filename = ipython-notebook-password.cgi
98 mode = 0744
99 context =
100   raw config_cfg $${buildout:directory}/knowledge0.cfg
101   raw python_executable ${buildout:bin-directory}/ipython
102   key pwd monitor-directory:knowledge0-cgi
103   key this_file :filename
104   key httpd_graceful cgi-httpd-graceful-wrapper:rendered
105
106 [directory]
107 recipe = slapos.cookbook:mkdirectory
108 home = $${buildout:directory}
109 etc = $${:home}/etc
110 var = $${:home}/var
111 script = $${:etc}/run/
112 service = $${:etc}/service
113 promise = $${:etc}/promise/
114 log = $${:var}/log
115 notebook_dir = $${:var}/notebooks
116
117 [publish-connection-parameter]
118 recipe = slapos.cookbook:publish
119 url = https://[$${instance-parameter:host}]:$${instance-parameter:port}
120 monitor_url = $${monitor-parameters:url}