jupyterhub / jupyter-rsession-proxy

Jupyter extensions for running an RStudio rsession proxy
BSD 3-Clause "New" or "Revised" License
118 stars 87 forks source link

Open multiple Rstudio sessions for a single user from Jupyter #58

Open vnijs opened 5 years ago

vnijs commented 5 years ago

When I'm running Rstudio from a docker container it is straightforward to link a 2nd, 3rd, etc. session for a single user to a different port. If you click the Rstudio icon/launcher a 2nd time now, it disconnects the "old" Rstudio session. Is it possible to automatically assign Rstudio to another port/proxy when starting multiple session for a single user?

yuvipanda commented 5 years ago

Heya! Since we switched to using rserver (rather than rsession) we can't run multiple rserver processes in the same container :( I don't really know of a workaround for this, unfortunately.

What use case do you have for this?

vnijs commented 5 years ago

The recommended workflow in RStudio is to use "projects" (https://r4ds.had.co.nz/workflow-projects.html). It is pretty common to want to view multiple projects at the same time. E.g., for a student to review an example project and also a project for an upcoming assignment. This requires multiple Rstudio sessions.

In a locally running docker container I just run another process on another port (e.g., 8788 while another process runs on 8787). In several issues posted on GitHub I see references to something like the below and was hoping that could be used for this setting also where a new port/proxy is picked each time a user tries to start a new Rstudio session.

rserver --www-port=58107

yuvipanda commented 5 years ago

Hmm, I see. So right now, going to /rstudio just shows you the one running session. How would you differentiate different rstudio sessions? /rstudio/1, /2, etc? or?

vnijs commented 5 years ago

Simple numbering seems fine. Rstudio does something similar for a shiny app that is launches. e.g.,

/rstudio/p/7638b8dc/

yuvipanda commented 5 years ago

Ok, I think the way to do this is:

  1. Have a new endpoint - /rserver, that will setup a new session (/rserver/<num>) and redirect you to it
  2. Have /rstudio always refer to the first session - this matches current behavior.

This will need a bunch of feature additions jupyter-server-proxy:

  1. Support multiple processes that are dynamically known and registered - so python code needs to be able to register other proxy URLs. This is similar to @ian-r-rose's ask in https://github.com/jupyterhub/jupyter-server-proxy/issues/70
  2. Some customization of the JupyterLab extension, so you can actually see all the sessions you have open right now.
ssssssophia commented 5 years ago

Ok, I think the way to do this is:

  1. Have a new endpoint - /rserver, that will setup a new session (/rserver/<num>) and redirect you to it
  2. Have /rstudio always refer to the first session - this matches current behavior.

This will need a bunch of feature additions jupyter-server-proxy:

  1. Support multiple processes that are dynamically known and registered - so python code needs to be able to register other proxy URLs. This is similar to @ian-r-rose's ask in jupyterhub/jupyter-server-proxy#70
  2. Some customization of the JupyterLab extension, so you can actually see all the sessions you have open right now.

May I ask how to have a new endpoint - /rserver ?

ananthajanakiraman commented 4 years ago

Hi, It looks like this issue is still open that we cannot open multiple rstudio session for single user from Jupyterlab. Is there any workaround in the interim?

cdecoux commented 3 months ago

Would love to have this too. The rest of Jupyter usage works great for multi-tasking and solely limited by the resources of the server. RStudio is the only one that has a limited ability for multi-tasking.