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.
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 havingdoJobCollection
import the parent session's lib paths.