Warning

This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

galaxy.tool_util.deps.container_resolvers package

The module defines the abstract interface for resolving container images for tool execution.

class galaxy.tool_util.deps.container_resolvers.ResolutionCache(**kwds)[source]

Bases: Bunch

Simple cache for duplicated computation created once per set of requests (likely web request in Galaxy context).

This should not be assumed to be thread safe - resolution using a given cache should all occur one resolution at a time in a single thread.

mulled_resolution_cache: Optional[Cache] = None
class galaxy.tool_util.deps.container_resolvers.ContainerResolver(app_info: AppInfo, **kwds)[source]

Bases: Dictifiable

Description of a technique for resolving container images for tool execution.

dict_collection_visible_keys = ['resolver_type', 'can_uninstall_dependencies', 'builds_on_resolution']
can_uninstall_dependencies = False
builds_on_resolution = False
read_only = True
__init__(app_info: AppInfo, **kwds) None[source]

Default initializer for ContainerResolver subclasses.

abstract resolve(enabled_container_types: Container[str], tool_info: ToolInfo, **kwds) Optional[ContainerDescription][source]

Find a container matching all supplied requirements for tool.

The supplied argument is a galaxy.tool_util.deps.dependencies.ToolInfo description of the tool and its requirements.

abstract property resolver_type: str

Short label for the type of container resolution.

Submodules

galaxy.tool_util.deps.container_resolvers.explicit module

This module describes the ExplicitContainerResolver ContainerResolver plugin.

class galaxy.tool_util.deps.container_resolvers.explicit.ExplicitContainerResolver(app_info: AppInfo, **kwds)[source]

Bases: ContainerResolver

Find explicit containers referenced in the tool description (e.g. tool XML file) if present.

resolver_type = 'explicit'
resolve(enabled_container_types: Container[str], tool_info: ToolInfo, **kwds) Optional[ContainerDescription][source]

Find a container explicitly mentioned in tool description.

This ignores the tool requirements and assumes the tool author crafted a correct container.

class galaxy.tool_util.deps.container_resolvers.explicit.ExplicitSingularityContainerResolver(app_info: AppInfo, **kwds)[source]

Bases: ExplicitContainerResolver

resolver_type = 'explicit_singularity'
container_type = 'singularity'
resolve(enabled_container_types: Container[str], tool_info: ToolInfo, **kwds) Optional[ContainerDescription][source]

Find a container explicitly mentioned in tool description.

This ignores the tool requirements and assumes the tool author crafted a correct container. We use singularity here to fetch docker containers, hence the container_description hack here.

class galaxy.tool_util.deps.container_resolvers.explicit.CachedExplicitSingularityContainerResolver(app_info: AppInfo, **kwargs)[source]

Bases: CliContainerResolver

resolver_type = 'cached_explicit_singularity'
container_type = 'singularity'
cli = 'singularity'
__init__(app_info: AppInfo, **kwargs) None[source]

Default initializer for ContainerResolver subclasses.

resolve(enabled_container_types: Container[str], tool_info: ToolInfo, install: bool = False, **kwds) Optional[ContainerDescription][source]

Find a container explicitly mentioned in tool description.

This ignores the tool requirements and assumes the tool author crafted a correct container. We use singularity here to fetch docker containers, hence the container_description hack here.

class galaxy.tool_util.deps.container_resolvers.explicit.FallbackContainerResolver(app_info: AppInfo, identifier: str = '', **kwds)[source]

Bases: BaseAdminConfiguredContainerResolver

Specify an explicit, identified container as a Docker container resolver.

resolver_type = 'fallback'
container_type = 'docker'
__init__(app_info: AppInfo, identifier: str = '', **kwds) None[source]

Default initializer for ContainerResolver subclasses.

resolve(enabled_container_types: Container[str], tool_info: ToolInfo, **kwds) Optional[ContainerDescription][source]

Find a container matching all supplied requirements for tool.

The supplied argument is a galaxy.tool_util.deps.dependencies.ToolInfo description of the tool and its requirements.

