Skip to content

WIP Add containers run#330

Closed
asmacdo wants to merge 8 commits intoPennLINC:mainfrom
asmacdo:add-containers-run
Closed

WIP Add containers run#330
asmacdo wants to merge 8 commits intoPennLINC:mainfrom
asmacdo:add-containers-run

Conversation

@asmacdo
Copy link
Collaborator

@asmacdo asmacdo commented Jan 30, 2026

No description provided.

asmacdo and others added 8 commits January 29, 2026 15:14
Replace direct singularity invocation with datalad containers-run for the
single-container code path. The pipeline (multi-container) path is unchanged.

At init time, register the container at the analysis dataset level via
datalad containers-add with a call-fmt built from the user's singularity_args.
This enables datalad containers-run, which reads the container path from
.datalad/config rather than relying on a hardcoded layout.

The generated participant_job.sh now runs three separate steps:
1. datalad containers-run for the BIDS app (clean provenance)
2. datalad run for zipping outputs
3. git rm for removing raw outputs

The zip script (bidsapp_run.sh.jinja2) is removed since its logic is now
inline in participant_job.sh. This supports any container dataset layout
(e.g. repronim/containers) without path assumptions.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Replace `os.access(parent_dir, os.W_OK)` with a tempfile creation
attempt. `os.access` only checks POSIX permission bits and returns
false negatives on NFSv4 ACL filesystems common on HPC clusters.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
With --containall, Singularity sets the working directory to $HOME
inside the container, which breaks relative paths to inputs/outputs.
Adding --pwd $PWD restores the expected working directory.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
containers-run fails to fetch the container image when running from
a clone obtained through a RIA store. Work around this by adding an
explicit datalad get before containers-run.

The container image path is discovered at init time via containers-list
(not hardcoded), threaded through to the job template.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
The single-container path no longer generates a separate zip script;
zipping is handled inside participant_job.sh.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
The mkdir -p for the output directory before containers-run likely
left the dataset dirty, causing "clean dataset required" error at
the zip step. containers-run with --output should handle directory
creation.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
The subject pruning (rm -rf other subjects) before containers-run
dirties the input subdataset. Without --explicit, datalad run refuses
to start on a dirty dataset. The old single datalad run also used
--explicit, so this matches prior behavior.

Also removes pre-created output dir (unnecessary with --output) and
adds TODO to verify subject pruning is necessary.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@asmacdo asmacdo closed this Jan 30, 2026
@asmacdo
Copy link
Collaborator Author

asmacdo commented Jan 30, 2026

accidental open sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant