Hello,
One of my users has tried out our test 1.6 Open OnDemand setup, and is encountering an issue with the Rstudio setup we have, which uses singularity and a largely unmodified script.sh.erb from github.
The user has a .Renviron file in their home directory which has a single line:
R_LIBS_USER=/path/to/user/libdir/%v
When they start up an Rstudio session, the R_LIBS_USER variable does show as set when checking with Sys.getenv() (complete with proper version replacing the ‘%v’ variable), but does not show up when checking .libPaths(). It’s my understanding that the .libPaths() should include the R_LIBS_USER path at start time, but I’m not an R user, so I may be misunderstanding that.
Their current setup has apparently been working properly for them when running command line R on our cluster.
In digging in to try and find out what was happening, I see from the bc_example_rstudio script.sh.erb that the rsession.sh wrapper file should be written with the final line:
exec rsession --r-libs-user “${R_LIBS_USER}” “${@}”
In checking the rsession.sh files generated by my setup, the final line of the wrapper is:
exec rsession --r-libs-user “” “${@}”
So it looks like the ${R_LIBS_USER} variable isn’t being set by the time the wrapper is written. I haven’t been able to determine from the example files, however, at what point it would get that value from the user’s .Renviron file, if that’s what should be done.
It does look like singularity is properly mounting the external paths needed to read the home directory and the path specified in the .Renviron file. It seems like it should be a simple matter for the contents of the .Renviron file to be passed to the script, but I’m not certain if there might be something singularity or R-specific that’s causing an issue.
Thank you for any suggestions.