Jupyterlab for education on raspberries need to lighten the build process

I am using raspberries tu introduce coding, IoT, climate change challenges (starting from weatherstations and sensor management). No need to explain why those nano-computers are usefull for various facets of education and of course Jupyter is an incredible tool either to monitor leds, sensors or weather stations or process big data from climate projections made available from research labs.
We were more than pleased to migrate from netbook to lab but unfortunately jupyterlab builds are only possible without any extension on PI3 and PI3+ (only 1Gb memory) The messages clearly explain that the process is too memory consumer :

    WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
    This can impact web performance.
    Assets: 
      664de3932dd6291b4b8a8c0ddbcb4c61.svg (896 KiB)
      2f12242375edd68e9013ecfb59c672e9.svg (730 KiB)
      vendors~main.0b48c2178bc57b8a6626.js (4.15 MiB)
      2.9ccb7977a199a4a50689.js (454 KiB)
      3.93113e5afd83ba64f565.js (883 KiB)
      4.69406a7d6939b46f4e98.js (253 KiB)
    
    WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
    Entrypoints:
      main (4.18 MiB)
          vendors~main.0b48c2178bc57b8a6626.js
          main.bf408a12f7bd5fbbb024.js
 WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
    This can impact web performance.
    Assets: 
      664de3932dd6291b4b8a8c0ddbcb4c61.svg (896 KiB)
      2f12242375edd68e9013ecfb59c672e9.svg (730 KiB)
      vendors~main.0b48c2178bc57b8a6626.js (4.15 MiB)
      2.9ccb7977a199a4a50689.js (454 KiB)
      3.93113e5afd83ba64f565.js (883 KiB)
      4.69406a7d6939b46f4e98.js (253 KiB)
    
    WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
    Entrypoints:
      main (4.18 MiB)
          vendors~main.0b48c2178bc57b8a6626.js
          main.bf408a12f7bd5fbbb024.js

I do not know why, I don’t know if it is possible as I am not a dev; but I am wondering if some time might be spent across the community to reduce the memory consumption and enable to use extensions with jupyterlab on low memory computers like raspberries.
Thanks

JupyterLab 3 has support for pip-installable extensions, which I think means the javascript assets are pre-compiled and won’t require a build step. I’m not sure though. Related thread:

Yes, thanks @manics.

@g-vidal if you are able to use JupyterLab 3.0 already (currently in release candidate) that would be great. Many extension authors will indeed update their extension so they can be distributed with a pip package.

As an alternative, using the --minimize=False flag should help reduce memory consumption when rebuilding JupyterLab:

jupyter labextension myextension --no-build
jupyter lab build --minimize=False
1 Like

Correct. This is one of the main features of JupyterLab 3 - a way to distribute extensions that does not require building JupyterLab.

2 Likes

FYI, those error messages are just about the sizes of the javascript bundle, not about the memory use in the build process (i.e., those errors aren’t relevant for building JupyterLab).

Hopefully between jlab 3 having no-build extensions and the fixes we discussed over in Is this dirty build hack acceptable to use extensions on raspberry?, using jlab on a raspberry pi will be a much better experience!

(By the way, the fixes in Is this dirty build hack acceptable to use extensions on raspberry? are in the latest JupyterLab rc, 3.0rc7)

Thanks for your answers :pray:. I have installed jlab 3 on the bullseye versions of my PI4 and PI3 You are right for all the improvements :star_struck: cited BUT there are 2 majors drawbacks that prevent me from using it until they are fixed :sob::

  1. some crucial extensions are mising (chart-editor…), my users are reluctant to use an “equivalent tool” I know it is just a matter of time but for the moment jlab3 remains unfortunately experimental,
  2. more annoying : jlab 3 does not work inside jupyterhub (notebooks in jupyterhub keep working perfectly).This is a “no go” sign for me as some of us use the raspberrypies as a jupyterhub server inside a class. It is really a pity because the problem seems very superficial the first error message is
[I 2020-11-25 21:48:25.061 ServerApp] 302 GET /user/moon/ (127.0.0.1) 4.12ms
[W 2020-11-25 21:48:25.064 JupyterHub _version:41] Single-user server has no version header, which means it is likely < 0.8. Expected 1.2.1

The error message on the web browser is a 404

404 : Not Found
You are requesting a page that does not exist!
## here is the padge adress
https://192.168.10.28:8000/user/moon?

The funny thing is that if you start jupyterhub with notebook and change the web address to :
https://192.168.10.28:8000/user/moon/lab?
instead of
https://192.168.10.28:8000/user/moon/tree?
you get the jlab3 interface :crazy_face: . I am sure that all the points will be solved on jlab3 and I look forward tu get the clean version.
If anybody is interested in retriving and using the raspberryPi debian binary images with jupyter, jupyterlab, jupyterhub and other tools (mraa, upm, tigervnc …) installed they are freely available here The building process is detailed here. (Sorry everything is in french but good online translators are available) :wink:. all users have the same password provided here, localadmin user has full sudo.

2 Likes