Skip to main content

Run the LiberTEM GUI in JupyterLab / JupyterHub

See the LiberTEM docs for more details!

Requirements

  • Python 3.6+
  • Jupyter Notebook 6.0+
  • JupyterLab 2.1+
  • LiberTEM 0.8.0+

LiberTEM

LiberTEM is an open source platform for high-throughput distributed processing of large-scale binary data sets and live data streams using a modified MapReduce programming model. The current focus is pixelated scanning transmission electron microscopy (STEM) and scanning electron beam diffraction data.

Install

  1. Install this package and LiberTEM:

    $ pip install libertem-jupyter-proxy libertem

  2. enable jupyter-server-proxy extension

For Jupyter Classic, activate the jupyter-server-proxy extension:

jupyter serverextension enable --sys-prefix jupyter_server_proxy

For JupyterLab, install the @jupyterlab/server-proxy extension:

jupyter labextension install @jupyterlab/server-proxy
jupyter lab build
  1. Start jupyter-lab or jupyter-notebook

    $ jupyter-lab

or

$ jupyter notebook

Now LiberTEM should be available as an icon in JupyterLab, or in the "New" dropdown in the classical notebook interface / JupyterHub.

Deployment notes

When deploying behind a reverse proxy, make sure websocket requests are proxied for all URLs, not just for specifically matching ones. Otherwise, something like connecting to wss://<hostname>/user/<username>/libertem/events/ will fail with 400 bad request, as Upgrade: websocket is not supported.

If you want to customize the startup of LiberTEM, you can drop a JSON file into $PREFIX/etc/libertem_jupyter_proxy.json, with contents like this:

{"libertem_server_path": "/path/to/a/venv/bin/libertem-server"}

This allows to install LiberTEM itself into a different Python environment than Jupyter, as opposed to using the same environment as in the example above. It can also allow to write a wrapper script to customize the environment setup, as in the example script libertem_jupyter_proxy/share/launch_juwels.sh

Without configuration, libertem-server is expected to be found in $PATH.

Try it (WIP)

Binder

Thanks

Mostly stolen from https://github.com/betatim/vscode-binder

Metadata

Release files for libertem-jupyter-proxy 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for libertem-jupyter-proxy 0.1.2
File Interpreter ABI Platform
libertem_jupyter_proxy-0.1.2-py3-none-any.whl Python 3 none any Details

Release files / libertem_jupyter_proxy-0.1.2-py3-none-any.whl

Download URL libertem_jupyter_proxy-0.1.2-py3-none-any.whl
Size 107.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59f97aae265fc3993b6ec859fb0c5ad2e0bc9af99b34d0deaa0a9559cd3c3abf
BLAKE2b-256 checksum
How to use checksums
409bc37641d8b6d619731eb21dde734e67cb76ddb2696d08cbca48641bb8838f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file

0.1.1

2 release files

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page