Closed sjspielman closed 3 months ago
The docker image should be configured to install packages at the system level (not in an renv). So another option is to modify .Rorofile
to not run the activate()
function if an environment variable (say OPENSCPCA_DOCKER
) is set and then set that variable in the Dockerfile.
While working on #538, I went to test out running the
hello-python
andhello-R
docker images, and had difficulty running the analysis in the thehello-R
image. The image built fine, but there were issues withrenv
-I built the image and launched a container with:
Then in the container:
Which led to:
Packages were indeed installed from the
renv.lock
file as expected, but because of this line in the Dockerfile, there is norenv
cache that knows about it. https://github.com/AlexsLemonade/OpenScPCA-analysis/blob/8ec8fa0dde4670bc440fefa58cf8d3e75aa6b984/analyses/hello-R/Dockerfile#L12-L13 As a consequence, when this script tries to load up therenv
environment since we still have.Rprofile
activating it, we end up with errors that packages aren't installed.Off the top of my head, here's one not-awful idea and one bad idea, and one idea whose quality I'm unsure of, to address this...
.Rprofile
file so thatrenv
doesn't get activated.Rscript -e 'renv::restore()'
intorun_hello-R.sh
. This seems like a not great idea, since we'd have to maintain something like this in every R module.