Run LiberTEM via JupyterLab/JupyterHub
Project description
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
-
Install this package and LiberTEM:
$ pip install libertem-jupyter-proxy libertem
-
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
-
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)
Thanks
Mostly stolen from https://github.com/betatim/vscode-binder
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for libertem-jupyter-proxy-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3068ad3a25637f2e1409c2ec129bbe8c50022d9df530607c764cd4dff0d6d3b9 |
|
MD5 | 0613bd646275c94121e33f2a5848c1ea |
|
BLAKE2b-256 | 6dc2248dd96fca186b021df46a79f85384bf64f353606a6cbcf273dd7ebaab0c |
Hashes for libertem_jupyter_proxy-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3016217fdeb876800ed68acbf6982b7760d41d2d8406d04f99f1839ef62adaff |
|
MD5 | ee94312546ddfe57feff08eb4b5844e2 |
|
BLAKE2b-256 | 7da96528c4da6ab57b69fa0bb1a158d94c4efc75fd0a396bf1d582217b7f7c54 |