Skip to content

Instantly share code, notes, and snippets.

@m158261
Last active February 6, 2024 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save m158261/7232671f04a5de8f1ce4b810f5ea8a3a to your computer and use it in GitHub Desktop.
Save m158261/7232671f04a5de8f1ce4b810f5ea8a3a to your computer and use it in GitHub Desktop.
Link JupyterLab and Lumino

Link JupyterLab and Lumino in a single Binder instance

This link can be shared so anyone can interact with JupyterLab - Binder

This Gist allows users to link JupyterLab and Lumino branches together from any public repository. This means issues with fixes that span the two repositories can be tested together.

Getting started

  • Fork this Gist (button on top right of page).
  • Edit lines 11 and 16 in postBuild to point towards your repository and branches you want to link i.e.
git clone https://github.com/<Insert repository name or GitHub username here>/lumino.git --branch <Insert branch here> --single-branch
  • Update the binder link in the README.md with your username and the ID of your Gist which can be found in the URL of this page.

gist id binder id

  • Save the changes by clicking update public gist button at bottom of page.
  • Click the Binder link in the README.md

Updating after code changes

As Binder is pointing towards the Gist and not your branches, any code changes in the branches will not be seen by Binder and it won't update the docker image. To force Binder to update the docker image you need to update your Gist. This can be done by adding a line to the README.

Credit is given to Michał Krassowski for help with this solution.

Edited 06/02/2024

name: jupyterlab-dev
channels:
- conda-forge
- nodefaults
dependencies:
# runtimes
- nodejs >=18,<19
- python =3.11
# package managers
- pip
- yarn >=3,<4
# build
- hatch-jupyter-builder >=0.3.2
- hatchling >=1.5.0
# run
- async-lru >=1.0.0
- ipykernel
- jinja2 >=3.0.3
- jupyter_core
- jupyter_server >=2.4.0,<3
- jupyter-lsp >=2.0.0
- jupyterlab_server >=2.19.0,<3
- packaging
- tornado >=6.2.0
- traitlets >=5.10.1
# dev
- black-jupyter
- hatch
- pytest-cov
- python-build
- pip:
# can't be installed with `conda` in binder, due to `jupyterlab-link-share``
- jupyter-collaboration ==1.2.0
#!/bin/bash
# ensure no surprises from binder's "half" activation
source activate ${NB_PYTHON_PREFIX}
# use strict and verbose shell settings
set -euxo pipefail
# create log folder, named to appear at the top of the file browser
mkdir _reports_
git clone https://github.com/t03857785/lumino.git --branch demo --single-branch
cd lumino
jlpm && jlpm build
cd ..
git clone https://github.com/t03857785/jupyterlab.git --branch demo --single-branch
cd jupyterlab
jlpm link ../lumino --all
(time jlpm build:dev) 2>&1 | tee ../_reports_/01_build.txt
(time pip install -v -e . --no-build-isolation) 2>&1 | tee ../_reports_/02_pip_install.txt
cd ..
# clean up egregious wastes of space
rm -rf \
~/.cache \
dev_mode/stats.json \
node_modules/@stdlib
#!/bin/bash
echo $@
exec jupyter-lab --dev-mode "${@:4}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment