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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HongzheWang
slapos
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):
...
@@ -61,7 +61,7 @@ class ERP5Kernel(Kernel):
language = 'ERP5'
language = 'ERP5'
language_version = '0.1'
language_version = '0.1'
language_info = {'mimetype': 'text/plain', 'name':'python'}
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,
def __init__(self, user=None, password=None, url=None, status_code=None,
*args, **kwargs):
*args, **kwargs):
...
...
software/
ipython_notebook
/buildout.hash.cfg
→
software/
jupyter
/buildout.hash.cfg
View file @
6cac7e24
...
@@ -14,26 +14,26 @@
...
@@ -14,26 +14,26 @@
# section inheritance (< = ...) are NOT supported (but you should really
# section inheritance (< = ...) are NOT supported (but you should really
# not need these here).
# not need these here).
[instance-jupyter]
[instance-jupyter
-notebook
]
filename = instance.cfg.in
filename = instance.cfg.in
md5sum =
2c0ecc6f045504cb037709429132e08c
md5sum =
f0abfc788f6a83773d07dd37f9728db0
[
ipython
-notebook-config]
[
jupyter
-notebook-config]
filename =
template/ipython
_notebook_config.py.jinja
filename =
jupyter
_notebook_config.py.jinja
md5sum =
95a76a80718e2a933dd4854dcf9a4a65
md5sum =
720e90a829c63371696bc3009917a743
[
ipython-notebook
-set-password]
[
jupyter
-set-password]
filename =
template/ipython
_set_password.cgi.jinja
filename =
jupyter
_set_password.cgi.jinja
md5sum =
d7d4a7e19d55bf14007819258bf42100
md5sum =
b8d31441780b524a7e52d1710dd78385
[erp5-kernel]
[erp5-kernel]
filename =
template/
ERP5kernel.py.jinja
filename = ERP5kernel.py.jinja
md5sum =
f7be6c3ef9cdfaaea3b8756895a22081
md5sum =
8bd16cc9f35b00172e8266f1cde5956f
[kernel-json]
[kernel-json]
filename =
template/
kernel.json.jinja
filename = kernel.json.jinja
md5sum = ab6e78ea20855e07d388b5b86d1770fe
md5sum = ab6e78ea20855e07d388b5b86d1770fe
[custom-js]
[custom-js]
filename =
template/
custom.js.jinja
filename = custom.js.jinja
md5sum =
584aa839aa20263ba885537b74c83abd
md5sum =
0bf9e2eb1718b14307265fe05a167018
software/
ipython_notebook/template
/custom.js.jinja
→
software/
jupyter
/custom.js.jinja
View file @
6cac7e24
...
@@ -81,8 +81,8 @@
...
@@ -81,8 +81,8 @@
* @static
* @static
*/
*/
$([
IPython
.events]).on('notebook_loaded.Notebook', function(){
$([
jupyter
.events]).on('notebook_loaded.Notebook', function(){
var kernelname =
IPython
.notebook.kernel_selector.current_selection;
var kernelname =
jupyter
.notebook.kernel_selector.current_selection;
var display_text="<div class='output_subarea output_text output_result'>\
var display_text="<div class='output_subarea output_text output_result'>\
<pre>Follow these steps to customize your notebook with ERP5 kernel :-</br>\
<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>\
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]
[buildout]
parts =
parts =
instance
instance
ipython
_notebook
jupyter
_notebook
read-knowledge0
read-knowledge0
publish-connection-parameter
publish-connection-parameter
jupyter-notebook-config
erp5-kernel
erp5-kernel
kernel-json
kernel-json
custom-js
custom-js
...
@@ -33,7 +34,7 @@ port = 8888
...
@@ -33,7 +34,7 @@ port = 8888
host = ${slapconfiguration:ipv6-random}
host = ${slapconfiguration:ipv6-random}
cert_file = ${generate-certificate:cert_file}
cert_file = ${generate-certificate:cert_file}
key_file = ${generate-certificate:key_file}
key_file = ${generate-certificate:key_file}
logfile = ${directory:log}/
ipython
_notebook.log
logfile = ${directory:log}/
jupyter
_notebook.log
notebook_dir = ${directory:notebook_dir}
notebook_dir = ${directory:notebook_dir}
[dynamic-jinja2-template-base]
[dynamic-jinja2-template-base]
...
@@ -52,13 +53,13 @@ command =
...
@@ -52,13 +53,13 @@ command =
-out ${instance-parameter:cert_file}
-out ${instance-parameter:cert_file}
fi
fi
update-command = ${:command}
update-command = ${:command}
cert_file = ${directory:etc}/
ipython_notebook
_cert.crt
cert_file = ${directory:etc}/
jupyter
_cert.crt
key_file = ${directory:etc}/
ipython_notebook
_cert.key
key_file = ${directory:etc}/
jupyter
_cert.key
[instance]
[instance]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
command-line =
command-line =
{{ bin_directory }}/
ipython
notebook
{{ bin_directory }}/
jupyter-
notebook
--no-browser
--no-browser
--ip=${instance-parameter:host}
--ip=${instance-parameter:host}
--port=${instance-parameter:port}
--port=${instance-parameter:port}
...
@@ -66,24 +67,19 @@ command-line =
...
@@ -66,24 +67,19 @@ command-line =
--certfile=${instance-parameter:cert_file}
--certfile=${instance-parameter:cert_file}
--keyfile=${instance-parameter:key_file}
--keyfile=${instance-parameter:key_file}
--notebook-dir=${instance-parameter:notebook_dir}
--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"
--log-level="DEBUG"
wrapper-path = ${directory:service}/
ipython_
notebook
wrapper-path = ${directory:service}/
jupyter-
notebook
parameters-extra = true
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 =
environment =
IPYTHONDIR=${directory:ipython_dir}
JUPYTER_PATH=${directory:jupyter_dir}
JUPYTER_CONFIG_DIR=${directory:ipython_dir}
JUPYTER_CONFIG_DIR=${directory:jupyter_config_dir}
JUPYTER_RUNTIME_DIR=${directory:jupyter_runtime_dir}
LANG=C.UTF-8
LANG=C.UTF-8
[
ipython
-notebook-config]
[
jupyter
-notebook-config]
<= dynamic-jinja2-template-base
<= dynamic-jinja2-template-base
template = {{
ipython_notebook_config_location }}/{{ ipython_notebook
_config_filename }}
template = {{
jupyter_config_location }}/{{ jupyter
_config_filename }}
rendered = ${directory:
etc}/ipython
_notebook_config.py
rendered = ${directory:
jupyter_config_dir}/jupyter
_notebook_config.py
mode = 0744
mode = 0744
context =
context =
raw config_cfg ${buildout:directory}/knowledge0.cfg
raw config_cfg ${buildout:directory}/knowledge0.cfg
...
@@ -98,12 +94,15 @@ service = ${:etc}/service
...
@@ -98,12 +94,15 @@ service = ${:etc}/service
promise = ${:etc}/promise/
promise = ${:etc}/promise/
log = ${:var}/log
log = ${:var}/log
notebook_dir = ${:var}/notebooks
notebook_dir = ${:var}/notebooks
# Add folders to explicitly define ipython directory
# Add folders to explicitly define jupyter directory
ipython_dir = ${:home}/ipython
jupyter_dir = ${:home}/jupyter
ipython_kernel_dir = ${:ipython_dir}/kernels
jupyter_config_dir = ${:jupyter_dir}/etc
erp5_kernel_dir = ${:ipython_kernel_dir}/ERP5
jupyter_kernel_dir = ${:jupyter_dir}/kernels
jupyter_runtime_dir = ${:jupyter_dir}/runtime
[ipython_notebook]
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
# This part is called like this because knowledge0.write uses the part name for
# the section name in the config file.
# the section name in the config file.
recipe = slapos.cookbook:zero-knowledge.write
recipe = slapos.cookbook:zero-knowledge.write
...
@@ -151,6 +150,6 @@ context =
...
@@ -151,6 +150,6 @@ context =
[custom-js]
[custom-js]
<= dynamic-jinja2-template-base
<= dynamic-jinja2-template-base
template = {{ custom_js_location }}/{{ custom_js_filename }}
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
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()
...
@@ -25,14 +25,14 @@ c = get_config()
parser = ConfigParser.ConfigParser()
parser = ConfigParser.ConfigParser()
parser.read(knowledge_0)
parser.read(knowledge_0)
if not parser.has_section("
ipython
_notebook"):
if not parser.has_section("
jupyter
_notebook"):
parser.add_section("
ipython
_notebook")
parser.add_section("
jupyter
_notebook")
if not parser.has_option("
ipython
_notebook", "password") or \
if not parser.has_option("
jupyter
_notebook", "password") or \
parser.get("
ipython
_notebook", "password") == "":
parser.get("
jupyter
_notebook", "password") == "":
parser.set("
ipython
_notebook", "password", random_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:
with open(knowledge_0, 'w') as file:
parser.write(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):
...
@@ -24,16 +24,16 @@ if not os.path.exists(config_file):
parser = ConfigParser.ConfigParser()
parser = ConfigParser.ConfigParser()
parser.read(config_file)
parser.read(config_file)
if not parser.has_section("
ipython
_notebook"):
if not parser.has_section("
jupyter
_notebook"):
parser.add_section("
ipython
_notebook")
parser.add_section("
jupyter
_notebook")
if not parser.has_option("
ipython
_notebook", "password"):
if not parser.has_option("
jupyter
_notebook", "password"):
parser.set("
ipython
_notebook", "password", "")
parser.set("
jupyter
_notebook", "password", "")
if "password" in form:
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 }}')
# subprocess.call('{{ httpd_graceful }}')
# TODO: we should restart
ipython
# TODO: we should restart
jupyter
with open(config_file, 'w') as file:
with open(config_file, 'w') as file:
parser.write(file)
parser.write(file)
...
@@ -43,7 +43,7 @@ print "<html><head>"
...
@@ -43,7 +43,7 @@ print "<html><head>"
print "
<link
rel=
\"stylesheet\"
href=
\"static/pure-min.css\"
>
"
print "
<link
rel=
\"stylesheet\"
href=
\"static/pure-min.css\"
>
"
print "
<link
rel=
\"stylesheet\"
href=
\"static/style.css\"
>
"
print "
<link
rel=
\"stylesheet\"
href=
\"static/style.css\"
>
"
print "
</head><body>
"
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 "
<form
action=
\"/index.cgi\"
method=
\"post\"
class=
\"pure-form-aligned\"
>
"
print "
<input
type=
\"hidden\"
name=
\"posting-script\"
value=
\"{{
pwd
}}/{{
this_file
}}\"
>
"
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
...
@@ -3,59 +3,39 @@ versions = versions
extends =
extends =
buildout.hash.cfg
buildout.hash.cfg
../../stack/slapos.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/openssl/buildout.cfg
../../component/
seaborn
/buildout.cfg
../../component/
jupyter
/buildout.cfg
../../stack/monitor/buildout.cfg
../../stack/monitor/buildout.cfg
parts =
parts =
slapos-cookbook
slapos-cookbook
ipython-notebook
jupyter
instance-jupyter
instance-jupyter-notebook
[ipython-notebook]
[jupyter]
; In the ipython notebook software, we use more eggs than in the minimal
python_executable = ${buildout:bin-directory}/${:interpreter}
; ipython notebook component
eggs +=
requests
astor
${scipy:egg}
${pandas:egg}
${scikit-learn:egg}
${seaborn:egg}
${statsmodels:egg}
patsy
[download-file-base]
[download-file-base]
recipe = slapos.recipe.build:download
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/
template/
${:filename}
url = ${:_profile_base_location_}/${:filename}
download-only = true
download-only = true
mode = 0644
mode = 0644
[
ipython
-notebook-config]
[
jupyter
-notebook-config]
<= download-file-base
<= download-file-base
filename = ipython_notebook_config.py.jinja
[
ipython-notebook
-set-password]
[
jupyter
-set-password]
<= download-file-base
<= download-file-base
filename = ipython_set_password.cgi.jinja
[erp5-kernel]
[erp5-kernel]
<= download-file-base
<= download-file-base
filename = ERP5kernel.py.jinja
[kernel-json]
[kernel-json]
<= download-file-base
<= download-file-base
filename = kernel.json.jinja
[custom-js]
[custom-js]
<= download-file-base
<= download-file-base
filename = custom.js.jinja
[instance-jupyter]
[instance-jupyter
-notebook
]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/template.cfg
rendered = ${buildout:directory}/template.cfg
...
@@ -65,11 +45,11 @@ context =
...
@@ -65,11 +45,11 @@ context =
key develop_eggs_directory buildout:develop-eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key eggs_directory buildout:eggs-directory
key openssl_output openssl-output:openssl
key openssl_output openssl-output:openssl
key python_executable
python2.7:
executable
key python_executable
jupyter:python_
executable
key
ipython_notebook_config_location ipython
-notebook-config:location
key
jupyter_config_location jupyter
-notebook-config:location
key
ipython_notebook_config_filename ipython
-notebook-config:filename
key
jupyter_config_filename jupyter
-notebook-config:filename
key
ipython_notebook_set_password_location ipython-notebook
-set-password:location
key
jupyter_set_password_location jupyter
-set-password:location
key
ipython_notebook_set_password_filename ipython-notebook
-set-password:filename
key
jupyter_set_password_filename jupyter
-set-password:filename
key erp5_kernel_location erp5-kernel:location
key erp5_kernel_location erp5-kernel:location
key erp5_kernel_filename erp5-kernel:filename
key erp5_kernel_filename erp5-kernel:filename
key kernel_json_location kernel-json:location
key kernel_json_location kernel-json:location
...
@@ -162,3 +142,10 @@ subprocess32 = 3.2.7
...
@@ -162,3 +142,10 @@ subprocess32 = 3.2.7
# Required by:
# Required by:
# prompt-toolkit==1.0.13
# prompt-toolkit==1.0.13
wcwidth = 0.1.7
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