Open austinmw opened 3 years ago
@austinmw Have you found a solution for this?
@austinmw I have been trying to figure this out as well, have you found a solution or work-around?
Agree...having difficulty running Dash in sagemaker as well and think its related to proxy IP addresses. Thought running it in in a regular jupyter notebook would help, but its not. I'm going to have to move my development outside sagemaker unless anyone has suggestions!
January 2023, this is still an issue for JupyterLab v3 sessions in AWS Sagemaker.
@austinmw if you are still hitting this issue, one workaround is to set the following parameter requests_pathname_prefix
to be equal to /proxy/*port-number*
in your JupyterDash object (or Dash more generally).
To expand on why it is stuck on loading, since Dash is a react based app and it loads most of the visuals after the page has already loaded. When it is trying to load the visuals (through other API calls to dash), it is looking for those artifacts at the root of the sagemaker instance (which sagemaker won't allow/ isn't expecting). So you need to set the requests pathname prefix to essentially make all of those artifacts go through the proxy.
As a concrete example of what is happening:
before you change the requests path it was trying to pull a javascript library called foobar.js from this url: https://sagemaker-url.sagemaker.aws/foobar.js
but it should be using this url: https://sagemaker-url.sagemaker.aws/proxy/*port-number*/foobar.js
this is what it would look like for the default port config when you define your app.
app = JupyterDash(__name__ , requests_pathname_prefix='/proxy/8050/')
Hi, is it possible to use Plotly's Dash framework in a SageMaker notebook (standard or lab)? Dash offers 3 different modes,
inline
(in cell),external
(new tab), andjupyterlab
(new frame), but I've been unsuccessful in deploying all three. I suspect there's a compatibility issue with the proxy address SageMaker uses, but have not been able to get to the root of the issue.Code example:
Dash has a large community, and the ability to design python-native interactive dashboards for model evaluation and other use cases I believe makes this worth finding a solution for.