Batchtools interacts poorly with packrat (probably renv also)

Open
#236 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
hpc

Research direction

Start at doJobCollection and trace how batchtools sets the job's initial and analysis working directories. Reproduce the issue with a packrat project and compare the parent session's .libPaths() with those available in the job. Done means packrat initializes in the analysis directory and the parent library paths are preserved.

Written by the indexing model from the issue text.

Description

enhancement question

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.

Dominant language
R
Stars
184
Forks
53
Avg merge
7d 2h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mlr-org/batchtools

All issues in mlr-org/batchtools

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.