Skip to content

Jupyter in Remote Environments

Compare
Choose a tag to compare
@banesullivan banesullivan released this 06 Feb 20:02
· 289 commits to main since this release

This release adds support for using localtileserver in remote Jupyter environments (e.g., MyBinder or JupyterHub) through jupyter-server-proxy. Included in this release is a new Docker image on GitHub's package registry for using localtileserver in Jupyter.

docker pull ghcr.io/banesullivan/localtileserver-jupyter:latest
docker run -p 8888:8888 ghcr.io/banesullivan/localtileserver-jupyter:latest

To configure this in your own set up, you must set the following environment variables

  • LOCALTILESERVER_CLIENT_PREFIX='proxy/{port}' - Same for everyone using jupyter-server-proxy
  • Optional:
    • LOCALTILESERVER_CLIENT_HOST=127.0.0.1 - The host on which you launch Jupyter (the URL/domain of the Jupyter instance if using MyBinder or JupyterHub)
    • LOCALTILESERVER_CLIENT_PORT=8888 - The port on which you launch Jupyter (leave blank if using MyBinder or JupyterHub)

There is a demo in https://github.com/banesullivan/localtileserver-demo that shows how this will work on MyBinder by setting the following at run-time:

# Set host forwarding for MyBinder
import os
os.environ['LOCALTILESERVER_CLIENT_PREFIX'] = f"{os.environ['JUPYTERHUB_SERVICE_PREFIX'].lstrip('/')}/proxy/{{port}}"

Resolves #29, #66, and banesullivan/localtileserver-demo#1