Version the FreeSurfer data volume so image updates re-seed it (fixes #123)#131
Merged
Conversation
The FreeSurfer install is shared into the simnibs container via a Docker named volume. Docker only seeds a volume once (when empty), so the fixed volume name pinned the first install forever and never picked up updated freesurfer images — users who installed before the image gained the MATLAB runtime kept an MCR-less volume, breaking thalamic/hippocampal segmentation (issue #123). Version the volume name by the freesurfer image tag and make it compose-managed (not external) so compose creates and seeds it automatically. Launchers derive the name from the image tag, pass it as FREESURFER_VOLUME, and prune stale older-version volumes.
…unchers
Address review findings on the volume-versioning change:
- Non-destructive fallback (all 3 launchers): when the freesurfer image tag
cannot be parsed, get_freesurfer_volume_name()/computeFreesurferVolume() now
returns None/null instead of the bare "ti-toolbox_freesurfer_data" prefix.
Callers then leave FREESURFER_VOLUME unset (so compose's versioned
${FREESURFER_VOLUME:-ti-toolbox_freesurfer_data_v7.4.1} default seeds the
correct volume) and skip pruning. Previously a parse miss both regressed to
the never-re-seeded issue #123 and deleted the good versioned volume.
- Unmount before prune (Python loaders): run "docker compose down" before
prune_old_freesurfer_volumes() so containers from a previous (older-image)
run release the old volume and it can actually be removed. This mirrors the
Electron cleanupExistingContainers -> pruneOldVolumes ordering.
- Anchor JS regex (docker-manager.js): match /^\s*image:.../m so commented-out
"# image:" lines are skipped and only the first real image line wins,
matching the Python re.match(^\s*...) semantics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The FreeSurfer install is shared into the simnibs container via a Docker named volume. Docker only seeds a volume once (on first creation). With a fixed name (
ti-toolbox_freesurfer_data), pulling a newer freesurfer image never refreshed it — so users who installed before the image gained the MATLAB runtime (MCR) kept an MCR-less volume, breakingsegmentThalamicNuclei.sh/segmentHA_T1.sh(#123).Fix
ti-toolbox_freesurfer_data_v7.4.1) — bumping the image bumps the name → a fresh volume is created and re-seeded.external) sodocker compose upcreates/seeds it; a baredocker compose upworks too.FREESURFER_VOLUME, and prune stale older-version volumes (best-effort, scoped to the FreeSurfer prefix, never the current one).Consistent across all three launchers (
loader.py,dev/loader/loader_dev.py,package/src/backend/docker-manager.js) and three compose files. Seedev/freesurfer-volume-versioning.md.Notes
docker compose downkeeps the volume; onlydown -vremoves it. Existing users' old volume is pruned + re-seeded on next launch.${FREESURFER_VOLUME:-…}default in all three compose files.