rocker-org / binder

Template for RStudio on Binder / JupyterHub
GNU General Public License v2.0
69 stars 32 forks source link

What other features are missing still? #15

Closed cboettig closed 4 years ago

cboettig commented 7 years ago

@yuvipanda Following up on your other question from #10 here.

Clearly this depends on what we mean by 'feature'.

brooksambrose commented 7 years ago

Don't know if it's a feature of if it just needs to be documented, but in order to let users have unrestricted access to the contents of the repository, including .git, they must include a Dockerfile like this:

FROM w201rdada/portfolio:657d111
USER root
COPY . /home/rstudio/
RUN chown -R rstudio:rstudio * .*
USER ${NB_USER}

Where FROM is my own extension of rocker/binder. This is necessary because I assume the repo is cloned as root and not as rstudio, but perhaps that could be changed upstream to render this part unnecessary.

Giving users unrestricted access to the contents of the repo would seem to be the default desired behavior. Could this outcome be implemented in the base image?

cboettig commented 7 years ago

I believe this is documented already: http://mybinder.readthedocs.io/en/latest/dockerfile.html#preparing-your-dockerfile

problem is that COPY needs root. Generally it's good to avoid COPY since it breaks docker caching anyway, you can always do a git clone or wget in a RUN command to get data from an S3 bucket or github etc

syoh commented 6 years ago

@cboettig @yuvipanda

We have a working Jupyterhub installation, and we were wondering if there is a way to use this docker image as a drop-in image for Jupyterhub and launch R studio directly? This example for Binder seems encouraging.

In other words, a user would login through Jupyterhub and the first page they see would be R studio web-IDE as opposed to choosing RStudio Session from the menu.

cboettig commented 6 years ago

@syoh I think that should already work, provided you include the ?url=rstudio as in https://github.com/rocker-org/binder#opening-rstudio-once-binder-launches ?

yuvipanda commented 6 years ago

For JupyterHub, you should be able to set c.Spawner.default_url = "/rstudio" to have users directly get into RStudio when they log in.

syoh commented 6 years ago

@yuvipanda Cool! We will try that

erniee commented 6 years ago

For JupyterHub, you should be able to set c.Spawner.default_url = "/rstudio" to have users directly get into RStudio when they log in.

@yuvipanda

Would this be the same jupyterhub on kubernetes? I'm having the same issue as @syoh. I'm also using the rocker/binder image.

Would this work in my config.yaml?

singleuser:
  defaultUrl: "/rstudio"
  image:
    name: rocker/binder
    tag: 3.5.1

This is the error that I receive:

2018-09-24 22:28:26+00:00 [Warning] Error: failed to start container "notebook": Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"jupyterhub-singleuser\": executable file not found in $PATH"

yuvipanda commented 6 years ago

@erniee I think the python package 'jupyterhub' needs to be installed in the image. I think rocker/binder doesn't have that?

cboettig commented 6 years ago

@yuvipanda correct, that's not currently in the Dockerfile, maybe we should add that.

but I'm a bit lost here: what's the advantage of installing jupyterhub and adding a defaultUrl parameter in a separate config file to go directly to RStudio, vs just including the ?url=rstudio to go directly to rstudio (which is working for me in the current image, at least with binderhub). Sorry, I'm probably not following something obvious here about the context

erniee commented 6 years ago

Thank you @cboettig @yuvipanda I may be using the wrong image but I wanted to setup z2jh to use an image that could automatically launch rstudio. I may be using the wrong image to do that with. With your help, I have this working but I do have a problem, saving files to the persistent storage is still an issue.

The home directory is set to /home/rstudio and persistent storage is mounted on /home/jovyan

Please let me know if there is a better image to use.

cboettig commented 6 years ago

@erniee Maybe @yuvipanda is already aware of the details you refer to so I'm happy to defer to him, but it would help me to have a bit more understanding of what you are trying to do.

If you simply want to setup an RStudio server instance, and you want persistent data storage, the standard Rocker images work pretty well in this context. e.g. See the rocker docs for persistent storage: https://www.rocker-project.org/use/shared_volumes/. Sorry if I'm just missing the context of what you want to do, I'll defer to Yuvi on the jupterhub side.

syoh commented 6 years ago

@erniee and I figured out the issues and successfully created a rstudio image that can be launched directly. Thank you for your help @cboettig and @yuvipanda.

On a different topic, is there a way to make "Sign Out" button in Rstudio also sign the user out of Jupyterhub? This is a feature that would be useful (but may be difficult to implement) for using Rstudio within Jupyterhub. Right now, logging out of Rstudio gives an error: "Missing or incorrect token."