Closed davidsmejia closed 1 year ago
I tried it with smasher
image first - both renv.lock saving/loading stages went well.
The general process was:
docker run --user root -it arkccdl/dr_transcriptome /bin/bash -c "Rscript -e '$(cat ./workers/R/renv/save_lock_file.R)' > /dev/null; cat /home/user/renv.lock" > workers/R/renv/transcriptome.lock
COPY workers/R/renv/smasher.lock renv.lock
COPY workers/R/renv/load_lock_file.R .
RUN Rscript load_lock_file.R
Lock file saving script:
options(warn = 2)
options(repos = structure(c(CRAN = "https://cloud.r-project.org")))
options(Ncpus = parallel::detectCores())
devtools::install_version("renv")
renv::init()
renv::snapshot()
Lock file loading script:
options(warn = 2)
options(repos = structure(c(CRAN = "https://cloud.r-project.org")))
options(Ncpus = parallel::detectCores())
devtools::install_version("renv")
renv::consent(provided = TRUE)
renv::restore()
Another attempt on salmon
(and also transcriptome
) image failed on renv.lock
generation stage:
The following package(s) were not installed successfully:
[crancache]: package 'crancache' is not available
[spp]: package 'spp' is not available
[preprocessCore]: package 'preprocessCore' is not available
[EBSeq]: package 'EBSeq' is not available
[limma]: package 'limma' is not available
[oligo]: package 'oligo' is not available
[GenomicRanges]: package 'GenomicRanges' is not available
[ShortRead]: package 'ShortRead' is not available
[AnnotationDbi]: package 'AnnotationDbi' is not available
[tximport]: package 'tximport' is not available
You may need to manually download and install these packages.
The following required packages are not installed:
codetools [required by foreach]
Consider reinstalling these packages before snapshotting the lockfile.
Error in snapshot(project = project, library = libpaths, repos = repos, :
aborting snapshot due to pre-flight validation failure
Calls: <Anonymous> -> snapshot
Traceback (most recent calls last):
3: renv::init()
2: snapshot(project = project, library = libpaths, repos = repos,
prompt = FALSE)
1: stop("aborting snapshot due to pre-flight validation failure")
Execution halted
It seems that the original images need to be fixed and rebuilt in order to get them migrated.
In general the approach looks promising. More work needs to be done for wider image coverage.
Context
In order to pin dependencies for R docker images we need to create and restore from the renv file.
Solution or next step
Let's work through and test how that behaves in the refinebio environment. Select a docker image to test first, then please write down notes on this issue before closing. Note if it was successful or not.