4

"JupyterLite is a reboot of several attempts at making a full static Jupyte...

 1 year ago
source link: https://devm.io/python/jupyterlite-webassembly-tuloup
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Interview with Jeremy Tuloup, Technical Director at QuantStack and a Jupyter Distinguished Contributor

"JupyterLite is a reboot of several attempts at making a full static Jupyter distribution that runs in the browser"

09. May 2023


We spoke with Jeremy Tuloup, Technical Director at QuantStack and a Jupyter Distinguished Contributor, to learn more about JupyterLite — a distribution that runs in the browser. Jeremy explains the project, its goals, its best use cases, and what benefits users will achieve when compiling to WebAssembly.

devmio: Thank you for taking the time to answer our questions! First, could you please tell us a little about JupyterLite. What exactly is it and what is it used for?

Jeremy Tuloup: JupyterLite is a reboot of several attempts at making a full static Jupyter distribution that runs in the browser, without having to start the Python Jupyter Server on the host machine.

The goal of the project is to provide a lightweight computing environment accessible in a matter of seconds with a single click, in a web browser, and without having to install anything on the end-user device.

With in-browser distributions, there is no need to provision the execution environment in the backend. Since the application is mostly a set of static files, it scales more easily, and it is also easier to deploy.

devmio: What are the advantages of running Jupyter in the browser? When would this be preferable, or what are some use cases?

Jeremy Tuloup: A significant benefit of running Jupyter in the browser is the ease of deployment. With JupyterLite, the only requirement to provide a live computing environment is a collection of static assets. It makes it possible to embed a console or a notebook interface on any static page or blog without having to deal with a server architecture deployment.

The scalability of this approach allowed several major projects of our ecosystem (NumPy, SymPy, PyMC, and many more) to embed interactive examples on their websites, which are visited by millions of users monthly.

In the educational space, it simplifies access to teaching materials and computing environments. Teachers and students can focus on the content of their classes without worrying about server deployments and monitoring.

With in-browser distributions, there is no need to provision the execution environment in the backend. Since the application is mostly a set of static files, it scales more easily, and it is also easier to deploy.

devmio: Why WebAssembly? What are the benefits of compiling to WebAssembly?

Jeremy Tuloup: Being able to pin down package versions in an environment is a strong requirement for software reproducibility. In fact, a locked WebAssembly environment could be seen as a reproducibility time capsule.

As WebAssembly is a recognized web standard, it ought to be runnable for much longer than native binary packages: these are bound to a combination of architecture and platform and will eventually require an emulator.

Another benefit of compiling to WebAssembly is the portability.

devmio: Can users work collaboratively in JupyterLite?

Jeremy Tuloup: A JupyterLite website deployer can enable Real-Time Collaboration so users can work together on the same documents. JupyterLite uses the WebRTC technology to enable peer-to-peer collaboration.

The RTC feature in JupyterLite is still very much experimental at the moment. We expect more improvements soon.

devmio: How is JupyterLite’s performance compared to running natively?

Jeremy Tuloup: There are currently two aspects for measuring performance of JupyterLite.

Since it is distributed as a collection of static assets, the user interface does not need the regular Python backend and should most of the times load a bit faster. When it comes to executing code in the Python kernel, the latest builds of Python to WebAssembly are approximately still about 3 times slower.

However the WebAssembly build of CPython benefits from the improvements that went into making "normal" CPython run faster.

Being able to pin down package versions in an environment is a strong requirement for software reproducibility. In fact, a locked WebAssembly environment could be seen as a reproducibility time capsule.

devmio: What sort of custom extensions can be added onto JupyterLite?

Jeremy Tuloup: JupyterLite is compatible with most of the frontend extensions made for JupyterLab. Some extensions will not work in JupyterLite if they also require a server component to be available.

Some example of extensions that can be added to JupyterLite are:

  • Custom themes
  • Drawio, and extension for making diagram
  • Custom Jupyter Widgets for improved interactivity

devmio: JupyterLite was built with JupyterLab. Could you expand upon that? What does JupyterLab consist of?

Jeremy Tuloup: JupyterLab is an extensible environment for interactive and reproducible computing. It is made of dozens of packages which are put together to make the JupyterLab web application. Some of these packages bring capabilities such as working with the Notebook, code consoles, the command palette, and so on.

Since these packages are modular they can be reused in downstream applications. This is what JupyterLite does. The application is built from the ground-up using these packages, and brings some of its own additional packages to deal with the in-browser execution.

That way improvements landing upstream in JupyterLab can be consumed downstream in JupyterLite easily.

devmio: Are there any limitations users should be aware of before they get started?

Jeremy Tuloup: Yes. The fact that the computation runs in a browser brings its own set of limits.

For example, it is not yet possible to do multithreading and many libraries are still not compatible. We also recommend using JupyterLite for smaller use cases like teaching and education, or demoing a library on a documentation website.

The final release of JupyterLab 4 is around the corner. We will soon start updating JupyterLite to the latest JupyterLab 4 packages.

devmio: Can you share any future plans with us? What’s on the roadmap ahead for 2023?

Jeremy Tuloup: Since JupyterLite reuses components from JupyterLab, it directly benefits from upstream development. The final release of JupyterLab 4 is around the corner. We will soon start updating JupyterLite to the latest JupyterLab 4 packages.

There is also very active development on the package management for WebAssembly using the conda-forge toolchain and mamba via the Emscripten Forge project. This will help streamline the process of making more packages available in the browser and usable from JupyterLite.

Jeremy Tuloup
Jeremy Tuloup

Jeremy Tuloup is a Technical Director at QuantStack and a Jupyter Distinguished Contributor. Maintainer and contributor of JupyterLab, JupyterLite, Jupyter Notebook, Voilà Dashboards, and many projects within the Jupyter ecosystem.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK