nipoppy.container.ApptainerHandler

class nipoppy.container.ApptainerHandler(args=None)

Container handler for Apptainer.

Parameters:

args (Iterable[str])

get_pull_command(uri, fpath_container)

Get the command to pull a container image to a specified location.

Parameters:
  • uri (Optional[str]) – URI of the container image (e.g. docker://…)

  • fpath_container (Optional[nipoppy.env.StrOrPathLike]) – Path where the container image should be saved

Returns:

The command string

Return type:

str

get_pull_confirmation_prompt(fpath_container)

Get the confirmation prompt for pulling the container image.

Parameters:

fpath_container (nipoppy.env.StrOrPathLike) – Path where the container image will be saved

Returns:

The confirmation prompt string

Return type:

str

is_image_downloaded(uri, fpath_container)

Check if a container image has been downloaded.

Parameters:
  • uri (Optional[str]) – URI of the container image (e.g. docker://…) (not used)

  • fpath_container (Optional[nipoppy.env.StrOrPathLike]) – Path to the container image

Returns:

True if the container image exists at the specified path

Return type:

bool

bind_flags = ('--bind', '-B')

Flag for binding paths.

command = 'apptainer'

Container executable name.