sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.17k stars 216 forks source link

make it possible to run rstudio server in a similar way to Jupyter Classic and JupyterLab #4791

Open williamstein opened 4 years ago

williamstein commented 4 years ago
williamstein commented 4 years ago

A person suggested these names to me:

RAttic"? "RBitrary"? "RBuro"? "RCalc"? "RCalco"? "RCane"? "RDagio"? "RDeco"? "RDesk"? "RDesko"? "RDustio"? "RKaik"? "RLab"? "RLabo"? "RManiac"? "RMore"? "RPegio"? "RRival"? "RScenic"? "RStounding"? "RSudo"? "RTistic"? "RTuro"? "RVivo"?

williamstein commented 3 years ago

Some thoughts. We need to:

  1. Git clone the source from https://github.com/rstudio/rstudio
  2. Replace all instances of "RStudio" by a different name: RStudy. The word "study" is a synonym for "studio" (they are both types of rooms), but it has a more "academic oriented" connotation, so it's a good name. We should automate this.
  3. Build from source
  4. Figure out how to deal with any basepath and other proxying issues.
haraldschilly commented 8 months ago

If the server is installed, this script runs it. What's missing is to tie this up with these "named servers".

#!/usr/bin/env bash

if [[ ! -x /usr/lib/rstudio-server/bin/rserver ]]; then
    echo "rstudio-server is not installed";
    exit 1;
fi

PORT=${COCALC_RSERVER_PORT:-6006}

TMP=${TMP:-/tmp}/rserver
DATA="$HOME/.config/rserver"
mkdir -p $TMP/rserver
mkdir -p $DATA

cat <<EOF > $TMP/db.conf
provider=sqlite
directory=$DATA/db
EOF

exec env DISABLE_AUTH=true /usr/lib/rstudio-server/bin/rserver \
    --server-daemonize=0 \
    --auth-none=1 \
    --auth-encrypt-password=0 \
    --server-user=$USER \
    --database-config-file=$TMP/db.conf \
    --server-data-dir=$DATA \
    --server-working-dir=$HOME \
    --www-port=$PORT \
    --www-root-path=/$COCALC_PROJECT_ID/server/$PORT/ \
    --server-pid-file=$TMP/rserver.pid
williamstein commented 8 months ago

Nice! Some comments:

haraldschilly commented 8 months ago

does your script actually work?

I can use it like other servers, make a plot, run code, etc. Not sure what else you ask?

What's not working is support for more than one session. I suspect this only comes with the pro version.

williamstein commented 8 months ago

I can use it like other servers, make a plot, run code, etc. Not sure what else you ask?

It doesn't even start for me without modifying the rstudio-server account that is created when installing the software from upstream. However, you don't specify at all how you install rstudio-server. My point is that this script could work for some ways of installing rstudio, and won't work for other ways.

Yes, multiuser is basically the key feature of rstudio server pro...

haraldschilly commented 8 months ago

you don't specify at all how you install rstudio-server

I did step 3 on the page https://posit.co/download/rstudio-server/ when selecting "Debian/Ubuntu" at the top and then in the dropdown, "Debian 12 / Ubuntu 22"