Running nbdiff-web via Port Proxying in RenkuLab

I’m setting up a course using Renku and would like to enable students to view structured notebook diffs using nbdime and specifically the nbdiff-web interface (using the basic nbdiff command works, outputting a written diff to the terminal). The goal is to run something like:

nbdiff-web notebook1.ipynb notebook2.ipynb --port=8899 --ip=127.0.0.1

inside a RenkuLab session, and then access the visual diff via the browser.

From what I understand, jupyter-server-proxy should make this possible via a URL like:

/proxy/8899/

However, this URL returns a 404 when accessed within the session or when appended to paths like:

https://renkulab.io/user/<username>/<project>/proxy/8899/

I’ve confirmed that:

  • nbdiff-web is running and listening on 127.0.0.1:8899

  • The terminal process is active

  • RenkuLab is using JupyterLab and supports jupyter-server-proxy (output of jupyter serverextension list shows jupyter_server_proxy enabled OK)

But I can’t get the web interface to load. I also noticed that JUPYTERHUB_SERVICE_PREFIX isn’t set in the environment, so generating the path programmatically doesn’t work.

Questions:

  1. What is the correct URL path to access a service like nbdiff-web running on a specific port inside a RenkuLab session?

  2. Is there a recommended way to use jupyter-server-proxy with custom services in RenkuLab?

Thanks so much, and I’d be happy to share a working example back with the community once this is solved!

1 Like

Have you considered using the git extension in JupyterLab? It should already be installed and it uses nbdime to show notebook file diffs.

The git extension is accessed by clicking the git icon on the left-hand side of the Jupyter interface and selecting a notebook file in the git status panel should show a diff handled by nbdime.

1 Like