aws / studio-lab-examples

Example notebooks for working with SageMaker Studio Lab. Sign up for an account at the link below!
https://studiolab.sagemaker.aws
Apache License 2.0
624 stars 181 forks source link

Unable to use dask-labextension dashboard #39

Open scottyhq opened 2 years ago

scottyhq commented 2 years ago

First of all, thank you for studio-lab, it is an amazing resource and generally works very smoothly!

Describe the bug JupyterLab extension for Dask is a fantastic resource that helps with diagnostics for parallel computations. Unfortunately it seems the dashboard is nonfunctional due to SageMaker network settings as detailed in this existing issue https://github.com/dask/dask/issues/5432.

To Reproduce

  1. Following the docs here
    conda activate studiolab
    conda install -c conda-forge dask distributed dask-labextension
  2. Stop runtime.
  3. Start runtime
  4. In a notebook start a dask cluster:
    from dask.distributed import Client
    client = Client()
    client
  5. navigate to: https://SESSSIONIDHERE.studio.us-east-2.sagemaker.aws/studiolab/default/jupyter/proxy/8787/status

Expected behavior Dashboard diagnostic plots should appear below the active toolbar on the proxied webpage or via the labextension plots.

Screenshots

Screen Shot 2022-01-04 at 3 53 39 PM

See additional screenshots in linked issue (https://github.com/dask/dask/issues/5432)

Desktop (please complete the following information):

Additional context There is a recent blog post detailing how to do a custom setup, but it would be fantastic if this just worked out of the box with studiolab. https://aws.amazon.com/blogs/machine-learning/machine-learning-on-distributed-dask-using-amazon-sagemaker-and-aws-fargate/

samx18 commented 2 years ago

Thanks for trying out SageMaker Studio Lab and we are glad that you are liking it. Some Jupyter extensions including Dask extension require Node JS. Currently Node JS is not available in currently release. We have that on the roadmap for a future release. However, this extension also requires additional network configurations ,Studio Lab was intended for local experimentation as such at present we do have this capability. The workarounds mentioned in the blog post are applicable to standard AWS SageMaker Studio (Not the SageMaker Studio Lab) which allows additional deployment options.

ellisonbg commented 2 years ago

This should work, it may just be that the project needs to be restarted for the Jupyter server proxy to pickup the dask extension. Can you try that?

icoxfog417 commented 2 years ago

I confirmed that we have problems to overcome for working dask-labextension in Studio Lab. The websocket connection seems not be allowed in Studio Lab. As same as https://github.com/dask/dask/issues/5432, I could view the dashboard, but I was getting a websocket error.

image

Reproduce procedure is same as @scottyhq and I tried restart the JupyterLab as @ellisonbg proposed.

image

@samx18 pointed the Node.js requirements but JupyterLab 3.0 or greater does not depend on it.