AlexsLemonade / OpenScPCA-analysis

An open, collaborative project to analyze data from the Single-cell Pediatric Cancer Atlas (ScPCA) Portal
Other
5 stars 14 forks source link

Set Renv not to activate in docker images #548

Closed jashapiro closed 3 months ago

jashapiro commented 3 months ago

Closes #542

Here I added a bit of simple logic to avoid running renv/activate.R when we are in a Docker image. To do this I added an ENV variable named OPENSCPCA_DOCKER to all docker images, and then only source the activate script if the value is not set to TRUE.

The original issue isn't so much that related to caching in the docker images as that the files are being installed in the system library, so we don't want renv to be activated and looking for its own versions of the packages. If we were to do that, we would almost certainly run into path problems with files stored or not in the host filesystem.

I tested this in the hello-R image/script, but applied the same changes everywhere, including in the create-analysis-module.py script to cover future modules. I also included the ENV variable in the template, and in the hello-python module Dockerfile, even though it may not be needed there. Seemed a good place for just a bit of extra consistency.