Commit ffa246af authored by Jérome Perrin's avatar Jérome Perrin

fixup! software/erp5/test: test clean shutdown WIP 🚧

parent f039bbd1
Pipeline #34255 failed with stage
in 0 seconds
...@@ -11,7 +11,7 @@ parts = ...@@ -11,7 +11,7 @@ parts =
<= numpy-env <= numpy-env
[ipython] [ipython]
recipe = zc.recipe.egg:custom recipe = zc.recipe.egg
egg = ipython egg = ipython
environment = ipython-env environment = ipython-env
setup-eggs = setup-eggs =
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
[instance-jupyter-notebook] [instance-jupyter-notebook]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = fd7ed44da8d8723983b8666df2971a36 md5sum = 8760f6cbc16277f09cc575ad87bdd25b
[jupyter-notebook-config] [jupyter-notebook-config]
filename = jupyter_notebook_config.py.jinja filename = jupyter_notebook_config.py.jinja
md5sum = 9d579353b579b6e488ae6330c7f4ad68 md5sum = 4e8c8fae0c1fecf246db46518e76ff9f
[jupyter-set-password] [jupyter-set-password]
filename = jupyter_set_password.cgi.jinja filename = jupyter_set_password.cgi.jinja
......
...@@ -74,10 +74,13 @@ environment = ...@@ -74,10 +74,13 @@ environment =
[jupyter-notebook-config] [jupyter-notebook-config]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
url = {{ jupyter_config_location }}/{{ jupyter_config_filename }} url = {{ jupyter_config_location }}/{{ jupyter_config_filename }}
output = ${directory:jupyter_config_dir}/jupyter_notebook_config.py output = ${directory:jupyter_config_dir}/jupyter_server_config.py
context = context =
raw config_cfg ${buildout:directory}/knowledge0.cfg raw config_cfg ${buildout:directory}/knowledge0.cfg
[jupyter-notebook-config:python2]
output = ${directory:jupyter_config_dir}/jupyter_notebook_config.py
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory} home = ${buildout:directory}
...@@ -100,7 +103,7 @@ erp5_kernel_dir = ${:jupyter_kernel_dir}/ERP5 ...@@ -100,7 +103,7 @@ erp5_kernel_dir = ${:jupyter_kernel_dir}/ERP5
# 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
password = password =
filename = knowledge0.cfg filename = knowledge0.cfg
[read-knowledge0] [read-knowledge0]
...@@ -136,7 +139,7 @@ output = ${directory:erp5_kernel_dir}/kernel.json ...@@ -136,7 +139,7 @@ output = ${directory:erp5_kernel_dir}/kernel.json
context = context =
raw python_executable {{ python_executable }} raw python_executable {{ python_executable }}
raw kernel_dir ${erp5-kernel:target-directory}/{{ erp5_kernel_filename }} raw kernel_dir ${erp5-kernel:target-directory}/{{ erp5_kernel_filename }}
key erp5_url slapconfiguration:configuration.erp5-url key erp5_url slapconfiguration:configuration.erp5-url
raw display_name ERP5 raw display_name ERP5
raw language_name python raw language_name python
......
...@@ -2,9 +2,13 @@ ...@@ -2,9 +2,13 @@
This script initializes Jupyter's configuration such as passwords and other This script initializes Jupyter's configuration such as passwords and other
things. It is run by IPython hence why it can use functions like get_config(). things. It is run by IPython hence why it can use functions like get_config().
''' '''
import ConfigParser import six
from six.moves.configparser import ConfigParser
import random import random
from notebook.auth import passwd if six.PY3:
from jupyter_server.auth import passwd
else:
from notebook.auth import passwd
import os import os
import ssl import ssl
......
...@@ -19,11 +19,11 @@ md5sum = 5f39952f94095b1f12f41db76867e71e ...@@ -19,11 +19,11 @@ md5sum = 5f39952f94095b1f12f41db76867e71e
[instance-jupyter] [instance-jupyter]
filename = instance-jupyter.cfg.in filename = instance-jupyter.cfg.in
md5sum = f9a0e5a134456d74ca8b4d87862f903d md5sum = 1466a598280cecdff60c4f4b5866df9a
[jupyter-notebook-config] [jupyter-notebook-config]
filename = jupyter_notebook_config.py.jinja filename = jupyter_notebook_config.py.jinja
md5sum = 089e4c511a3c7b110471bf41ca2695a4 md5sum = 601efe6ee4c9e2712d03981c0da870b0
[erp5-kernel] [erp5-kernel]
filename = ERP5kernel.py filename = ERP5kernel.py
......
...@@ -91,7 +91,6 @@ environment = ...@@ -91,7 +91,6 @@ environment =
[jupyter-password] [jupyter-password]
recipe = slapos.cookbook:generate.password recipe = slapos.cookbook:generate.password
bytes = 10
[jupyter-notebook-config] [jupyter-notebook-config]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
...@@ -171,13 +170,11 @@ instance-configuration = ...@@ -171,13 +170,11 @@ instance-configuration =
[publish-connection-parameter] [publish-connection-parameter]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
jupyter-classic-url = ${request-slave-frontend:connection-secure_access}/tree
url = ${:jupyter-classic-url}
jupyterlab-url = ${request-slave-frontend:connection-secure_access}/lab jupyterlab-url = ${request-slave-frontend:connection-secure_access}/lab
url = ${:jupyterlab-url}
{% if additional_frontend %} {% if additional_frontend %}
jupyter-classic-url-additional = ${request-slave-frontend-additional:connection-secure_access}/tree
url-additional = ${:jupyter-classic-url-additional}
jupyterlab-url-additional = ${request-slave-frontend-additional:connection-secure_access}/lab jupyterlab-url-additional = ${request-slave-frontend-additional:connection-secure_access}/lab
url-additional = ${:jupyterlab-url-additional}
{% endif %} {% endif %}
password = ${jupyter-password:passwd} password = ${jupyter-password:passwd}
...@@ -194,7 +191,7 @@ output = ${directory:erp5_kernel_dir}/kernel.json ...@@ -194,7 +191,7 @@ output = ${directory:erp5_kernel_dir}/kernel.json
context = context =
raw python_executable {{ python_executable }} raw python_executable {{ python_executable }}
raw kernel_dir ${erp5-kernel:target-directory}/{{ erp5_kernel_filename }} raw kernel_dir ${erp5-kernel:target-directory}/{{ erp5_kernel_filename }}
key erp5_url slapconfiguration:configuration.erp5-url key erp5_url slapconfiguration:configuration.erp5-url
raw display_name ERP5 raw display_name ERP5
raw language_name python raw language_name python
......
...@@ -2,13 +2,15 @@ ...@@ -2,13 +2,15 @@
This script initializes Jupyter's configuration such as passwords and other This script initializes Jupyter's configuration such as passwords and other
things. It is run by IPython hence why it can use functions like get_config(). things. It is run by IPython hence why it can use functions like get_config().
''' '''
import configparser from jupyter_server.auth import passwd
from notebook.auth import passwd import pathlib
import jupyterlab
import os import os
c = get_config() c = get_config()
c.NotebookApp.password = passwd("{{ password }}") c.ServerApp.password = passwd("{{ password }}")
c.LabApp.app_dir = str(pathlib.Path(jupyterlab.__file__).parent.parent / 'share' / 'jupyter' / 'lab')
try: try:
os.environ['PATH'] = "{{ gcc_location }}/bin" + os.pathsep + os.environ['PATH'] os.environ['PATH'] = "{{ gcc_location }}/bin" + os.pathsep + os.environ['PATH']
......
...@@ -52,10 +52,9 @@ class TestJupyter(InstanceTestCase): ...@@ -52,10 +52,9 @@ class TestJupyter(InstanceTestCase):
self.assertEqual( self.assertEqual(
{ {
'jupyter-classic-url': 'https://[%s]:8888/tree' % (self.computer_partition_ipv6_address, ),
'jupyterlab-url': 'https://[%s]:8888/lab' % (self.computer_partition_ipv6_address, ), 'jupyterlab-url': 'https://[%s]:8888/lab' % (self.computer_partition_ipv6_address, ),
'password': '%s' % (password, ), 'password': '%s' % (password, ),
'url': 'https://[%s]:8888/tree' % (self.computer_partition_ipv6_address, ) 'url': 'https://[%s]:8888/lab' % (self.computer_partition_ipv6_address, )
}, },
connection_dict connection_dict
) )
...@@ -63,7 +62,7 @@ class TestJupyter(InstanceTestCase): ...@@ -63,7 +62,7 @@ class TestJupyter(InstanceTestCase):
result = requests.get( result = requests.get(
connection_dict['url'], verify=False, allow_redirects=False) connection_dict['url'], verify=False, allow_redirects=False)
self.assertEqual( self.assertEqual(
[http.client.FOUND, True, '/login?next=%2Ftree'], [http.client.FOUND, True, '/login?next=%2Flab%3F'],
[result.status_code, result.is_redirect, result.headers['Location']] [result.status_code, result.is_redirect, result.headers['Location']]
) )
...@@ -71,15 +70,7 @@ class TestJupyter(InstanceTestCase): ...@@ -71,15 +70,7 @@ class TestJupyter(InstanceTestCase):
connection_dict['jupyter-classic-url'], connection_dict['jupyter-classic-url'],
verify=False, allow_redirects=False) verify=False, allow_redirects=False)
self.assertEqual( self.assertEqual(
[http.client.FOUND, True, '/login?next=%2Ftree'], [http.client.FOUND, True, '/login?next=%2Flab%3F'],
[result.status_code, result.is_redirect, result.headers['Location']]
)
result = requests.get(
connection_dict['jupyterlab-url'],
verify=False, allow_redirects=False)
self.assertEqual(
[http.client.FOUND, True, '/login?next=%2Flab'],
[result.status_code, result.is_redirect, result.headers['Location']] [result.status_code, result.is_redirect, result.headers['Location']]
) )
...@@ -98,15 +89,7 @@ class TestJupyterAdditional(InstanceTestCase): ...@@ -98,15 +89,7 @@ class TestJupyterAdditional(InstanceTestCase):
result = requests.get( result = requests.get(
connection_dict['url'], verify=False, allow_redirects=False) connection_dict['url'], verify=False, allow_redirects=False)
self.assertEqual( self.assertEqual(
[http.client.FOUND, True, '/login?next=%2Ftree'], [http.client.FOUND, True, '/login?next=%2Flab%3F'],
[result.status_code, result.is_redirect, result.headers['Location']]
)
result = requests.get(
connection_dict['jupyter-classic-url'],
verify=False, allow_redirects=False)
self.assertEqual(
[http.client.FOUND, True, '/login?next=%2Ftree'],
[result.status_code, result.is_redirect, result.headers['Location']] [result.status_code, result.is_redirect, result.headers['Location']]
) )
...@@ -121,15 +104,7 @@ class TestJupyterAdditional(InstanceTestCase): ...@@ -121,15 +104,7 @@ class TestJupyterAdditional(InstanceTestCase):
result = requests.get( result = requests.get(
connection_dict['url-additional'], verify=False, allow_redirects=False) connection_dict['url-additional'], verify=False, allow_redirects=False)
self.assertEqual( self.assertEqual(
[http.client.FOUND, True, '/login?next=%2Ftree'], [http.client.FOUND, True, '/login?next=%2Flab%3F'],
[result.status_code, result.is_redirect, result.headers['Location']]
)
result = requests.get(
connection_dict['jupyter-classic-url-additional'],
verify=False, allow_redirects=False)
self.assertEqual(
[http.client.FOUND, True, '/login?next=%2Ftree'],
[result.status_code, result.is_redirect, result.headers['Location']] [result.status_code, result.is_redirect, result.headers['Location']]
) )
...@@ -137,7 +112,7 @@ class TestJupyterAdditional(InstanceTestCase): ...@@ -137,7 +112,7 @@ class TestJupyterAdditional(InstanceTestCase):
connection_dict['jupyterlab-url-additional'], connection_dict['jupyterlab-url-additional'],
verify=False, allow_redirects=False) verify=False, allow_redirects=False)
self.assertEqual( self.assertEqual(
[http.client.FOUND, True, '/login?next=%2Flab'], [http.client.FOUND, True, '/login?next=%2Flab%3F'],
[result.status_code, result.is_redirect, result.headers['Location']] [result.status_code, result.is_redirect, result.headers['Location']]
) )
......
...@@ -800,7 +800,6 @@ Zope = 5.9+SlapOSPatched003 ...@@ -800,7 +800,6 @@ Zope = 5.9+SlapOSPatched003
# Pinned versions # Pinned versions
alabaster = 0.7.12 alabaster = 0.7.12
APacheDEX = 2.0 APacheDEX = 2.0
arrow = 1.2.3
astroid = 3.1.0:whl astroid = 3.1.0:whl
Beaker = 1.11.0 Beaker = 1.11.0
cloudpickle = 0.5.3 cloudpickle = 0.5.3
...@@ -815,7 +814,6 @@ facebook-sdk = 2.0.0 ...@@ -815,7 +814,6 @@ facebook-sdk = 2.0.0
five.formlib = 1.0.4 five.formlib = 1.0.4
five.localsitemanager = 4.0 five.localsitemanager = 4.0
fpconst = 0.7.2 fpconst = 0.7.2
fqdn = 1.5.1
google-api-core = 2.17.1 google-api-core = 2.17.1
google-api-python-client = 2.118.0 google-api-python-client = 2.118.0
google-auth = 2.28.1 google-auth = 2.28.1
...@@ -828,11 +826,9 @@ huBarcode = 1.0.0+SlapOSPatched001 ...@@ -828,11 +826,9 @@ huBarcode = 1.0.0+SlapOSPatched001
imageio = 2.34.0 imageio = 2.34.0
interval = 1.0.0+SlapOSPatched001 interval = 1.0.0+SlapOSPatched001
ipdb = 0.10.2 ipdb = 0.10.2
isoduration = 20.11.0
isort = 5.13.2 isort = 5.13.2
jdcal = 1.3 jdcal = 1.3
jsonpickle = 0.9.6 jsonpickle = 0.9.6
jsonpointer = 2.2
lazy-object-proxy = 1.10.0 lazy-object-proxy = 1.10.0
logilab-common = 1.3.0 logilab-common = 1.3.0
Mako = 1.1.4 Mako = 1.1.4
...@@ -851,7 +847,6 @@ oic = 1.6.1 ...@@ -851,7 +847,6 @@ oic = 1.6.1
olefile = 0.44 olefile = 0.44
ordered-set = 4.1.0 ordered-set = 4.1.0
Pillow = 10.2.0+SlapOSPatched001 Pillow = 10.2.0+SlapOSPatched001
platformdirs = 4.2.0:whl
polib = 1.2.0 polib = 1.2.0
pprofile = 2.0.4 pprofile = 2.0.4
Products.BTreeFolder2 = 4.4+SlapOSPatched001 Products.BTreeFolder2 = 4.4+SlapOSPatched001
...@@ -894,7 +889,6 @@ PyWavelets = 1.4.0 ...@@ -894,7 +889,6 @@ PyWavelets = 1.4.0
qrcode = 5.3 qrcode = 5.3
Record = 4.1.0 Record = 4.1.0
responses = 0.10.6 responses = 0.10.6
rfc3339-validator = 0.1.4
rfc3987 = 1.3.8 rfc3987 = 1.3.8
rsa = 3.4.2 rsa = 3.4.2
scikit-image = 0.19.3 scikit-image = 0.19.3
...@@ -905,17 +899,14 @@ StructuredText = 2.11.1 ...@@ -905,17 +899,14 @@ StructuredText = 2.11.1
suds = 0.4 suds = 0.4
suds-py3 = 1.4.5.0 suds-py3 = 1.4.5.0
tifffile = 2024.2.12 tifffile = 2024.2.12
tomli = 2.0.1:whl
tomlkit = 0.12.4:whl tomlkit = 0.12.4:whl
toolz = 0.9.0 toolz = 0.9.0
typed-ast = 1.5.5 typed-ast = 1.5.5
typing = 3.10.0.0 typing = 3.10.0.0
unidiff = 0.5.5 unidiff = 0.5.5
uri-template = 1.2.0
urlnorm = 1.1.4+SlapOSPatched001 urlnorm = 1.1.4+SlapOSPatched001
uuid = 1.30 uuid = 1.30
validictory = 1.1.0 validictory = 1.1.0
webcolors = 1.12
wrapt = 1.16.0 wrapt = 1.16.0
WSGIProxy2 = 0.4.6 WSGIProxy2 = 0.4.6
WSGIUtils = 0.7 WSGIUtils = 0.7
...@@ -958,7 +949,6 @@ interval = 1.0.0 ...@@ -958,7 +949,6 @@ interval = 1.0.0
ipython = 5.3.0 ipython = 5.3.0
jedi = 0.15.1 jedi = 0.15.1
Missing = 4.2 Missing = 4.2
mock = 3.0.5
MultiMapping = 4.1 MultiMapping = 4.1
multipart = 0.1.1 multipart = 0.1.1
networkx = 2.1 networkx = 2.1
...@@ -1039,7 +1029,6 @@ zope.globalrequest = 1.6 ...@@ -1039,7 +1029,6 @@ zope.globalrequest = 1.6
zope.hookable = 5.4 zope.hookable = 5.4
zope.i18n = 4.9.0 zope.i18n = 4.9.0
zope.i18nmessageid = 5.1.1 zope.i18nmessageid = 5.1.1
zope.interface = 5.5.2
zope.lifecycleevent = 4.4 zope.lifecycleevent = 4.4
zope.location = 4.3 zope.location = 4.3
zope.pagetemplate = 4.6.0 zope.pagetemplate = 4.6.0
...@@ -1058,8 +1047,6 @@ zope.structuredtext = 4.4 ...@@ -1058,8 +1047,6 @@ zope.structuredtext = 4.4
zope.tal = 4.5 zope.tal = 4.5
zope.tales = 5.2 zope.tales = 5.2
zope.testbrowser = 5.6.1 zope.testbrowser = 5.6.1
zope.testing = 4.10
zope.testrunner = 5.6
zope.traversing = 4.4.1 zope.traversing = 4.4.1
zope.viewlet = 4.3 zope.viewlet = 4.3
ZServer = 4.0.2 ZServer = 4.0.2
...@@ -231,12 +231,14 @@ jedi = 0.17.2 ...@@ -231,12 +231,14 @@ jedi = 0.17.2
Jinja2 = 3.1.2:whl Jinja2 = 3.1.2:whl
joblib = 1.3.2:whl joblib = 1.3.2:whl
json5 = 0.9.20:whl json5 = 0.9.20:whl
jsonpointer = 2.2
jsonschema = 4.17.3:whl jsonschema = 4.17.3:whl
jupyter = 1.0.0 jupyter = 1.0.0
jupyter-client = 8.6.1:whl jupyter-client = 8.6.1:whl
jupyter-console = 6.6.3:whl jupyter-console = 6.6.3:whl
jupyter-core = 5.7.1:whl jupyter-core = 5.7.1:whl
jupyter-events = 0.6.3:whl jupyter-events = 0.6.3:whl
isoduration = 20.11.0
jupyter-lsp = 2.2.3:whl jupyter-lsp = 2.2.3:whl
jupyter-server = 2.10.0:whl jupyter-server = 2.10.0:whl
jupyter-server-terminals = 0.5.2:whl jupyter-server-terminals = 0.5.2:whl
...@@ -245,6 +247,8 @@ jupyterlab-launcher = 0.13.1 ...@@ -245,6 +247,8 @@ jupyterlab-launcher = 0.13.1
jupyterlab-pygments = 0.3.0:whl jupyterlab-pygments = 0.3.0:whl
jupyterlab-server = 2.24.0:whl jupyterlab-server = 2.24.0:whl
jupyterlab-widgets = 3.0.10:whl jupyterlab-widgets = 3.0.10:whl
arrow = 1.2.3
fqdn = 1.5.1
lock-file = 2.0 lock-file = 2.0
lockfile = 0.12.2:whl lockfile = 0.12.2:whl
lsprotocol = 2023.0.0b1:whl lsprotocol = 2023.0.0b1:whl
...@@ -259,7 +263,7 @@ more-itertools = 5.0.0 ...@@ -259,7 +263,7 @@ more-itertools = 5.0.0
mpmath = 1.3.0 mpmath = 1.3.0
msgpack = 1.0.5 msgpack = 1.0.5
multidict = 6.0.4 multidict = 6.0.4
nbclient = 0.5.1 nbclient = 0.10.0:whl
nbconvert = 6.5.4 nbconvert = 6.5.4
nbformat = 5.9.2:whl nbformat = 5.9.2:whl
nest-asyncio = 1.5.6 nest-asyncio = 1.5.6
...@@ -283,6 +287,7 @@ pickleshare = 0.7.4 ...@@ -283,6 +287,7 @@ pickleshare = 0.7.4
pim-dm = 1.4.0nxd002 pim-dm = 1.4.0nxd002
pkgconfig = 1.5.1 pkgconfig = 1.5.1
pkgutil-resolve-name = 1.3.10 pkgutil-resolve-name = 1.3.10
platformdirs = 4.2.0:whl
plone.recipe.command = 1.1 plone.recipe.command = 1.1
pluggy = 0.13.1:whl pluggy = 0.13.1:whl
ply = 3.11 ply = 3.11
...@@ -320,6 +325,7 @@ qtpy = 2.4.1:whl ...@@ -320,6 +325,7 @@ qtpy = 2.4.1:whl
random2 = 1.0.1 random2 = 1.0.1
regex = 2020.9.27 regex = 2020.9.27
requests = 2.31.0 requests = 2.31.0
rfc3339-validator = 0.1.4
rfc3986-validator = 0.1.1:whl rfc3986-validator = 0.1.1:whl
rpdb = 0.1.5 rpdb = 0.1.5
rubygemsrecipe = 0.4.4 rubygemsrecipe = 0.4.4
...@@ -356,6 +362,7 @@ terminado = 0.9.1 ...@@ -356,6 +362,7 @@ terminado = 0.9.1
testpath = 0.4.4 testpath = 0.4.4
threadpoolctl = 3.3.0:whl threadpoolctl = 3.3.0:whl
tinycss2 = 1.2.1:whl tinycss2 = 1.2.1:whl
tomli = 2.0.1:whl
tornado = 6.4 tornado = 6.4
traitlets = 5.14.1:whl traitlets = 5.14.1:whl
trio = 0.22.0 trio = 0.22.0
...@@ -364,9 +371,11 @@ typeguard = 3.0.2:whl ...@@ -364,9 +371,11 @@ typeguard = 3.0.2:whl
typing-extensions = 4.8.0:whl typing-extensions = 4.8.0:whl
tzlocal = 1.5.1 tzlocal = 1.5.1
unicodecsv = 0.14.1 unicodecsv = 0.14.1
uri-template = 1.2.0
uritemplate = 4.1.1 uritemplate = 4.1.1
urllib3 = 1.26.12 urllib3 = 1.26.12
wcwidth = 0.2.5 wcwidth = 0.2.5
webcolors = 1.12
webencodings = 0.5.1 webencodings = 0.5.1
websocket-client = 1.5.1 websocket-client = 1.5.1
websockets = 10.4 websockets = 10.4
...@@ -431,6 +440,7 @@ jupyterlab-pygments = 0.1.2 ...@@ -431,6 +440,7 @@ jupyterlab-pygments = 0.1.2
MarkupSafe = 1.0 MarkupSafe = 1.0
mpmath = 1.0.0 mpmath = 1.0.0
msgpack = 0.6.2 msgpack = 0.6.2
nbclient = 0.5.1
notebook = 6.1.5 notebook = 6.1.5
packaging = 16.8 packaging = 16.8
prompt-toolkit = 3.0.19 prompt-toolkit = 3.0.19
......
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