jupyter-dash
jupyter-dash copied to clipboard
infer_jupyter_proxy_config() misbehaviour in Binder notebook with "Run all cells"
I am trying to run a Dash web app in a Notebook in BinderHub.
If I execute cells one by one (by repeatedly hit Shift-Enter) from top to bottom, everything works (apart a minor quirk of skipping a number when executing the cell containing the call to JupyterDash.infer_jupyter_proxy_config()). The app is eventually displayed and everything works.
However, if I execute the notebook with "Run all cells", the cell containing the call to JupyterDash.infer_jupyter_proxy_config() appears to be skipped only to be executed after all the other cells have executed.
This is reflected in its sequence number and in the fact that any other code in the same cell seems not to have taken effect.
I am also trying to use Voila, so that only the dashboard is shown.
When I run the notebook under Voila, the execution appears to stop at the cell containing JupyterDash.infer_jupyter_proxy_config().
I see that in _request_jupyter_config() messages are exchanged with the IPython kernel to glean the information, but I am not competent enough to see the cause of the misbehaviour.
I was wondering if one could not get the same info in a safer (?) way from notebook.notebookapp.list_running_servers.
Hi @ptocca, if you're still working on this, I'd recommend trying to place JupyterDash.infer_jupyter_proxy_config() in a cell by itself.
I looked at the notebook.notebookapp.list_running_servers approach originally, but when multiple notebook servers are running, I never found a reliable way to identify which server the currect kernel is associated with. If someone works out how to do this, I would be interested in using this method as it would be less magical that the current implementation.