Add Notebook (.ipynb file) to Jupyter Lab Launcher

Hi,

I am using Renku renku/renkulab-vnc:0.11.0

Does any know how to add an icon to the Jupyter Lab Launcher? Like the VNC icon which has also been added to the Launcher as shown below:

Thanks in advance,
Richard

Hi Richard,

You generally have to define that using a special configuration file called jupyter_notebook_config.py which is hidden in the VNC template. What application or use case did you have in mind to add an icon to?

Gavin

Hi Gavin

I would like to run a notebook (.ipynb file) from an icon on the launcher. Preferably next to the VNC icon.

I have a jupyter_notebook_config.py in /etc/jupyter, but there is no mention of a launcher in there?

Do you know what code I would need to add to create an Icon.
Thanks.

Hi Richard,

Understood - we are currently looking into it. The set up is complicated by the fact that we run the notebook session out of a Docker image so we would have to use this package GitHub - yuvipanda/jupyter-launcher-shortcuts: Launcher shortcuts for classic Jupyter Notebook & JupyterLab but with some tweaks.

We’ll aim to get back to you shortly!

Cheers,
Gavin

We had a look at the problem and it seems difficult to use the package I linked above because of the way the container is started up.

What was the motivation for putting such an icon there? Did you want to automatically start the session loaded at a particular notebook? If so, this can be done through the .renku/renku.ini file.

For example: see this file: Renku

[renku "interactive"]
default_url = /lab/tree/notebooks/BSD68_reproducibility.ipynb

You will see in the files that this notebook is in the project. You can edit your own project’s renku.ini file in the same way. Then when you start the project using the Start button: Renku you will be taken to the notebook automatically.

Let us know if that helps.

Gavin

Hi Gavin

Thanks for getting back to me.

Our idea was to be able to start Notebooks in Jupyter lab using a separate icon as there is more than one notebook.

In the screenshot below from the Jupyter Lab launcher, it can be seen that there is a Python 3 (ipykernel) icon before the VNC icon. The Python 3 (ipykernel) icon starts an empty notebook.

image

In the python script /home/username/.jupyter/jupyter_notebook_config.py (see below) only the VNC icon is listed, not the Python 3 (ipykernel) icon?

c.ServerProxy.servers = {
‘vnc’: {
‘command’: [
‘/opt/conda/bin/websockify’,
‘-v’,
‘–web’, ‘/opt/noVNC-’ + noVNC_version,
‘–heartbeat’, ‘30’,
‘5901’,
‘–unix-target’, vnc_socket,
‘–’,
‘vncserver’,
‘-verbose’,
‘-xstartup’, xstartup,
‘-geometry’, ‘1024x768’,
‘-SecurityTypes’, ‘None’,
‘-rfbunixpath’, vnc_socket,
‘-fg’,
‘:1’
],
‘absolute_url’: False,
‘port’: 5901,
‘timeout’: 10,
‘mappath’: {’/’: ‘/vnc_renku.html’},
‘launcher_entry’: {
‘enabled’: True,
‘title’: ‘VNC’
}
}
}

Do you know where the Python 3 (ipykernel) icon is defined ?

Thanks.