Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is it possible to do binderhub-style RStudioWeb reverse proxying? #18

Open
ctb opened this issue Jul 4, 2018 · 13 comments
Open

is it possible to do binderhub-style RStudioWeb reverse proxying? #18

ctb opened this issue Jul 4, 2018 · 13 comments
Labels
enhancement New feature or request

Comments

@ctb
Copy link
Contributor

ctb commented Jul 4, 2018

e.g. support RStudio inside of this JupyterHub a la https://github.com/binder-examples/r

inquiring minds would like to know ;)

Current status (added by CH)

Currently it is not possible to simply use RStudio with TLJH because it requires a feature that is only available in the "paid" version of RStudio (listening on Unix sockets), see #18 (comment)

@betatim
Copy link
Member

betatim commented Jul 4, 2018

You need to add https://github.com/jupyterhub/nbrsessionproxy to the things installed (and activated) in the user's environment.

@yuvipanda
Copy link
Collaborator

It's a little bit more complicated, because of lack of network isolation. In binder, RStudio listens only on localhost, and jupyter listens on 0.0.0.0 & proxies back authenticated requests. Here, there's no network isolation, so everyone could talk to everyone's RStudio...

If RStudio supports listening on Unix sockets, this would work!

@yuvipanda
Copy link
Collaborator

Apparently it can listen on Unix sockets, but it's a feature of RStudio Pro :( rstudio/rstudio#1635

@yuvipanda
Copy link
Collaborator

yuvipanda commented Jul 4, 2018

Two ways out of this:

  1. Use a network namespace. This is sortof what docker does. We can use it without docker, but it's a bit of work!
  2. Use iptables' owner filter (or requivalent nftables packet metainformation filter) to block all local packets to the rstudio port, except packets from processes running as the same user.

I don't like either option, since it adds complexity to the stack. I also love both options, since they let me play with linux networking in funky ways :D

The best way to do this however is to convince RStudio to support listening on unix sockets in the AGPL version.

@yuvipanda
Copy link
Collaborator

Also /cc @ryanlovett, who did most of nbrsessionproxy.

@ryanlovett
Copy link

The best way to do this however is to convince RStudio to support listening on unix sockets in the AGPL version.

Agreed.

One could run RStudio Server on the same machine The Littlest JupyterHub is running on, and then users could manually visit either RStudio Server directly or through their notebook server on /user-redirect/proxy/8787 (i.e. the RStudio Server port). In both cases they'd need to login.

@yuvipanda
Copy link
Collaborator

I'm going to close this as out of scope for TLJH since it is difficult to do correctly. However, this is a really important use case, so if you have a specific class or something that would use this, we should talk about making another JupyterHub distribution targetted at that use case...

@ctb
Copy link
Contributor Author

ctb commented Jul 13, 2018 via email

@yuvipanda
Copy link
Collaborator

@ctb yeah, docker is the easiest way to do this. https://github.com/jupyterhub/jupyterhub-deploy-docker exists and should work for this, but it needs a little bit more love & care I think.

@yuvipanda yuvipanda reopened this Jul 20, 2018
@norcalbiostat
Copy link

I would also like to use TLJH to run R Studio for 2-6 classes/semester each under 50 students and a variety of skills training workshops throughout the year (for campus and non-campus participants).

I would use R studio via TLJH in the same way it is used in Data8. I provide an interact link to the Rmd file (that originates in a github repo), students click on the link work on their analysis code file in an interactive manner, knit the file to PDF and download. Then as they progress they can login and start a new Rmarkdown file on their own.

Around 2012-13 my campus setup a virtual computing environment for programs like Mathematica, but our wifi infrastructure sucked so noone used the VLC. IT shut it down and are not willing to discuss starting it back up again. I hope to use this as a demonstration of the increased need for a virtual computing server and get it back going.

@choldgraf
Copy link
Member

A quick thought here - if RStudio is officially not supported by TLJH, I think we should have a note in the documentation somewhere saying this. A lot of people will probably want RStudio so I'd rather just be up front and tell them "this probably isn't for you if you need RStudio". What do you all think?

@norcalbiostat
Copy link

I agree with @choldgraf - while i would love to see a Rstudio version of what TLJH can do if this isn't the way then that's fine.
Does this mean that the solutions being discussed after the workshop aren't going to pan out (at least in time for the fall semester?) I just found out that Rstudio server pro is free for teaching purposes. I got a license and everything.

@choldgraf
Copy link
Member

hey all - just a note that I edited the top-level comment to reflect the current status of this issue. Folks were discussing a Docker-based approach, but I'll leave further conversation about that for a different project, since TLJH is explicitly not using Docker. Feel free to edit if there are better ways to word this

@yuvipanda yuvipanda added the enhancement New feature or request label May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants