nipoppy.container.ContainerHandler¶
- class nipoppy.container.ContainerHandler(args=None, logger=None)¶
Abstract class for container handlers.
- Parameters:
args (Iterable[str])
logger (Optional[logging.Logger])
- add_bind_arg(path_src, path_dest=None, mode='rw')¶
Add a bind path to the container args.
- Parameters:
path_src (nipoppy.env.StrOrPathLike) – Path on disk. If this is a relative path or contains symlinks, it will be resolved
path_dest (Optional[nipoppy.env.StrOrPathLike], optional) – Path inside the container (if None, will be the same as the local path), by default None
mode (str, optional) – Read/write permissions, by default “rw”
- add_env_arg(key, value)¶
Set environment variables for the container.
- check_command_exists()¶
Check that the command is available (i.e. in PATH).
- fix_bind_args()¶
Fix bind flags in args.
- abstractmethod get_pull_command(uri, fpath_container)¶
Get the command to pull a container image to a specified location.
- get_shell_command(subcommand='run')¶
Get the shell command for running the container.
- abstractmethod is_image_downloaded(uri, fpath_container)¶
Check if a container image has been downloaded.
- args¶
- env_flag = '--env'¶
- logger = None¶