Commit d4a90b46 authored by Ayush Tiwari's avatar Ayush Tiwari

Wendelin : Jupyter and Wendelin integrated together

Software Release Wendelin configured with requests being made to erp5 and jupyter.
1. 'disable-jupyter' parameter can be used to disable request to jupyter.
2. Default is wendelin+jupyter, i.e, user/developer will get wendelin configured with jupyter.
parent f61bc625
{% set part_list = [] -%}
{% set disable_jupyter = slapparameter_dict.get('disable-jupyter', false) -%}
{% set jupyter_family = slapparameter_dict.get('jupyter-family') -%}
{% set jupyter_family_name = 'family-' ~ jupyter_family -%}
{% if not disable_jupyter -%}
{% do part_list.append('request-jupyter')-%}
{% endif -%}
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
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}
[slap_connection]
# Kept for backward compatiblity
computer_id = ${slap-connection:computer-id}
partition_id = ${slap-connection:partition-id}
server_url = ${slap-connection:server-url}
software_release_url = ${slap-connection:software-release-url}
key_file = ${slap-connection:key-file}
cert_file = ${slap-connection:cert-file}
[request-erp5]
<= slap-connection
recipe = slapos.cookbook:request
name = ERP5
software-url = ${slap-connection:software-release-url}
{% if slap_software_type=='default'-%}
{% set software_type='erp5-cluster-default'-%}
{% elif slap_software_type=='create-erp5-site' -%}
{% set software_type='erp5-cluster-create-erp5-site'-%}
{% else -%}
{% set software_type=slap_software_type -%}
{% endif -%}
software-type = {{ software_type }}
sla-computer_guid = ${slap-connection:computer-id}
# Dirty hack to show all connection and instance parameters
# Must be changed after updating request recipe to show all the published
# parameters at once, something like exporter parameter in request recipe which
# calls getConnectionParameterDict()
# Other option would be to give some parameter in slapconfiguration recipe from
# where once can get ConnectionParameterDict, as for now we can get
# InstanceParameterDict using configuration parameter in slapconfiguration recipe,
# but there is no such param for connection parameters which is just unfortunate
config-_ = {{ json_module.dumps(slapparameter_dict) }}
return = _
[request-jupyter]
<= slap-connection
recipe = slapos.cookbook:request.serialised
name = Jupyter
software-url = ${slap-connection:software-release-url}
software-type = jupyter
sla-computer_guid = ${slap-connection:computer-id}
return = url
[publish-erp5-request-parameters]
recipe = slapos.cookbook:switch-softwaretype
profile = dynamic-publish-default-information:rendered
[erp5-published-values]
erp5_request_parameters = ${request-erp5:connection-_}
[dynamic-publish-default-information]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:filename}
context =
key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory
import json_module json
raw jupyter_family {{ jupyter_family }}
raw disable_jupyter {{ disable_jupyter }}
section erp5_published_values erp5-published-values
${:extra-context}
template = {{ template_publish_information }}
filename = dynamic-publish-default-information.cfg
extensions = jinja2.ext.do
{% if disable_jupyter==False -%}
extra-context =
key notebook_url request-jupyter:connection-url
{% else -%}
extra-context =
{% endif -%}
[buildout]
eggs-directory = {{ parameter_dict['eggs_directory'] }}
develop-eggs-directory = {{ parameter_dict['develop_eggs_directory'] }}
offline = true
parts =
request-erp5
dynamic-publish-default-information
publish-erp5-request-parameters
{% for part in part_list -%}
{{ ' %s' % part }}
{% endfor -%}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"extends": "./schema-definitions.json#",
"description": "Parameters to instantiate wendelin release with jupyter",
"additionalProperties": {
"$ref": "../erp5/instance-erp5-input-schema.json#properties"
},
"properties": {
"jupyter-family": {
"description": "Family name to be used in jupyter(ipython-notebook) erp5-url",
"default": "default",
"type": "string"
}
"disable-jupyter": {
"desciption": "Parameter to disable request to jupyter or to instantiate standalone wendelin",
"default": "false",
"type": "string"
}
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Values returned by Wendelin instantiation",
"additionalProperties": {
"$ref": "../erp5/instance-erp5-output-schema.json#properties"
},
"properties": {
"notebook-url": {
"description": "IPython Notebook url",
"type": "string"
},
"jupyter-family-url": {
"description": "erp5v family url used in jupyter/ipython-notebook",
"type": "string"
},
"error-message": {
"description": "Error message in case of missing jupyter family or wrong family name",
"type": "string"
}
}
}
[buildout]
extends = {{ template_erp5_cluster }}
parts =
switch-softwaretype
eggs-directory = {{ eggs_directory }}
develop-eggs-directory ={{ develop_eggs_directory }}
offline = true
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
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}
[slap_connection]
# Kept for backward compatiblity
computer_id = ${slap-connection:computer-id}
partition_id = ${slap-connection:partition-id}
server_url = ${slap-connection:server-url}
software_release_url = ${slap-connection:software-release-url}
key_file = ${slap-connection:key-file}
cert_file = ${slap-connection:cert-file}
[dynamic-template-default-parameters]
instance-erp5-site = ${dynamic-template-create-erp5-site:rendered}
eggs_directory = {{ eggs_directory }}
develop_eggs_directory = {{ develop_eggs_directory }}
[dynamic-template-default]
< = jinja2-template-base
template = {{template_default}}
filename = instance-default.cfg
extensions = jinja2.ext.do
extra-context =
import json_module json
raw template_publish_information {{ template_publish_information }}
key slap_software_type slap-configuration:slap-software-type
section parameter_dict dynamic-template-default-parameters
[dynamic-template-jupyter]
rendered = {{ template_jupyter }}
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
default = dynamic-template-default:rendered
create-erp5-site = dynamic-template-default:rendered
jupyter = dynamic-template-jupyter:rendered
erp5-cluster-create-erp5-site = dynamic-template-create-erp5-site:rendered
erp5-cluster-default = dynamic-template-erp5:rendered
\ No newline at end of file
...@@ -12,7 +12,11 @@ extends = ...@@ -12,7 +12,11 @@ extends =
../../component/scikit-learn/buildout.cfg ../../component/scikit-learn/buildout.cfg
../../software/erp5/software.cfg ../../software/erp5/software.cfg
parts += parts +=
slapos-cookbook
slapos-cookbook-develop
wendelin wendelin
jupyter-wendelin
ipython-notebook
scipy scipy
scikit-learn scikit-learn
pandas pandas
...@@ -21,7 +25,7 @@ parts += ...@@ -21,7 +25,7 @@ parts +=
wendelin.core wendelin.core
matplotlib matplotlib
fluentd fluentd
ipython_notebook instance
[eggs] [eggs]
initialization = initialization =
...@@ -29,6 +33,7 @@ initialization = ...@@ -29,6 +33,7 @@ initialization =
extra-paths += extra-paths +=
${wendelin:location} ${wendelin:location}
eggs += eggs +=
cns.recipe.symlink
${scikit-learn:egg} ${scikit-learn:egg}
${scipy:egg} ${scipy:egg}
${pandas:egg} ${pandas:egg}
...@@ -37,19 +42,66 @@ eggs += ...@@ -37,19 +42,66 @@ eggs +=
${ipython:egg} ${ipython:egg}
${matplotlib:egg} ${matplotlib:egg}
[slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git
branch = jupyter_wendelin
[erp5_repository_list] [erp5_repository_list]
repository_id_list += wendelin repository_id_list += wendelin
[local-bt5-repository] [local-bt5-repository]
# we need to override it # we need to override it to add extra repositories for wendelin
list = ${erp5:location}/bt5 ${erp5:location}/product/ERP5/bootstrap ${wendelin:location}/bt5/ list = ${erp5:location}/bt5 ${erp5:location}/product/ERP5/bootstrap ${wendelin:location}/bt5/ ${jupyter-wendelin:location}/bt5/
bt5_list = erp5_full_text_myisam_catalog erp5_configurator_standard erp5_configurator_maxma_demo erp5_configurator_ung erp5_configurator_run_my_doc erp5_configurator_ebusiness_lotse erp5_wendelin_configurator bt5_list = erp5_full_text_myisam_catalog erp5_configurator_standard erp5_configurator_maxma_demo erp5_configurator_ung erp5_configurator_run_my_doc erp5_configurator_ebusiness_lotse erp5_wendelin_configurator erp5_data_notebook
[wendelin] [wendelin]
<= erp5 <= erp5
repository = https://lab.nexedi.com/nexedi/wendelin.git repository = https://lab.nexedi.com/nexedi/wendelin.git
branch = master branch = master
## TODO; Change the branch to master after merging erp5-data-notebook to master
[jupyter-wendelin]
<= erp5
repository = https://lab.nexedi.cn/tiwariayush/erp5.git
branch = erp5-data-notebook
[instance]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.in
rendered = ${buildout:directory}/template.cfg
md5sum = 28a861b6edf15990ce9490dce6488ff3
mode = 0644
context =
key slapos_core_version versions:slapos.core
key bin_directory buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key template_publish_information template-publish-information:target
key template_default template-default:target
key template_erp5_cluster template-erp5-cluster:rendered
key template_jupyter template-jupyter:rendered
[template-erp5-cluster]
<= template
rendered = ${buildout:directory}/template-erp5-cluster.cfg
[template-jupyter]
<= instance-jupyter
rendered = ${buildout:directory}/template-jupyter.cfg
[template-default]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-default.cfg.in
md5sum = 0a9aebe32b04226b95105c8d93369cf7
mode = 0644
[template-publish-information]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/template/publish-default-information.cfg.in
md5sum = ab217c0f8d8290c4ccf1fcea4273a6fe
mode = 0644
[versions] [versions]
scikit-learn = 0.16.1 scikit-learn = 0.16.1
scipy = 0.15.1 scipy = 0.15.1
......
[buildout]
parts =
publish-default-connection-parameters
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
{% set erp5_request_parameters = json_module.loads(erp5_published_values.get('erp5_request_parameters')) -%}
{% set publish_dict = {} -%}
{% for name, value in erp5_request_parameters.iteritems() -%}
{% do publish_dict.__setitem__(name, value) -%}
{% endfor %}
{% set jupyter_family_name = 'family-' ~ jupyter_family -%}
{% set jupyter_family_url = publish_dict.get(jupyter_family_name) -%}
[publish-default-connection-parameters]
recipe = slapos.cookbook:publish.serialised
{% for name, value in publish_dict.items() -%}
{{ name }} = {{ value }}
{% endfor -%}
{% if disable_jupyter=="False" %}
notebook-url = {{ notebook_url }}
{% if jupyter_family=="None" -%}
error-message = No jupyter-family defined in parameters
# None here is an identifier, not a string
{% elif jupyter_family_url==none -%}
{% set error_message = 'No family exist with the family name ' ~ jupyter_family -%}
error-message = {{ error_message }}
{% else -%}
jupyter-family-url = {{ jupyter_family_url }}
{% endif -%}
{% endif -%}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment