trungleduc / jupyter_app_launcher

A JupyterLab extension to create custom launcher entries.
https://jupyter-app-launcher.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
53 stars 11 forks source link

No items are displayed in the launcher #24

Closed fieeman closed 1 year ago

fieeman commented 1 year ago

Hello!

this is my first issue on github, if I'm making any mistake, let me know :)

I installed using pip

and using the jupyter labextension list command I can see that it is enabled

JupyterLab v3.5.3
/opt/tljh/user/share/jupyter/labextensions
        jupyter_app_launcher v0.1.5 enabled OK (python, jupyter_app_launcher)
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        @jupyter-widgets/jupyterlab-manager v3.1.1 enabled OK (python, jupyterlab_widgets)
        @jupyterlab/server-proxy v3.2.2 enabled OK
        @jupyter-server/resource-usage v0.6.4 enabled OK (python, jupyter-resource-usage)

jupyter serverextension list

config dir: /opt/tljh/user/etc/jupyter
    jupyter_server_proxy  enabled
    - Validating...
      jupyter_server_proxy  OK
    jupyter_app_launcher  enabled
    - Validating...
      jupyter_app_launcher 0.1.5 OK
    jupyter_nbextensions_configurator  enabled
    - Validating...
      jupyter_nbextensions_configurator 0.6.1 OK
    jupyter_resource_usage  enabled
    - Validating...
      jupyter_resource_usage 0.6.4 OK
    jupyterlab  enabled
    - Validating...
      jupyterlab 3.5.3 OK
    nbgitpuller  enabled
    - Validating...
      nbgitpuller 1.1.1 OK
    nteract_on_jupyter  enabled
    - Validating...
      nteract_on_jupyter 2.1.3 OK

using the jupyter --path command, I can see the following

config:
    /root/.jupyter
    /root/.local/etc/jupyter
    /opt/tljh/user/etc/jupyter
    /usr/local/etc/jupyter
    /etc/jupyter
data:
    /root/.local/share/jupyter
    /opt/tljh/user/share/jupyter
    /usr/local/share/jupyter
    /usr/share/jupyter
runtime:
    /root/.local/share/jupyter/runtime

I have created the folder jupyter_app_launcher in /root/.jupyter and in /opt/tljh/user/etc/jupyter and created the config.yaml file with this content

- title: URL example
  description: Example of opening a URL in a tab
  source: https://jupyterlab.readthedocs.io/en/stable/
  type: url
  catalog: Other
  args:
      sandbox: [ 'allow-same-origin', 'allow-scripts', 'allow-downloads', 'allow-modals', 'allow-popups']

after doing all this and restarting the service, I don't see any new items in the launcher and in the browser console I see this message

JupyterLab extension jupyter_app_launcher is activated!

so I don't know what's going on, if you could give me some suggestions I would be very grateful.

trungleduc commented 1 year ago

Hi, thank you for your report. Can you try to set the JUPYTER_APP_LAUNCHER_PATH environment variable with the path to the directory containing the config.yaml file then start JupyterLab again?

trungleduc commented 1 year ago

And the config file should be in the data section of the jupyter --path command. Can you try moving the YAML file to /opt/tljh/user/share/jupyter/jupyter_app_launcher/config.yaml?

fieeman commented 1 year ago

Hello thanks for your suggestions. I have moved the config.yaml file to this /opt/tljh/user/share/jupyter/jupyter_app_launcher/ folder

ls -la
total 32
drwxr-xr-x  8 root jupyterhub-users 4096 Jan 26 18:10 .
drwxr-xr-x 20 root jupyterhub-users 4096 Jan 25 17:30 ..
drwxr-xr-x  2 root jupyterhub-users 4096 Jan 26 15:58 jupyter_app_launcher
drwxr-xr-x  3 root jupyterhub-users 4096 Jan 25 17:30 kernels
drwxr-xr-x  5 root jupyterhub-users 4096 Jan 25 17:30 lab
drwxr-xr-x  7 root jupyterhub-users 4096 Jan 26 14:24 labextensions
drwxr-xr-x  3 root jupyterhub-users 4096 Jan 25 17:30 nbconvert
drwxr-xr-x  5 root jupyterhub-users 4096 Jan 26 14:24 nbextensions

and I define the environment variable as follows JUPYTER_APP_LAUNCHER_PATH="/opt/tljh/user/share/jupyter/jupyter_app_launcher/"

echo $JUPYTER_APP_LAUNCHER_PATH
/opt/tljh/user/share/jupyter/jupyter_app_launcher/

and now it works, thank you very much for your help.

trungleduc commented 1 year ago

Great! You only need to define the environment variable if you want to place your config file outside of the jupyter data path. In your case, placing the file in /opt/tljh/user/share/jupyter/jupyter_app_launcher/ is enough.