class galaxy.tool_util.deps.container_resolvers.explicit.FallbackSingularityContainerResolver(app_info: AppInfo, identifier: str = '', **kwds)[source]

Bases: FallbackContainerResolver

Specify an explicit, identified container as a Singularity container resolver.

resolver_type = 'fallback_singularity'
container_type = 'singularity'
class galaxy.tool_util.deps.container_resolvers.explicit.FallbackNoRequirementsContainerResolver(app_info: AppInfo, identifier: str = '', **kwds)[source]

Bases: FallbackContainerResolver

resolver_type = 'fallback_no_requirements'
class galaxy.tool_util.deps.container_resolvers.explicit.FallbackNoRequirementsSingularityContainerResolver(app_info: AppInfo, identifier: str = '', **kwds)[source]

Bases: FallbackNoRequirementsContainerResolver

resolver_type = 'fallback_no_requirements_singularity'
container_type = 'singularity'
class galaxy.tool_util.deps.container_resolvers.explicit.MappingContainerResolver(app_info: AppInfo, **kwds)[source]

Bases: BaseAdminConfiguredContainerResolver

resolver_type = 'mapping'
__init__(app_info: AppInfo, **kwds) None[source]

Default initializer for ContainerResolver subclasses.

resolve(enabled_container_types: Container[str], tool_info: ToolInfo, **kwds) Optional[ContainerDescription][source]

Find a container matching all supplied requirements for tool.

The supplied argument is a galaxy.tool_util.deps.dependencies.ToolInfo description of the tool and its requirements.

class galaxy.tool_util.deps.container_resolvers.explicit.RequiresGalaxyEnvironmentContainerResolver(app_info: AppInfo, identifier: str = '', **kwds)[source]

Bases: FallbackContainerResolver

resolver_type = 'requires_galaxy_environment'
class galaxy.tool_util.deps.container_resolvers.explicit.RequiresGalaxyEnvironmentSingularityContainerResolver(app_info: AppInfo, identifier: str = '', **kwds)[source]

Bases: RequiresGalaxyEnvironmentContainerResolver

resolver_type = 'requires_galaxy_environment_singularity'
container_type = 'singularity'

galaxy.tool_util.deps.container_resolvers.mulled module

This module describes the MulledContainerResolver ContainerResolver plugin.

class galaxy.tool_util.deps.container_resolvers.mulled.CachedMulledDockerContainerResolver(app_info: AppInfo, namespace: str = 'biocontainers', hash_func: typing_extensions.Literal[v1, v2] = 'v2', **kwds)[source]

Bases: CliContainerResolver

resolver_type = 'cached_mulled'
shell = '/bin/bash'
__init__(app_info: AppInfo, namespace: str = 'biocontainers', hash_func: typing_extensions.Literal[v1, v2] = 'v2', **kwds)[source]

Default initializer for ContainerResolver subclasses.

resolve(enabled_container_types: Container[str], tool_info: ToolInfo, **kwds) Optional[ContainerDescription][source]

Find a container matching all supplied requirements for tool.

The supplied argument is a galaxy.tool_util.deps.dependencies.ToolInfo description of the tool and its requirements.

class galaxy.tool_util.deps.container_resolvers.mulled.CachedMulledSingularityContainerResolver(app_info: AppInfo, hash_func: typing_extensions.Literal[v1, v2] = 'v2', **kwargs)[source]

Bases: SingularityCliContainerResolver

resolver_type = 'cached_mulled_singularity'
shell = '/bin/bash'
resolve(enabled_container_types: Container[str], tool_info: ToolInfo, **kwds) Optional[ContainerDescription][source]

Find a container matching all supplied requirements for tool.

The supplied argument is a galaxy.tool_util.deps.dependencies.ToolInfo description of the tool and its requirements.

class galaxy.tool_util.deps.container_resolvers.mulled.MulledDockerContainerResolver(app_info: AppInfo, namespace: str = 'biocontainers', hash_func: typing_extensions.Literal[v1, v2] = 'v2', auto_install: bool = True, **kwds)[source]

