AlexsLemonade / refinebio

Refine.bio harmonizes petabytes of publicly available biological data into ready-to-use datasets for cancer researchers and AI/ML scientists.
https://www.refine.bio/
Other
128 stars 19 forks source link

Test restoration of an existing renv.lock file #3171

Closed davidsmejia closed 1 year ago

davidsmejia commented 1 year ago

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.

arkid15r commented 1 year ago

I tried it with smasher image first - both renv.lock saving/loading stages went well.

The general process was:

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.