dask / dask-labextension

JupyterLab extension for Dask
BSD 3-Clause "New" or "Revised" License
312 stars 63 forks source link

dask-labextension does not connect to LocalCluster in JupyterLab 3.2.5 environment. #222

Closed jimthompson5802 closed 2 years ago

jimthompson5802 commented 2 years ago

What happened:

Upon setting up a JupyterLab environment in a local docker container with dask-labextension, the extension does not connect with a LocalCluster running within the container. The symptoms seen are similiar to the ones exhibited in Issue #214.

What you expected to happen:

I expected to use the various view of dask-extension to view LocalCluster operation.

Minimal Complete Verifiable Example:

These are the steps I took:

Setup

Start docker container with Jupyterlab

docker run -p 8888:8888 -p 8787:8787 -e JUPYTER_ENABLE_LAB=yes jupyter/scipy-notebook:lab-3.2.5

Install dask-labextension

Connected to the JupyterLab server running in the container by using the URL provided in the start up message. Opened a terminal window in Jupyterlab and executed setup instructions for JL 3.x

pip install dask-labextension

Uploaded this Dask notebook to run a LocalCluster

Attaching the notebook used in the test. Rename file to change extension from .txt to .ipynb to use notebook. test_dask_local2.txt

Symptoms

Upon refreshing the browser page, see pop-up with this message

Dask Server Error
Failed to list clusters: might the server extension not be installed/enabled?

Clicked on DASK icon in left navigation bar and then on magnifying glass icon. dask-labextension does not recognize the cluster.

image

However, the DASK scheduler dashboard is accessible via a separate browser window.

image

Another symptom, unable to create a LocalCluster by clicking on New button. Click on the button and nothing appears to happen.

Tested lab-extenstion==5.0.2

As a test, I tried a prior release of dask-labextension==5.0.2. With this release, "greyed out buttons" appear however, they never become active.

image

Anything else we need to know?:

Per guidance found in Issue #214, imported dask-labexension in a python program

$ python
Python 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:20:46) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dask_labextension
>>> dask_labextension.__version__
'5.1.0'
>>> 

Environment:

Software setup

$ pip list | grep jupyter
jupyter-client                7.1.0
jupyter-core                  4.9.1
jupyter-server                1.13.1
jupyter-server-proxy          3.2.0
jupyter-telemetry             0.1.0
jupyterhub                    2.0.0
jupyterlab                    3.2.5
jupyterlab-pygments           0.1.2
jupyterlab-server             2.9.0
jupyterlab-widgets            1.0.2

$ jupyter --version
Selected Jupyter core packages...
IPython          : 7.30.1
ipykernel        : 6.6.0
ipywidgets       : 7.6.5
jupyter_client   : 7.1.0
jupyter_core     : 4.9.1
jupyter_server   : 1.13.1
jupyterlab       : 3.2.5
nbclient         : 0.5.9
nbconvert        : 6.3.0
nbformat         : 5.1.3
notebook         : 6.4.6
qtconsole        : not installed
traitlets        : 5.1.1

$ pip list | grep "\(dask\|distributed\)"
dask                          2021.12.0
dask-labextension             5.1.0
distributed                   2021.12.0

Jupyter Extensions

$ jupyter labextension list
JupyterLab v3.2.5
/opt/conda/share/jupyter/labextensions
        jupyter-matplotlib v0.10.4 enabled OK
        dask-labextension v5.1.0 enabled OK (python, dask_labextension)
        @jupyter-widgets/jupyterlab-manager v3.0.1 enabled OK (python, jupyterlab_widgets)
        @jupyterlab/server-proxy v3.2.0 enabled OK

$ jupyter serverextension list
config dir: /opt/conda/etc/jupyter
    dask_labextension  enabled 
    - Validating...
      dask_labextension 5.1.0 OK
    jupyter_server_proxy  enabled 
    - Validating...
      jupyter_server_proxy  OK
    jupyterlab  enabled 
    - Validating...
      jupyterlab 3.2.5 OK

Chrome Browser used in test

Version 96.0.4664.110 (Official Build) (x86_64)
jimthompson5802 commented 2 years ago

Additional data point. I noticed this in the browser developer mode console right after clicking on the "magnifying glass" icon: image

jimthompson5802 commented 2 years ago

For the record was able to resolve this issue. Resolution is to bake into the image the dask-labextension package and not install it after the docker container started. This documentation page was the key to resolving the issue.