Skip to content

Support multiple files for a single Girder-resource input#257

Open
PaulHax wants to merge 1 commit into
girder:masterfrom
PaulHax:multi-file-inputs
Open

Support multiple files for a single Girder-resource input#257
PaulHax wants to merge 1 commit into
girder:masterfrom
PaulHax:multi-file-inputs

Conversation

@PaulHax

@PaulHax PaulHax commented Jul 18, 2026

Copy link
Copy Markdown

Item 2 of #256.

Lets a single Girder-resource input accept multiple files.

  • An input declared multiple="true" accepts a comma-separated list of Girder ids.
  • Each file is bind-mounted read-only (or downloaded where direct paths are unavailable), and the container receives one comma-joined list of paths in submitted order.
  • Mounted names are id-prefixed and comma-stripped, so same-named or comma-containing files cannot collide or corrupt the joined list; all files in a list share one Girder client.

The motivating case is a multi-file DICOM series as one input: today a CLI has to fetch the files itself through the REST API with an in-container Girder token; with this it just receives N local read-only paths.

Single-file inputs and existing CLIs are untouched — a multiple input given one id behaves exactly as before. multiple is the existing Slicer Execution Model attribute (already parsed by the vendored ctk_cli, and already excluded from batch mode). Tests included at the REST and transform level.

Notes for review:

  • multiple="true" becomes the public way a CLI declares this, so the spelling is your call. Happy to use a different attribute, marker, or mechanism.
  • The native web UI cannot compose a multi-id submission for a multiple input (its multi-file button is batch mode, correctly hidden here) — the feature is REST-level; UI parity could be a follow-up if you want it.

An input parameter declared with multiple="true" in the CLI XML now
accepts a comma-separated list of Girder ids.  Each file is resolved
through its own volume transform -- a direct read-only bind mount when
the direct path setting allows it, otherwise the existing download
fallback -- and the container receives a single comma-separated list of
container paths, preserving the submitted order.  Names are prefixed
with their model id so same-named series files cannot collide in the
mounted volume, and commas are stripped from them so a legal Girder
name cannot corrupt the joined path list.  All files in a list share
one Girder client, so the number of tokens minted per submission does
not grow with the length of the list, and callers that only need the
primary (first) model of a multiple input load just that one.

The primary input bookkeeping (job title, upload reference file/item
ids, template parameters) keys off the first file of the list.  Inputs
with multiple set were already excluded from batch processing.  This
removes the need for CLIs to fetch multi-file inputs through the REST
api with an in-container Girder token.
@PaulHax PaulHax mentioned this pull request Jul 21, 2026
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