jupyter-rsession-proxy icon indicating copy to clipboard operation
jupyter-rsession-proxy copied to clipboard

Open multiple Rstudio sessions for a single user from Jupyter

Open vnijs opened this issue 6 years ago • 8 comments
trafficstars

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?

vnijs avatar Jan 21 '19 18:01 vnijs

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?

yuvipanda avatar Jan 21 '19 18:01 yuvipanda

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

vnijs avatar Jan 21 '19 19:01 vnijs

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?

yuvipanda avatar Jan 23 '19 04:01 yuvipanda

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

/rstudio/p/7638b8dc/

vnijs avatar Jan 23 '19 05:01 vnijs

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.

yuvipanda avatar Jan 23 '19 15:01 yuvipanda

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 ?

ssssssophia avatar Apr 01 '19 07:04 ssssssophia

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?

ananthajanakiraman avatar May 14 '20 19:05 ananthajanakiraman

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.

cdecoux avatar Apr 18 '24 15:04 cdecoux