minitrino.core.docker.wrappers module#
Minitrino resource management.
This module provides classes and functions to manage Docker resources (containers, volumes, images, networks). All Docker objects are associated with a cluster name except for images, which are global.
- class minitrino.core.docker.wrappers.MinitrinoDockerObjectMixin(cluster_name: str | None = None)[source][source]#
Bases:
ABCAbstract base mixin for Minitrino Docker objects.
- Parameters:
cluster_name (Optional[str]) – The name of the cluster this Docker object belongs to.
- class minitrino.core.docker.wrappers.MinitrinoContainer(base: Container, cluster_name: str | None = None)[source][source]#
Bases:
MinitrinoDockerObjectMixin,ContainerMinitrino-wrapped container object.
- Parameters:
base (Container) – The base Docker container to wrap.
cluster_name (str) – The name of the cluster this container belongs to.
- ports_and_host_endpoints() tuple[list[str], list[str]][source][source]#
Get published and exposed ports and host endpoints.
- Returns:
ports: Published ports as ‘host_port:container_port’, exposed-only as ‘container_port’
host_endpoints: Published host endpoints as ‘localhost:host_port’
- Return type:
tuple[list[str], list[str]]
- class minitrino.core.docker.wrappers.MinitrinoVolume(base: Volume, cluster_name: str | None = None)[source][source]#
Bases:
MinitrinoDockerObjectMixin,VolumeMinitrino-wrapped volume object.
- Parameters:
base (Volume) – The base Docker volume to wrap.
cluster_name (str) – The name of the cluster this volume belongs to.
- class minitrino.core.docker.wrappers.MinitrinoNetwork(base: Network, cluster_name: str | None = None)[source][source]#
Bases:
MinitrinoDockerObjectMixin,NetworkMinitrino-wrapped network object.
- Parameters:
base (Network) – The base Docker network to wrap.
cluster_name (str) – The name of the cluster this network belongs to.
- class minitrino.core.docker.wrappers.MinitrinoImage(base: Image)[source][source]#
Bases:
MinitrinoDockerObjectMixin,ImageMinitrino-wrapped image object.
Unlike other Docker resources, images are global and not tied to a specific cluster. For consistency, they are assigned a special cluster name: “images”.
- Parameters:
base (Image) – The base Docker image to wrap.