Retire $JOB_TMP: the container /tmp bind should not need a cluster-axis variable
- Dominant language
- Python
- Stars
- 1
- Forks
- 4
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 24
Description
Under `--containall`, apptainer gives the container a small tmpfs `/tmp`, and mriqc/fmriprep overflow it. Our answer is a bind:
```yaml
singularity_args:
- -B $JOB_TMP:/tmp
```
`$JOB_TMP` is invented by the cluster config's `script_preamble`, which exports it, `mkdir -p`s it, and `trap`s its removal. So an **app-axis bind** is fed by a **cluster-axis variable**, and every cluster config has to define one for the app configs to keep working. That coupling is invisible from either file alone.
## The three options
| | |
|---|---|
| `--writable-tmpfs` | what babs's own examples use (`notebooks/eg_mriqc-24-0-2.yaml`, `eg_fmriprep-24-1-1_regular.yaml`). Rejected: the overlay size comes from `sessiondir max size` in `apptainer.conf`, which is admin-set — on Discovery we cannot raise it. **Unknown on other sites**; readable without running anything via `apptainer config global --get "sessiondir max size"`, so it is worth checking per cluster rather than assuming. |
| `-B $JOB_TMP:/tmp` | today. Works, costs the cross-axis variable above. |
| `-B "${PWD}/.git/tmp:/tmp"` | the job already `cd`s into its working clone under `job_compute_space` (real scratch disk), and babs emits `-B "${PWD}"`, so this is the same disk with nothing extra to define. It is created already, and it dies with the job clone — no `mkdir`, no `trap`, no variable. |
## Proposed
Take the third, unless a site turns out to have a large enough `sessiondir max size` for `--writable-tmpfs` — in which case that is cleaner still, since it is babs's own idiom.
Worth confirming first that app temp files sitting beside `.git/tmp/wkdir` bother nothing; babs already writes its nipype work dir there.
## Why it is not a quick edit
Container flags are baked into a babs project at `babs init`, so an already-scaffolded cell needs retire + re-scaffold to pick this up. Fold it in at the next scaffold rather than mid-run.
Split off from #81, which killed the relative `-w` plus its `--pwd` fixup and explicitly scoped this bind out as a separate concern. Also a case for #97 (a value on the wrong axis as a workaround).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how container flags are generated at babs init, then compare the app examples in notebooks/eg_mriqc-24-0-2.yaml and eg_fmriprep-24-1-1_regular.yaml with cluster script_preamble handling of JOB_TMP. Confirm that the working clone can hold .git/tmp without conflicts, then ensure newly scaffolded projects no longer require the cluster-axis variable and that existing projects are left for retire and re-scaffold.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100