Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Yusei Tahara
slapos
Commits
bb1b8844
Commit
bb1b8844
authored
Dec 03, 2015
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPython Notebook: Convert instance to jinja2 template
parent
17709531
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
135 additions
and
7 deletions
+135
-7
software/ipython_notebook/instance.cfg.in
software/ipython_notebook/instance.cfg.in
+120
-0
software/ipython_notebook/software.cfg
software/ipython_notebook/software.cfg
+15
-7
No files found.
software/ipython_notebook/instance.cfg
→
software/ipython_notebook/instance.cfg
.in
View file @
bb1b8844
...
...
@@ -24,97 +24,97 @@ parts =
monitor-current-log-access
monitor-deploy-set-password-cgi
extends =
${monitor-template:output
}
extends =
{{ monitor_template }
}
eggs-directory =
${buildout:eggs-directory
}
develop-eggs-directory =
${buildout:develop-eggs-directory
}
eggs-directory =
{{ eggs_directory }
}
develop-eggs-directory =
{{ develop_eggs_directory }
}
offline = true
[slapconfiguration]
recipe = slapos.cookbook:slapconfiguration
computer = $
${slap_connection:computer_
id}
partition = $
${slap_connection:partition_
id}
url = $
${slap_connection:server_
url}
key = $
${slap_connection:key_
file}
cert = $
${slap_connection:cert_
file}
computer = $
{slap-connection:computer-
id}
partition = $
{slap-connection:partition-
id}
url = $
{slap-connection:server-
url}
key = $
{slap-connection:key-
file}
cert = $
{slap-connection:cert-
file}
[instance-parameter]
port = 8888
host = $
$
{slapconfiguration:ipv6-random}
cert_file = $
$
{generate-certificate:cert_file}
key_file = $
$
{generate-certificate:key_file}
logfile = $
$
{directory:log}/ipython_notebook.log
notebook_dir = $
$
{directory:notebook_dir}
host = ${slapconfiguration:ipv6-random}
cert_file = ${generate-certificate:cert_file}
key_file = ${generate-certificate:key_file}
logfile = ${directory:log}/ipython_notebook.log
notebook_dir = ${directory:notebook_dir}
[generate-certificate]
; TODO: there is a slapos recipe to generate certificates. Use it instead
recipe = plone.recipe.command
command =
if [ ! -e $
$
{instance-parameter:key_file} ]
if [ ! -e ${instance-parameter:key_file} ]
then
${openssl-output:openssl
} req -x509 -nodes -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=$
$
{instance-parameter:host}" \
-newkey rsa:1024 -keyout $
$
{instance-parameter:key_file} \
-out $
$
{instance-parameter:cert_file}
{{ openssl_output }
} req -x509 -nodes -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=${instance-parameter:host}" \
-newkey rsa:1024 -keyout ${instance-parameter:key_file} \
-out ${instance-parameter:cert_file}
fi
update-command = $
$
{:command}
cert_file = $
$
{directory:etc}/ipython_notebook_cert.crt
key_file = $
$
{directory:etc}/ipython_notebook_cert.key
update-command = ${:command}
cert_file = ${directory:etc}/ipython_notebook_cert.crt
key_file = ${directory:etc}/ipython_notebook_cert.key
[instance]
recipe = slapos.cookbook:wrapper
command-line =
${buildout:bin-directory
}/ipython notebook
{{ bin_directory }
}/ipython notebook
--no-browser
--matplotlib=inline
--ip=$
$
{instance-parameter:host}
--port=$
$
{instance-parameter:port}
--ip=${instance-parameter:host}
--port=${instance-parameter:port}
--port-retries=0
--certfile=$
$
{instance-parameter:cert_file}
--keyfile=$
$
{instance-parameter:key_file}
--notebook-dir=$
$
{instance-parameter:notebook_dir}
--logfile=$
$
{instance-parameter:logfile}
--config=$
$
{ipython-notebook-config:rendered}
wrapper-path = $
$
{directory:service}/ipython_notebook
--certfile=${instance-parameter:cert_file}
--keyfile=${instance-parameter:key_file}
--notebook-dir=${instance-parameter:notebook_dir}
--logfile=${instance-parameter:logfile}
--config=${ipython-notebook-config:rendered}
wrapper-path = ${directory:service}/ipython_notebook
parameters-extra = true
[ipython-notebook-config]
recipe = slapos.recipe.template:jinja2
template =
${ipython-notebook-config:location}/${ipython-notebook-config:filename
}
rendered = $
$
{directory:etc}/ipython_notebook_config.py
template =
{{ ipython_notebook_config_location }}/{{ ipython_notebook_config_filename }
}
rendered = ${directory:etc}/ipython_notebook_config.py
mode = 0744
context =
raw config_cfg $
$
{buildout:directory}/knowledge0.cfg
raw config_cfg ${buildout:directory}/knowledge0.cfg
[monitor-current-log-access]
< = monitor-directory-access
source = $
$
{instance-parameter:logfile}
source = ${instance-parameter:logfile}
[monitor-deploy-set-password-cgi]
recipe = slapos.recipe.template:jinja2
template =
${ipython-notebook-set-password:location}/${ipython-notebook-set-password:filename
}
rendered = $
${monitor-directory:knowledge0-cgi}/$
${:filename}
template =
{{ ipython_notebook_set_password_location }}/{{ ipython_notebook_set_password_filename }
}
rendered = $
{monitor-directory:knowledge0-cgi}/
${:filename}
filename = ipython-notebook-password.cgi
mode = 0744
context =
raw config_cfg $
$
{buildout:directory}/knowledge0.cfg
raw python_executable
${buildout:bin-directory
}/ipython
raw config_cfg ${buildout:directory}/knowledge0.cfg
raw python_executable
{{ bin_directory }
}/ipython
key pwd monitor-directory:knowledge0-cgi
key this_file :filename
key httpd_graceful cgi-httpd-graceful-wrapper:rendered
[directory]
recipe = slapos.cookbook:mkdirectory
home = $
$
{buildout:directory}
etc = $
$
{:home}/etc
var = $
$
{:home}/var
script = $
$
{:etc}/run/
service = $
$
{:etc}/service
promise = $
$
{:etc}/promise/
log = $
$
{:var}/log
notebook_dir = $
$
{:var}/notebooks
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
script = ${:etc}/run/
service = ${:etc}/service
promise = ${:etc}/promise/
log = ${:var}/log
notebook_dir = ${:var}/notebooks
[publish-connection-parameter]
recipe = slapos.cookbook:publish
url = https://[$
${instance-parameter:host}]:$
${instance-parameter:port}
monitor_url = $
$
{monitor-parameters:url}
url = https://[$
{instance-parameter:host}]:
${instance-parameter:port}
monitor_url = ${monitor-parameters:url}
software/ipython_notebook/software.cfg
View file @
bb1b8844
...
...
@@ -12,7 +12,6 @@ parts =
monitor-eggs
slapos-cookbook
ipython-notebook
ipython-notebook-set-password
instance
[ipython-notebook]
...
...
@@ -42,12 +41,21 @@ filename = ipython_set_password.cgi.jinja
mode = 0644
[instance]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/instance.cfg
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.in
rendered = ${buildout:directory}/template.cfg
mode = 0644
md5sum = 99100ff6c317f1c4c50be4d0d8be2e31
context =
key bin_directory buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key monitor_template monitor-template:output
key openssl_output openssl-output:openssl
key ipython_notebook_config_location ipython-notebook-config:location
key ipython_notebook_config_filename ipython-notebook-config:filename
key ipython_notebook_set_password_location ipython-notebook-set-password:location
key ipython_notebook_set_password_filename ipython-notebook-set-password:filename
[versions]
PyRSS2Gen = 1.1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment