rocker-org / rocker

R configurations for Docker
https://rocker-project.org
GNU General Public License v2.0
1.45k stars 273 forks source link

singularity container broken? #431

Closed DrorSh closed 3 years ago

DrorSh commented 3 years ago

Following the tutorial on the website

singularity pull --name rstudio.simg docker://rocker/rstudio:latest
singularity exec rstudio.simg rserver --www-address=127.0.0.1

I get this error:

[rserver] ERROR system error 11 (Resource temporarily unavailable) [description: Could not acquire revocation list file lock]; OCCURRED AT rstudio::core::Error rstudio::server::auth::handler::initialize() src/cpp/server/auth/ServerAuthHandler.cpp:569; LOGGED FROM: int main(int, char* const*) src/cpp/server/ServerMain.cpp:674
DrorSh commented 3 years ago

I ended up forking a repo that builds a container from scratch. See here: https://github.com/DrorSh/singularity-rstudio-base

On Thu, Jan 7, 2021 at 11:49 PM Mike Cuoco notifications@github.com wrote:

@DrorSh https://github.com/DrorSh did you end up solving this? I'm running into the same error

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rocker-org/rocker/issues/431#issuecomment-756544116, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXHBYVSACYEAYYZKYMVE23SY2FFDANCNFSM4U4VNMGA .

cboettig commented 3 years ago

Thanks @DrorSh . Just a note that a PR would be welcome as well, see https://github.com/rocker-org/rocker-versioned2

DrorSh commented 3 years ago

I'll be happy to contribute, but I couldn't actually get rocker to work. I am installing Rstudio from scratch on an ubuntu image. @granek might be able to help here.

cboettig commented 3 years ago

@DrorSh no worries, we'll take a look at your container.

Note that the versioned stack, including rstudio images, is now already based on ubuntu (20.04) since R 4.0.0.

granek commented 3 years ago

It has been a while since I wrestled with this error, so my memory is a bit rusty. If I remember correctly, you get that error when you try to run multiple instances of rserver on the same machine, or possible if different users try to run multiple instances on the same machine, because rserver puts a lock file somewhere common (/tmp I think).

It is relatively easy to fix with RStudio >=1.3 by setting up a temporary directory and running rserver with --server-data-dir, like this (the trap line cleans up the temp directory when the container exits):

export TMPDIR="$(mktemp -d)"
trap "{ rm -rf $SESSION_INFO_FILE $TMPDIR; }" EXIT
rserver --server-data-dir "${TMPDIR}" 

You can put this in a bash script then set the bash script as the %runscript for your image, like I do in this script, which I set as the

You can do something similar with older versions of RStudio, but it is less elegant because you have to do it with bind mounting when you run the container.