mllg / batchtools

Tools for computation on batch systems
https://mllg.github.io/batchtools/
GNU Lesser General Public License v3.0
170 stars 51 forks source link

Batchtools interacts poorly with packrat (probably renv also) #236

Open cfhammill opened 5 years ago

cfhammill commented 5 years ago

It seems like batchtools and packrat should be usable together for reproducible HPC. Packrat package environments help keep versions consistent within a project. Unfortunately batchtools doesn't work naturally with packrat.

Packrat intializes itself with a .Rprofile file, which must be visible from the analysis directory. Jobs submitted with batchtools start in the registry directory before moving to the analysis directory (or specified work dir). So packrat is never initialized and isolation is broken.

Additionally, the .libPaths() for the parent session aren't preserved in jobs, so any modification a user does to their path will potentially cause problems for the jobs.

This can be fixed either by changing directories prior to initiating the job (possibly by suggesting users add cd commands to their submit scripts), or by having doJobCollection import the parent session's lib paths.