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
Paul Graydon
slapos
Commits
b078e528
Commit
b078e528
authored
Jun 03, 2015
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial *buildout for ipython notebook with ERP5 kernel.
parent
320c474d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
102 additions
and
3 deletions
+102
-3
software/helloworld/instance.cfg.in
software/helloworld/instance.cfg.in
+3
-1
software/ipython_notebook/instance.cfg
software/ipython_notebook/instance.cfg
+25
-0
software/ipython_notebook/software.cfg
software/ipython_notebook/software.cfg
+17
-2
software/ipython_notebook/template/ERP5kernel.py.jinja
software/ipython_notebook/template/ERP5kernel.py.jinja
+40
-0
software/ipython_notebook/template/ipython_notebook_config.jinja
...e/ipython_notebook/template/ipython_notebook_config.jinja
+6
-0
software/ipython_notebook/template/kernel.json.jinja
software/ipython_notebook/template/kernel.json.jinja
+11
-0
No files found.
software/helloworld/instance.cfg.in
View file @
b078e528
...
...
@@ -58,6 +58,8 @@ service = $${:etc}/service
promise = $${:etc}/promise/
# Path of the log directory used by our service (see [hello-world])
log = $${:var}/log
# Path of IPython directory in which ERP5 kernel will be running
ipython-directory = $${:home}/.ipython/kernels
# Create a simple web server that says "hello <configuration.name>" to the web.
...
...
software/ipython_notebook/instance.cfg
View file @
b078e528
...
...
@@ -23,6 +23,8 @@ parts =
## Monitor for ipython
monitor-current-log-access
monitor-deploy-set-password-cgi
erp5-kernel
kernel-json
extends = ${monitor-template:output}
...
...
@@ -75,6 +77,7 @@ command-line =
--notebook-dir=$${instance-parameter:notebook_dir}
--logfile=$${instance-parameter:logfile}
--config=$${ipython_notebook_config:rendered}
--log-level="DEBUG"
wrapper-path = $${directory:service}/ipython_notebook
parameters-extra = true
...
...
@@ -85,6 +88,7 @@ rendered = $${directory:etc}/ipython_notebook_config.py
mode = 0744
context =
raw config_cfg $${buildout:directory}/knowledge0.cfg
raw ipython_dir $${directory:ipython_dir}
[monitor-current-log-access]
< = monitor-directory-access
...
...
@@ -113,8 +117,29 @@ service = $${:etc}/service
promise = $${:etc}/promise/
log = $${:var}/log
notebook_dir = $${:var}/notebooks
ipython_dir = $${:home}/.ipython
ipython_kernel_dir = $${:ipython_dir}/kernels
erp5_kernel_dir = $${:ipython_kernel_dir}/ERP5
[publish-connection-parameter]
recipe = slapos.cookbook:publish
url = https://[$${instance-parameter:host}]:$${instance-parameter:port}
monitor_url = $${monitor-parameters:url}
[erp5-kernel]
recipe = slapos.recipe.template:jinja2
template = ${erp5-kernel:location}/${erp5-kernel:filename}
rendered = $${directory:erp5_kernel_dir}/ERP5kernel.py
mode = 0744
context =
raw python_executable ${buildout:bin-directory}/ipython
[kernel-json]
recipe = slapos.recipe.template:jinja2
template = ${kernel-json:location}/${kernel-json:filename}
rendered = $${directory:erp5_kernel_dir}/kernel.json
mode = 0744
context =
raw python_executable ${buildout:bin-directory}/ipython
raw kernel_dir $${directory:erp5_kernel_dir}/ERP5kernel.py
raw display_name ERP5
\ No newline at end of file
software/ipython_notebook/software.cfg
View file @
b078e528
...
...
@@ -32,7 +32,7 @@ initialization +=
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/${:filename}
download-only = true
md5sum =
a5bc4ee8539109d1de7ab33b4c2c97ea
md5sum =
b056616e962b2fe1fa523ddd658b0f1b
destination = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = ipython_notebook_config.jinja
mode = 0644
...
...
@@ -51,8 +51,23 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/instance.cfg
[erp5-kernel]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/${:filename}
download-only = true
md5sum = 460206edb2fc6b21e065b6cbd1475f1a
destination = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = ERP5kernel.py.jinja
mode = 0644
[kernel-json]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/${:filename}
download-only = true
md5sum = 0f77ab5399990ebb25f95f969cb4b7cb
destination = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = kernel.json.jinja
mode = 0644
[versions]
PyRSS2Gen = 1.1
...
...
software/ipython_notebook/template/ERP5kernel.py.jinja
0 → 100755
View file @
b078e528
#!{{python_executable}}
from IPython.kernel.zmq.kernelbase import Kernel
from IPython.display import display_javascript
from IPython.core.display import HTML
class ERP5Kernel(Kernel):
implementation = 'ERP5'
implementation_version = '1.0'
language = 'ERP5'
language_version = '0.1'
language_info = {'mimetype': 'text/plain', 'name':'python'}
banner = "ERP5 integration with ipython notebook"
def do_execute(self, code, silent, store_history=True, user_expressions=None,
allow_stdin=False):
if not silent:
import requests
res = requests.get('https://zope:insecure@softinst60318.host.vifib.net/erp5/data_set_module/wendelin_1/Base_executePython', verify=False, params={'python_expression': code})
code_result = res.text
data = {
'data': {'text/html': code_result},
'metadata': {}
}
self.send_response(self.iopub_socket, 'display_data', data)
return {'status': 'ok',
# The base class increments the execution count
'execution_count': self.execution_count,
'payload': [],
'user_expressions': {},
}
if __name__ == '__main__':
from IPython.kernel.zmq.kernelapp import IPKernelApp
IPKernelApp.launch_instance(kernel_class=ERP5Kernel)
else:
from IPython.kernel.zmq.kernelapp import IPKernelApp
software/ipython_notebook/template/ipython_notebook_config.jinja
View file @
b078e528
...
...
@@ -11,3 +11,9 @@ parser.read(knowledge_0)
if parser.has_option("ipython_notebook", "password"):
c.NotebookApp.password = parser.get("ipython_notebook", "password")
# The name of the IPython directory. This directory is used for logging
# configuration (through profiles), history storage, etc. The default is usually
# $HOME/.ipython. This options can also be specified through the environment
# variable IPYTHONDIR.
c.IPKernelApp.ipython_dir = unicode('{{ ipython_dir }}')
c.NotebookApp.ipython_dir = unicode('{{ ipython_dir }}')
\ No newline at end of file
software/ipython_notebook/template/kernel.json.jinja
0 → 100644
View file @
b078e528
{
"argv": [
"{{python_executable}}",
"{{kernel_dir}}",
"-f",
"{connection_file}"
],
"display_name": "{{display_name}}",
"language": "python",
"language_info": {"name": "python"}
}
\ No newline at end of file
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