I am using Singularity 3.0 and trying to pull a container image from DockerHub and run it on a university cluster. I followed this recipe to get started.
singularity pull --name rstudio-3.5.2.sif docker://rocker/rstudio:3.5.2
singularity exec --bind example-project-1/:/home/rstudio/ rstudio-3.5.2.sif rserver --www-port 8787
The container process starts but when I try to connect via a browser I get the following error log.
01 Jan 2019 12:07:22 [rsession-pughdr] ERROR system error 30 (Read-only file system) [path=/home/pughdr/.rstudio, target-dir=]; OCCURRED AT: rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const /home/ubuntu/rstudio/src/cpp/core/FilePath.cpp:846; LOGGED FROM: rstudio::core::FilePath rstudio::core::system::userSettingsPath(const rstudio::core::FilePath&, const string&) /home/ubuntu/rstudio/src/cpp/core/system/PosixSystem.cpp:486
01 Jan 2019 12:07:22 [rsession-pughdr] ERROR system error 30 (Read-only file system) [path=/home/pughdr/.rstudio, target-dir=]; OCCURRED AT: rstudio::core::Error rstudio::core::FilePath::createDirectory(const string&) const /home/ubuntu/rstudio/src/cpp/core/FilePath.cpp:846; LOGGED FROM: int main(int, char* const*) /home/ubuntu/rstudio/src/cpp/session/SessionMain.cpp:1689
Seems that the file system in the container is only read-only. How do I build (or run) the container such that the container's file system is writable?
Update:
I was able to get the RStudio Server running on the university cluster as follows.
singularity exec --home my-project-directory rstudio-3.5.2.sif rserver --www-port 8787
This seems to work because Singularity automatically mounts the user's home directory on the host into the container and I redefined my home directory to be my-project-directory
in the above.
However I still cannot install R packages into the container as the file system is not writable.
> install.packages(c("plyr", "dply", "tidyr", "ggplot2"))
Installing packages into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages :
'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead? (yes/No/cancel) cancel
Error in install.packages : unable to install packages
Original question still stands: how can I create a Singularity 3.* container that has a writable filesystem? If this is not possible, explanation as to why would be appreciated.
--writable
flag was deprecated in Singularity 3.0 and requiressudo
rights (which I don't have on university cluster) for Singularity 2.5. – Galileo