-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify .Rprofile and .Renviron when using singularity #855
Comments
Have a look at the (epic, long) help page for |
Thank you very much for your answer! I added an The output of the Furthermore, when I try to run
Do you have any idea what else I could try? |
Yes, that can be a problem. These days I work single-user, mostly, and am root here but R is indeed happy to run off a read-only file system. But let's go back to $ echo "randomdoodle=bar78" > /tmp/r/renviron_demo.txt
$ R_ENVIRON_USER=/tmp/r/renviron_demo.txt Rscript -e 'Sys.getenv("randomdoodle")'
[1] "bar78"
$ |
Thank you very much for your support! I am afraid it is still not working.. I have added
to the script shown here and it still does not work... Do I have to modify the |
@nickhir Were those environment variable settings added to the rsession.sh script (that also sets R_LIBS_USER)? It seems setting R_PROFILE_USER and R_ENVIRON_USER there have the intended effect (with the rstudio_4.2.sif image listed in the job script). Note the path /rds/user/nh608/hpc-work/software/R/ has to exist in the container (in case it's not being mounted by default). |
If the singularity or apptainer command includes the --cleanenv option, then these environment variables will not be passed into the container (assuming they are not set in the rsession.sh script that is). Set the following instead:
Or
Then they will always be passed into the container, whether the --cleanenv option is used or not. |
@nickhir An example is included in this PR: rocker-org/website#120 |
Updates the Singularity guide: * Set `rserver --server-user` in job script (rocker-org/rocker-versioned2#837) * Show where R_PROFILE_USER and R_LIBS_USER can be set (rocker-org/rocker-versioned2#855) * Use rocker/rstudio:4.4.2 * Specify `python3` instead of `python` (the latter may be python 2 or absent on some hosts) * Mention Apptainer * mktemp is simpler and portable-enough (GNU coreutils) for creating temp dirs * Simplify creation of various writable directories in container with `--scratch` and `--workdir` * Ensure R_LIBS_USER directory exists * no longer need to create readable database.conf (sqlite seems to be the default) * SLURM_CPUS_ON_NODE technically more correct than SLURM_JOB_CPUS_PER_NODE (though shouldn't make a difference with a single-node allocation) --------- Co-authored-by: eitsupi <50911393+eitsupi@users.noreply.github.com>
Hi all,
I have been using the workflow described here to run RStudio on our HPC. Its been working brilliantly so far and makes my life so much easier, so thank you for that!
There is only one thing that I cant get to work: I would like to modify the
.Rprofile
and.Renviron
that is being used by the singularity image, but I cant get it to work. I have tried to place the.Rprofile
and.Renviron
into the directory specfied byR_LIBS_USER
, but the edits did not seem to make any impact (i.e. the settings I have specified inRprofile
did not show up when starting the singularity image.Any help how to accomplish this would be much appreciated!
Cheers!
The text was updated successfully, but these errors were encountered: