jupyter-dash icon indicating copy to clipboard operation
jupyter-dash copied to clipboard

[Feature Request] Ability to Run Jupyter Dash in a Kernel's Python Environment

Open danielyahn opened this issue 3 years ago • 0 comments

Per Jupyterhub documentation, it's recommended to have 2 separate environments for the single-user server and the user's kernel.

Jupyterhub requires jupyter-server-proxy to properly route the traffic. It is also recommended to install jupyter-server-proxy in the server environment.

However, in the two-python-environment set up, jupyter-dash can't detect the proxy unless I apply a workaround.

Proposed change

Assuming that

  • jupyter-dash is installed in user's kernel
  • jupyter-server-proxy is installed in server's environment

Provide a configuration option to Jupyter-dash so that it can know about existence of the Jupyter-server-proxy in server's environment

Alternative options

Option 1

Manually update some settings before running JupyterDash.infer_jupyter_proxy_config()

I've used a cell that looks like

app.default_requests_pathname_prefix = "user/<user name>/proxy/8050/"
app.default_server_url = "https://<jhub-server-url>"
app.server_url = "https://<jhub-server-url>"
app.infer_jupyter_proxy_config()

Option 2

Install a no-op package that has the same name in the kernel environment. I created a jupyter-server-proxy but without any contents, and installed it in the same kernel environment, so that jupyter-dash can know about its existence.

Suggest a solution

I think the import assumes that jupyter-server-proxy and jupyter-dash are running in the same python environment. It would be nice if we can provide the location of jupyter-server-proxy installation through configuration and jupyter-dash can do its check.

danielyahn avatar Sep 15 '22 12:09 danielyahn