ERP5 and Jupyter integrated together
This patch teaches ERP5 software release to automatically instantiate Jupyter notebook web UI and tune it to connect to ERP5 by default. When Jupyter is enabled, it also installs on-server erp5_data_notebook bt5 (erp5!29 (merged)) which handles code execution requested for Jupyter.
For ERP5 - for security and backward compatibility reasons - Jupyter instantiation and erp5_data_notebook bt5 install happen only if jupyter is explicitly enabled in instance parameters. The default is not to have Jupyter out of the box.
On the other hand for Wendelin SR, which inherits from ERP5 SR, the default is to have Jupyter out of the box, because Wendelin SR is fresh enough without lots of backward compatibility needs, and Jupyter is usually very handy for people who use Wendelin.
For integration, we reuse already established in ERP5 infrastructure, to request various slave instances, and request Jupyter in a way so it automatically tunes and connects to balancer of one of Zope family.
Jupyter code itself is compiled by reusing software/ipython_notebook/software.cfg, and Jupyter instance code is reused by hooking software/ipython_notebook/instance.cfg.in into ERP5 SR properly (the idea to override instance-jupyter not to render into default template.cfg is taken from previous work by @tiwariayush).
I tested this patch inside webrunner with create-erp5-site software type and various configurations (whether to have or not have jupyter, to which zope family to connect it, etc).
I have not tested frontend instantiation fully - because tests were done only in webrunner, but I've tried to make sure generated buildout code is valid for cases with frontend.
NOTE the code in this MR assumes erp5_data_notebook bt5 (erp5!29 (merged)) is merged into erp5.git master, so before slapos part, we should merge erp5 part. For now to test, I've added the following patch on top of this series:
diff --git a/software/erp5/software.cfg b/software/erp5/software.cfg
index c065c82..c9311dd 100644
--- a/software/erp5/software.cfg
+++ b/software/erp5/software.cfg
@@ -1,3 +1,7 @@
[buildout]
extends =
../../stack/erp5/buildout.cfg
+
+[erp5]
+repository = https://lab.nexedi.com/kirr/erp5.git
+branch = x/master+erp5-data-notebook
which points to merged by me erp5.git master with erp5_data_notebook.
NOTE even when erp5_data_notebook bt5 is installed, on a freshly installed ERP5, it is required to "check site consistency" first, so that initial bt5(s) are actually installed and erp5 is ready to function.
/cc @vpelletier, @Tyagov, @klaus, @Camata, @tiwariayush, @Kreisel, @jerome, @nexedi