Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos-caddy
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
Guillaume Hervier
slapos-caddy
Commits
6cac7e24
Commit
6cac7e24
authored
Jul 18, 2017
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jupyter: Replace ipython_notebook with jupyter SR
parent
fac20445
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
75 additions
and
89 deletions
+75
-89
software/jupyter/ERP5kernel.py.jinja
software/jupyter/ERP5kernel.py.jinja
+1
-1
software/jupyter/buildout.hash.cfg
software/jupyter/buildout.hash.cfg
+13
-13
software/jupyter/custom.js.jinja
software/jupyter/custom.js.jinja
+2
-2
software/jupyter/instance.cfg.in
software/jupyter/instance.cfg.in
+23
-24
software/jupyter/jupyter_notebook_config.py.jinja
software/jupyter/jupyter_notebook_config.py.jinja
+7
-7
software/jupyter/jupyter_set_password.cgi.jinja
software/jupyter/jupyter_set_password.cgi.jinja
+7
-7
software/jupyter/kernel.json.jinja
software/jupyter/kernel.json.jinja
+0
-0
software/jupyter/software.cfg
software/jupyter/software.cfg
+22
-35
No files found.
software/
ipython_notebook/template
/ERP5kernel.py.jinja
→
software/
jupyter
/ERP5kernel.py.jinja
View file @
6cac7e24
...
...
@@ -61,7 +61,7 @@ class ERP5Kernel(Kernel):
language = 'ERP5'
language_version = '0.1'
language_info = {'mimetype': 'text/plain', 'name':'python'}
banner = "ERP5 integration with
ipython
notebook"
banner = "ERP5 integration with
jupyter
notebook"
def __init__(self, user=None, password=None, url=None, status_code=None,
*args, **kwargs):
...
...
software/
ipython_notebook
/buildout.hash.cfg
→
software/
jupyter
/buildout.hash.cfg
View file @
6cac7e24
...
...
@@ -14,26 +14,26 @@
# section inheritance (< = ...) are NOT supported (but you should really
# not need these here).
[instance-jupyter]
[instance-jupyter
-notebook
]
filename = instance.cfg.in
md5sum =
2c0ecc6f045504cb037709429132e08c
md5sum =
f0abfc788f6a83773d07dd37f9728db0
[
ipython
-notebook-config]
filename =
template/ipython
_notebook_config.py.jinja
md5sum =
95a76a80718e2a933dd4854dcf9a4a65
[
jupyter
-notebook-config]
filename =
jupyter
_notebook_config.py.jinja
md5sum =
720e90a829c63371696bc3009917a743
[
ipython-notebook
-set-password]
filename =
template/ipython
_set_password.cgi.jinja
md5sum =
d7d4a7e19d55bf14007819258bf42100
[
jupyter
-set-password]
filename =
jupyter
_set_password.cgi.jinja
md5sum =
b8d31441780b524a7e52d1710dd78385
[erp5-kernel]
filename =
template/
ERP5kernel.py.jinja
md5sum =
f7be6c3ef9cdfaaea3b8756895a22081
filename = ERP5kernel.py.jinja
md5sum =
8bd16cc9f35b00172e8266f1cde5956f
[kernel-json]
filename =
template/
kernel.json.jinja
filename = kernel.json.jinja
md5sum = ab6e78ea20855e07d388b5b86d1770fe
[custom-js]
filename =
template/
custom.js.jinja
md5sum =
584aa839aa20263ba885537b74c83abd
filename = custom.js.jinja
md5sum =
0bf9e2eb1718b14307265fe05a167018
software/
ipython_notebook/template
/custom.js.jinja
→
software/
jupyter
/custom.js.jinja
View file @
6cac7e24
...
...
@@ -81,8 +81,8 @@
* @static
*/
$([
IPython
.events]).on('notebook_loaded.Notebook', function(){
var kernelname =
IPython
.notebook.kernel_selector.current_selection;
$([
jupyter
.events]).on('notebook_loaded.Notebook', function(){
var kernelname =
jupyter
.notebook.kernel_selector.current_selection;
var display_text="<div class='output_subarea output_text output_result'>\
<pre>Follow these steps to customize your notebook with ERP5 kernel :-</br>\
1. Make sure you have 'erp5_data_notebook' business template installed in your ERP5</br>\
...
...
software/
ipython_notebook
/instance.cfg.in
→
software/
jupyter
/instance.cfg.in
View file @
6cac7e24
[buildout]
parts =
instance
ipython
_notebook
jupyter
_notebook
read-knowledge0
publish-connection-parameter
jupyter-notebook-config
erp5-kernel
kernel-json
custom-js
...
...
@@ -33,7 +34,7 @@ port = 8888
host = ${slapconfiguration:ipv6-random}
cert_file = ${generate-certificate:cert_file}
key_file = ${generate-certificate:key_file}
logfile = ${directory:log}/
ipython
_notebook.log
logfile = ${directory:log}/
jupyter
_notebook.log
notebook_dir = ${directory:notebook_dir}
[dynamic-jinja2-template-base]
...
...
@@ -52,13 +53,13 @@ command =
-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
cert_file = ${directory:etc}/
jupyter
_cert.crt
key_file = ${directory:etc}/
jupyter
_cert.key
[instance]
recipe = slapos.cookbook:wrapper
command-line =
{{ bin_directory }}/
ipython
notebook
{{ bin_directory }}/
jupyter-
notebook
--no-browser
--ip=${instance-parameter:host}
--port=${instance-parameter:port}
...
...
@@ -66,24 +67,19 @@ command-line =
--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}
# Add 'log-level' alias to 'DEBUG' so as to log requests being done while running
# of service ipython_notebook.
--log-level="DEBUG"
wrapper-path = ${directory:service}/
ipython_
notebook
wrapper-path = ${directory:service}/
jupyter-
notebook
parameters-extra = true
# Explicitly define IPython Directory to be used while starting ipython notebook
# Also explicitly force IPython to use en_US.utf8 encoding
environment =
IPYTHONDIR=${directory:ipython_dir}
JUPYTER_CONFIG_DIR=${directory:ipython_dir}
JUPYTER_PATH=${directory:jupyter_dir}
JUPYTER_CONFIG_DIR=${directory:jupyter_config_dir}
JUPYTER_RUNTIME_DIR=${directory:jupyter_runtime_dir}
LANG=C.UTF-8
[
ipython
-notebook-config]
[
jupyter
-notebook-config]
<= dynamic-jinja2-template-base
template = {{
ipython_notebook_config_location }}/{{ ipython_notebook
_config_filename }}
rendered = ${directory:
etc}/ipython
_notebook_config.py
template = {{
jupyter_config_location }}/{{ jupyter
_config_filename }}
rendered = ${directory:
jupyter_config_dir}/jupyter
_notebook_config.py
mode = 0744
context =
raw config_cfg ${buildout:directory}/knowledge0.cfg
...
...
@@ -98,12 +94,15 @@ service = ${:etc}/service
promise = ${:etc}/promise/
log = ${:var}/log
notebook_dir = ${:var}/notebooks
# Add folders to explicitly define ipython directory
ipython_dir = ${:home}/ipython
ipython_kernel_dir = ${:ipython_dir}/kernels
erp5_kernel_dir = ${:ipython_kernel_dir}/ERP5
[ipython_notebook]
# Add folders to explicitly define jupyter directory
jupyter_dir = ${:home}/jupyter
jupyter_config_dir = ${:jupyter_dir}/etc
jupyter_kernel_dir = ${:jupyter_dir}/kernels
jupyter_runtime_dir = ${:jupyter_dir}/runtime
jupyter_custom_dir = ${:jupyter_config_dir}/custom
erp5_kernel_dir = ${:jupyter_kernel_dir}/ERP5
[jupyter_notebook]
# This part is called like this because knowledge0.write uses the part name for
# the section name in the config file.
recipe = slapos.cookbook:zero-knowledge.write
...
...
@@ -151,6 +150,6 @@ context =
[custom-js]
<= dynamic-jinja2-template-base
template = {{ custom_js_location }}/{{ custom_js_filename }}
rendered = ${directory:
ipython_dir}/profile_default/static/custom
/custom.js
rendered = ${directory:
jupyter_custom_dir}
/custom.js
mode = 0744
software/
ipython_notebook/template/ipython
_notebook_config.py.jinja
→
software/
jupyter/jupyter
_notebook_config.py.jinja
View file @
6cac7e24
...
...
@@ -25,14 +25,14 @@ c = get_config()
parser = ConfigParser.ConfigParser()
parser.read(knowledge_0)
if not parser.has_section("
ipython
_notebook"):
parser.add_section("
ipython
_notebook")
if not parser.has_section("
jupyter
_notebook"):
parser.add_section("
jupyter
_notebook")
if not parser.has_option("
ipython
_notebook", "password") or \
parser.get("
ipython
_notebook", "password") == "":
parser.set("
ipython
_notebook", "password", random_password())
if not parser.has_option("
jupyter
_notebook", "password") or \
parser.get("
jupyter
_notebook", "password") == "":
parser.set("
jupyter
_notebook", "password", random_password())
c.NotebookApp.password = passwd(parser.get("
ipython
_notebook", "password"))
c.NotebookApp.password = passwd(parser.get("
jupyter
_notebook", "password"))
with open(knowledge_0, 'w') as file:
parser.write(file)
software/
ipython_notebook/template/ipython
_set_password.cgi.jinja
→
software/
jupyter/jupyter
_set_password.cgi.jinja
View file @
6cac7e24
...
...
@@ -24,16 +24,16 @@ if not os.path.exists(config_file):
parser = ConfigParser.ConfigParser()
parser.read(config_file)
if not parser.has_section("
ipython
_notebook"):
parser.add_section("
ipython
_notebook")
if not parser.has_section("
jupyter
_notebook"):
parser.add_section("
jupyter
_notebook")
if not parser.has_option("
ipython
_notebook", "password"):
parser.set("
ipython
_notebook", "password", "")
if not parser.has_option("
jupyter
_notebook", "password"):
parser.set("
jupyter
_notebook", "password", "")
if "password" in form:
parser.set("
ipython
_notebook", "password", passwd(form["password"].value))
parser.set("
jupyter
_notebook", "password", passwd(form["password"].value))
# subprocess.call('{{ httpd_graceful }}')
# TODO: we should restart
ipython
# TODO: we should restart
jupyter
with open(config_file, 'w') as file:
parser.write(file)
...
...
@@ -43,7 +43,7 @@ print "<html><head>"
print "
<link
rel=
\"stylesheet\"
href=
\"static/pure-min.css\"
>
"
print "
<link
rel=
\"stylesheet\"
href=
\"static/style.css\"
>
"
print "
</head><body>
"
print "
<h1>
IPython
Notebook Password :
</h1>
"
print "
<h1>
Jupyter
Notebook Password :
</h1>
"
print "
<form
action=
\"/index.cgi\"
method=
\"post\"
class=
\"pure-form-aligned\"
>
"
print "
<input
type=
\"hidden\"
name=
\"posting-script\"
value=
\"{{
pwd
}}/{{
this_file
}}\"
>
"
...
...
software/
ipython_notebook/template
/kernel.json.jinja
→
software/
jupyter
/kernel.json.jinja
View file @
6cac7e24
File moved
software/
ipython_notebook
/software.cfg
→
software/
jupyter
/software.cfg
View file @
6cac7e24
...
...
@@ -3,59 +3,39 @@ versions = versions
extends =
buildout.hash.cfg
../../stack/slapos.cfg
../../component/ipython/buildout.cfg
../../component/scipy/buildout.cfg
../../component/scikit-learn/buildout.cfg
../../component/pandas/buildout.cfg
../../component/openssl/buildout.cfg
../../component/
seaborn
/buildout.cfg
../../component/
jupyter
/buildout.cfg
../../stack/monitor/buildout.cfg
parts =
slapos-cookbook
ipython-notebook
instance-jupyter
[ipython-notebook]
; In the ipython notebook software, we use more eggs than in the minimal
; ipython notebook component
eggs +=
requests
astor
${scipy:egg}
${pandas:egg}
${scikit-learn:egg}
${seaborn:egg}
${statsmodels:egg}
patsy
jupyter
instance-jupyter-notebook
[jupyter]
python_executable = ${buildout:bin-directory}/${:interpreter}
[download-file-base]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/
template/
${:filename}
url = ${:_profile_base_location_}/${:filename}
download-only = true
mode = 0644
[
ipython
-notebook-config]
[
jupyter
-notebook-config]
<= download-file-base
filename = ipython_notebook_config.py.jinja
[
ipython-notebook
-set-password]
[
jupyter
-set-password]
<= download-file-base
filename = ipython_set_password.cgi.jinja
[erp5-kernel]
<= download-file-base
filename = ERP5kernel.py.jinja
[kernel-json]
<= download-file-base
filename = kernel.json.jinja
[custom-js]
<= download-file-base
filename = custom.js.jinja
[instance-jupyter]
[instance-jupyter
-notebook
]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/template.cfg
...
...
@@ -65,11 +45,11 @@ context =
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key openssl_output openssl-output:openssl
key python_executable
python2.7:
executable
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
key python_executable
jupyter:python_
executable
key
jupyter_config_location jupyter
-notebook-config:location
key
jupyter_config_filename jupyter
-notebook-config:filename
key
jupyter_set_password_location jupyter
-set-password:location
key
jupyter_set_password_filename jupyter
-set-password:filename
key erp5_kernel_location erp5-kernel:location
key erp5_kernel_filename erp5-kernel:filename
key kernel_json_location kernel-json:location
...
...
@@ -162,3 +142,10 @@ subprocess32 = 3.2.7
# Required by:
# prompt-toolkit==1.0.13
wcwidth = 0.1.7
jupyter = 1.0.0
jupyter-console = 5.1.0
# Required by:
# jupyter==1.0.0
qtconsole = 4.3.0
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