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

should I install another R server in order to use RStudio? #69

Open dashpot4 opened 5 years ago

dashpot4 commented 5 years ago

I tried to install this on my jupyterhub server with docker but 500 error occurred. According to the log, it could not find rserver on PATH.

What should I do for it?

xhochy commented 5 years ago

You need to install rserver separately, e.g. from https://www.rstudio.com/products/rstudio/download-server/.

mathematicalmichael commented 4 years ago

I have tried installing and still can't make sense of it. I've tried installing it before and after rstudio. i either get PATH errors, or R SUICIDE errors such as in #62

what is the current state of creating a Dockerfile to install RStudio for launch from JLab?

dashpot4 commented 4 years ago

I have tried installing and still can't make sense of it. I've tried installing it before and after rstudio. i either get PATH errors, or R SUICIDE errors such as in #62

what is the current state of creating a Dockerfile to install RStudio for launch from JLab?

For me, I merely installed "rstudio-server" after installing "jupyter-rsession-proxy" on my docker system based on "jupyter/datascience-nodebook" and it has been worked properly.

mathematicalmichael commented 4 years ago

@dashpot4 thanks! I finally got it working. If anyone stumbles across this in the future... The jupyterlab-server-proxy gave me a lot of trouble and I found a solution eventually in their issues.

FROM jupyter/r-notebook

RUN python3 -m pip install jupyter-rsession-proxy
RUN cd /tmp/ && \
    git clone --depth 1 https://github.com/jupyterhub/jupyter-server-proxy && \
    cd jupyter-server-proxy/jupyterlab-server-proxy && \
    npm install && npm run build && jupyter labextension link . && \
    npm run build && jupyter lab build

# install rstudio-server
USER root
RUN apt-get update && \
    curl --silent -L --fail https://download2.rstudio.org/rstudio-server-1.1.419-amd64.deb > /tmp/rstudio.deb && \
    echo '24cd11f0405d8372b4168fc9956e0386 /tmp/rstudio.deb' | md5sum -c - && \
    apt-get install -y /tmp/rstudio.deb && \
    rm /tmp/rstudio.deb && \
    apt-get clean && rm -rf /var/lib/apt/lists/*
ENV PATH=$PATH:/usr/lib/rstudio-server/bin
USER $NB_USER
trallard commented 4 years ago

have a Jupyterhub deployed on an AKS cluster and I decided to add Rstudio through jupyter-rsession-proxy. I created a Docker image that works just fine. But when using this image on the AKS JupyterHub and try to access user/{myuser}/rstudio/ I keep getting a 500: internal server error could not start rstudio on time.

I am sure I am missing something obvious but I cannot figure out what it is 🤔

Also when looking at the pod logs I only get this: so not super helpful

jupyterhub-deploy_azcli_—_Python_meets_R

@mathematicalmichael I have used your Docker image in an attempt to launch Rstudio from a deployed JupyterHub and I keep getting the so dread 500 error.

As you reported also I am facing the errors from #62 is trying to start from the terminal:

jovyan@jupyter-trallard:~$ rsession --standalone=1 --program-mode=server --log-stderr=1 --session-timeout-minutes=0 --user-identity=jovyan --www-port=41109
24 Aug 2019 23:37:48 [rsession-] ERROR system error 2 (No such file or directory) [path=]; OCCURRED AT: rstudio::core::Error rstudio::r::session::discoverR(rstudio::r::session::RLocations*) /home/ubuntu/rstudio/src/cpp/r/session/RDiscovery.cpp:62; LOGGED FROM: int main(int, char* const*) /home/ubuntu/rstudio/src/cpp/session/SessionMain.cpp:1841

Would you have any insight on why this might be happening?

trallard commented 4 years ago

I believe @yuvipanda has also seen this in the past (from a quick check on this repo's issues)


Update: I ran rstudio-server verify-installation and got

jovyan@jupyter-trallard:~$ rstudio-server verify-installation
/usr/lib/rstudio-server/bin/rsession: Relink `/opt/conda/lib/R/lib/../.././libgfortran.so.4' with `/lib/x86_64-linux-gnu/librt.so.1' for IFUNC symbol `clock_gettime'

Update 2: inspecting the Docker image used while running it locally (with docker run) I get the same message on my terminal (about relinking libgfortran) yet Rstudio does launch

mathematicalmichael commented 4 years ago

@trallard hmmmm. that's odd. I pulled the image on a different computer and ran it with Docker directly, was able to launch RStudio just fine. Image (large, built on top of tensorflow-notebook): mathematicalmichael/math-user:stable Built the same day I made the comment.


Trying to re-build docker image from the Dockerfile I pasted, just as a debugging step.

docker build -t math-user:test --build-arg JUPYTERHUB_VERSION=1.0 .
docker run --name math-user --rm -d -p 8880:8888 -v /Users/michael.pilosov/repos:/home/jovyan/work math-user:test start-notebook.sh --NotebookApp.password=sha1:e13f9e82c792:c86ec9e5b95b945b502073e1e3c410ccef6ea2e0

Rstudio connects just fine.

I ran rstudio-server verify-installation and got

/usr/lib/rstudio-server/bin/rsession: Relink `/opt/conda/lib/R/lib/../.././libgfortran.so.4' with `/lib/x86_64-linux-gnu/librt.so.1' for IFUNC symbol `clock_gettime'

Dunno if that is helpful, but I hope it's something.

trallard commented 4 years ago

I got exactly the same message. The docker image worked just fine running locally through docker run.

The problem was when using this within a Kubernetes deployed JupyterHub. It would just not work. I ended up making a number of changes to both the Docker image and my hub and now it works. Might need to do some tracing to see what was actually happening

mathematicalmichael commented 4 years ago

Oh hm, I’ve never deployed on kubernetes before but definitely have every intention on eventually learning how to do so, using the same images, so if you do eventually get to the bottom of it, I would be very interested in finding out what you did

trallard commented 4 years ago

Aha that might have been it. Will dig deeper when I have more time and maybe I can add this to the tips section of the z2jh docs ?

cc @yuvipanda