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.containers package¶
Interfaces to containerization software
-
class
galaxy.containers.
ContainerPort
[source]¶ Bases:
galaxy.containers.ContainerPort
Named tuple representing ports published by a container, with attributes:
Variables:
-
class
galaxy.containers.
Container
(interface, id, name=None, **kwargs)[source]¶ Bases:
object
-
__init__
(interface, id, name=None, **kwargs)[source]¶ Parameters: - interface (
ContainerInterface
subclass instance) – Container interface for the given container type - id (str) – Container identifier
- name (str) – Container name
- interface (
-
id
¶ The container’s id
-
name
¶ The container’s name
-
from_id
(interface, id)[source]¶ Classmethod to create an instance of Container from the container system’s id for the given container type.
Parameters: - interface (
ContainerInterface
subclass instance) – Container insterface for the given id - id (str) – Container identifier
Returns: Container object
Return type: Container
subclass instance- interface (
-
ports
¶ Attribute for accessing details of ports published by the container.
Returns: Port details Return type: list of :class:`ContainerPort`s
-
address
¶ Attribute for accessing the address or hostname where published ports can be accessed.
Returns: Hostname or IP address Return type: str
-
is_ready
()[source]¶ Indicate whether or not the container is “ready” (up, available, running).
Returns: True if ready, else False Rtpe: bool
-
map_port
(port)[source]¶ Map a given container port to a host address/port.
For legacy reasons, if port is
None
, the first port (if any) will be returnedParameters: port (int) – Container port to map Returns: Mapping to host address/port for given container port Return type: ContainerPort
instance
-
-
class
galaxy.containers.
ContainerInterface
(conf, key, containers_config_file)[source]¶ Bases:
object
-
container_type
= None¶
-
container_class
= None¶
-
conf_defaults
= {'name_prefix': 'galaxy_'}¶
-
option_map
= {}¶
-
publish_port_list_required
= False¶
-
supports_volumes
= True¶
-
key
¶
-
containers_config_file
¶
-
-
galaxy.containers.
build_container_interfaces
(containers_config_file, containers_conf=None)[source]¶ Build
ContainerInterface`s. Pass ``containers_conf`
to avoid rereading the config file.Parameters: Returns: Instantiated container interfaces with keys corresponding to
containers
keysReturn type: dict of
ContainerInterface
subclass instances
-
galaxy.containers.
parse_containers_config
(containers_config_file)[source]¶ Parse a
containers_conf.yml
and return the contents of itscontainers
dictionary.Parameters: containers_config_file (str) – Filename of containers_conf.yml Returns: Contents of the dictionary under the containers
keyReturn type: dict
Submodules¶
galaxy.containers.docker module¶
Interface to Docker
-
class
galaxy.containers.docker.
DockerInterface
(conf, key, containers_config_file)[source]¶ Bases:
galaxy.containers.ContainerInterface
-
container_class
¶ alias of
DockerContainer
-
conf_defaults
= {'memory': None, 'host': None, 'force_tlsverify': False, 'image': None, 'cpus': None}¶
-
option_map
= {'environment': {'flag': '--env', 'type': 'list_of_kvpairs'}, 'publish_all_ports': {'flag': '--publish-all', 'type': 'boolean'}, 'publish_port_random': {'flag': '--publish', 'type': 'string'}, 'name': {'flag': '--name', 'type': 'string'}, 'volumes': {'flag': '--volume', 'type': 'docker_volumes'}, 'memory': {'flag': '--memory', 'type': 'string'}, 'detach': {'flag': '--detach', 'type': 'boolean'}, 'cpus': {'flag': '--cpus', 'type': 'string'}}¶
-
image_repodigest
(image)[source]¶ Get the digest image string for an image.
Parameters: image (str) – image id or image name and optionally, tag Returns: digest string, having the format <name>@<hash_alg>:<digest>, e.g.: ‘bgruening/docker-jupyter-notebook@sha256:3ec0bc9abc9d511aa602ee4fff2534d80dd9b1564482de52cb5de36cce6debae’ or, the original image name if the digest cannot be determined (the image has not been pulled)
-
host
¶
-
-
class
galaxy.containers.docker.
DockerCLIInterface
(conf, key, containers_config_file)[source]¶ Bases:
galaxy.containers.docker.DockerInterface
-
container_type
= 'docker_cli'¶
-
conf_defaults
= {'executable': 'docker', 'command_template': '{executable} {global_kwopts} {subcommand} {args}'}¶
-
-
class
galaxy.containers.docker.
DockerAPIInterface
(conf, key, containers_config_file)[source]¶ Bases:
galaxy.containers.docker.DockerCLIInterface
-
container_type
= 'docker'¶
-
galaxy.containers.docker_decorators module¶
Decorators for docker
galaxy.containers.docker_model module¶
Model objects for docker objects
-
class
galaxy.containers.docker_model.
DockerAttributeContainer
(members=None)[source]¶ Bases:
object
-
members
¶
-
-
class
galaxy.containers.docker_model.
DockerContainer
(interface, id, name=None, inspect=None)[source]¶ Bases:
galaxy.containers.Container
-
ports
¶
-
address
¶
-
inspect
¶
-
-
class
galaxy.containers.docker_model.
DockerService
(interface, id, name=None, image=None, inspect=None)[source]¶ Bases:
galaxy.containers.Container
-
ports
¶
-
address
¶
-
inspect
¶
-
state
¶ Return the state of the first task in the service.
-
image
¶
-
cpus
¶
-
constraints
¶
-
-
class
galaxy.containers.docker_model.
DockerServiceConstraint
(name=None, op=None, value=None)[source]¶ Bases:
object
-
name
¶
-
op
¶
-
value
¶
-
label
¶
-
-
class
galaxy.containers.docker_model.
DockerServiceConstraints
(members=None)[source]¶ Bases:
galaxy.containers.docker_model.DockerAttributeContainer
-
member_class
¶ alias of
DockerServiceConstraint
-
labels
¶
-
-
class
galaxy.containers.docker_model.
DockerNode
(interface, id=None, name=None, status=None, availability=None, manager=False)[source]¶ Bases:
object
-
id
¶
-
name
¶
-
inspect
¶
-
state
¶
-
cpus
¶
-
labels
¶
-
labels_as_constraints
¶
-
tasks
¶
-
task_count
¶
-
-
class
galaxy.containers.docker_model.
DockerNodeLabel
(name=None, value=None)[source]¶ Bases:
object
-
name
¶
-
value
¶
-
constraint_string
¶
-
constraint
¶
-
-
class
galaxy.containers.docker_model.
DockerNodeLabels
(members=None)[source]¶ Bases:
galaxy.containers.docker_model.DockerAttributeContainer
-
member_class
¶ alias of
DockerNodeLabel
-
constraints
¶
-
-
class
galaxy.containers.docker_model.
DockerTask
(interface, id=None, name=None, image=None, desired_state=None, state=None, error=None, ports=None, service=None, node=None)[source]¶ Bases:
object
-
__init__
(interface, id=None, name=None, image=None, desired_state=None, state=None, error=None, ports=None, service=None, node=None)[source]¶
-
id
¶
-
name
¶
-
inspect
¶
-
cpus
¶
-
state
¶
-
galaxy.containers.docker_swarm module¶
Docker Swarm mode interface
-
class
galaxy.containers.docker_swarm.
DockerSwarmInterface
(conf, key, containers_config_file)[source]¶ Bases:
galaxy.containers.docker.DockerInterface
-
container_class
¶ alias of
DockerService
-
conf_defaults
= {'node_prefix': None, 'service_create_cpus_constraint': False, 'service_create_image_constraint': False, 'ignore_volumes': False, 'manager_autostart': True, 'resolve_image_digest': False, 'managed': True}¶
-
publish_port_list_required
= True¶
-
supports_volumes
= False¶
-
-
class
galaxy.containers.docker_swarm.
DockerSwarmCLIInterface
(conf, key, containers_config_file)[source]¶ Bases:
galaxy.containers.docker_swarm.DockerSwarmInterface
,galaxy.containers.docker.DockerCLIInterface
-
container_type
= 'docker_swarm_cli'¶
-
option_map
= {'cpu_reservation': {'flag': '--reserve-cpu', 'type': 'string'}, 'label_rm': {'flag': '--label-rm', 'type': 'list_of_kvpairs'}, 'replicas': {'flag': '--replicas', 'type': 'string'}, 'label_add': {'flag': '--label-add', 'type': 'list_of_kvpairs'}, 'publish_port_random': {'flag': '--publish', 'type': 'string'}, 'cpu_limit': {'flag': '--limit-cpu', 'type': 'string'}, 'availability': {'flag': '--availability', 'type': 'string'}, 'restart_condition': {'flag': '--restart-condition', 'type': 'string'}, 'name': {'flag': '--name', 'type': 'string'}, 'constraint': {'flag': '--constraint', 'type': 'list_of_kovtrips'}, 'environment': {'flag': '--env', 'type': 'list_of_kvpairs'}, 'mem_limit': {'flag': '--limit-memory', 'type': 'string'}, 'mem_reservation': {'flag': '--reserve-memory', 'type': 'string'}}¶
-
-
class
galaxy.containers.docker_swarm.
DockerSwarmAPIInterface
(conf, key, containers_config_file)[source]¶ Bases:
galaxy.containers.docker_swarm.DockerSwarmCLIInterface
-
container_type
= 'docker_swarm'¶
-
galaxy.containers.docker_swarm_manager module¶
Docker Swarm mode management
-
class
galaxy.containers.docker_swarm_manager.
SwarmManager
(conf, docker_interface)[source]¶ Bases:
object
-
class
galaxy.containers.docker_swarm_manager.
SwarmState
(conf, interface_conf)[source]¶ Bases:
object