Bases: CliContainerResolver

Look for mulled images matching tool dependencies.

resolver_type = 'mulled'
shell = '/bin/bash'
protocol: Optional[str] = None
__init__(app_info: AppInfo, namespace: str = 'biocontainers', hash_func: typing_extensions.Literal[v1, v2] = 'v2', auto_install: bool = True, **kwds) None[source]

Default initializer for ContainerResolver subclasses.

cached_container_description(targets: List[CondaTarget], namespace: str, hash_func: typing_extensions.Literal[v1, v2], resolution_cache: Optional[ResolutionCache] = None) Optional[ContainerDescription][source]
pull(container: Container) None[source]
property can_list_containers: bool
resolve(enabled_container_types: Container[str], tool_info: ToolInfo, install: bool = False, session: Optional[Session] = None, **kwds) Optional[ContainerDescription][source]

Find a container matching all supplied requirements for tool.

The supplied argument is a galaxy.tool_util.deps.dependencies.ToolInfo description of the tool and its requirements.

class galaxy.tool_util.deps.container_resolvers.mulled.MulledSingularityContainerResolver(app_info: AppInfo, hash_func: typing_extensions.Literal[v1, v2] = 'v2', namespace: str = 'biocontainers', auto_install: bool = True, **kwds)[source]

Bases: SingularityCliContainerResolver, MulledDockerContainerResolver

resolver_type = 'mulled_singularity'
protocol: Optional[str] = 'docker://'
__init__(app_info: AppInfo, hash_func: typing_extensions.Literal[v1, v2] = 'v2', namespace: str = 'biocontainers', auto_install: bool = True, **kwds) None[source]

Default initializer for ContainerResolver subclasses.

cached_container_description(targets: List[CondaTarget], namespace: str, hash_func: typing_extensions.Literal[v1, v2], resolution_cache: Optional[ResolutionCache] = None) Optional[ContainerDescription][source]
property can_list_containers: bool
pull(container: Container) None[source]
class galaxy.tool_util.deps.container_resolvers.mulled.BuildMulledDockerContainerResolver(app_info: AppInfo, namespace: str = 'local', hash_func: typing_extensions.Literal[v1, v2] = 'v2', auto_install: bool = True, **kwds)[source]

Bases: CliContainerResolver

Build for Docker mulled images matching tool dependencies.

resolver_type = 'build_mulled'
shell = '/bin/bash'
builds_on_resolution = True
__init__(app_info: AppInfo, namespace: str = 'local', hash_func: typing_extensions.Literal[v1, v2] = 'v2', auto_install: bool = True, **kwds) None[source]

Default initializer for ContainerResolver subclasses.

resolve(enabled_container_types: Container[str], tool_info: ToolInfo, install: bool = False, **kwds) Optional[ContainerDescription][source]

Find a container matching all supplied requirements for tool.

The supplied argument is a galaxy.tool_util.deps.dependencies.ToolInfo description of the tool and its requirements.

class galaxy.tool_util.deps.container_resolvers.mulled.BuildMulledSingularityContainerResolver(app_info: AppInfo, hash_func: typing_extensions.Literal[v1, v2] = 'v2', auto_install: bool = True, **kwds)[source]

Bases: SingularityCliContainerResolver

Build for Singularity mulled images matching tool dependencies.

resolver_type = 'build_mulled_singularity'
shell = '/bin/bash'
builds_on_resolution = True
__init__(app_info: AppInfo, hash_func: typing_extensions.Literal[v1, v2] = 'v2', auto_install: bool = True, **kwds) None[source]

Default initializer for ContainerResolver subclasses.

resolve(enabled_container_types: Container[str], tool_info: ToolInfo, install: bool = False, **kwds) Optional[ContainerDescription][source]

Find a container matching all supplied requirements for tool.

The supplied argument is a galaxy.tool_util.deps.dependencies.ToolInfo description of the tool and its requirements.