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: ABC

Abstract base mixin for Minitrino Docker objects.

Parameters:

cluster_name (Optional[str]) – The name of the cluster this Docker object belongs to.

property cluster_name: str | None[source]#

Return the cluster name associated with this object.

property labels: dict[str, str][source]#

Retrieve Docker labels from the underlying Docker object.

abstract property id: str[source]#

The unique identifier of the Docker object.

Returns:

The object ID string.

Return type:

str

abstract property kind: str[source]#

The kind of the Docker object.

Returns:

The string identifier of the object kind (e.g., “container”).

Return type:

str

class minitrino.core.docker.wrappers.MinitrinoContainer(base: Container, cluster_name: str | None = None)[source][source]#

Bases: MinitrinoDockerObjectMixin, Container

Minitrino-wrapped container object.

Parameters:
  • base (Container) – The base Docker container to wrap.

  • cluster_name (str) – The name of the cluster this container belongs to.

property id: str[source]#

ID of the container.

property name: str[source]#

Name of the container.

property kind: str[source]#

Kind of object.

property cluster_name: str[source]#

Cluster name associated with the container.

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, Volume

Minitrino-wrapped volume object.

Parameters:
  • base (Volume) – The base Docker volume to wrap.

  • cluster_name (str) – The name of the cluster this volume belongs to.

property id: str[source]#

ID of the volume.

property name: str[source]#

Name of the volume.

property kind: str[source]#

Kind of object.

property cluster_name: str[source]#

Cluster name associated with the volume.

class minitrino.core.docker.wrappers.MinitrinoNetwork(base: Network, cluster_name: str | None = None)[source][source]#

Bases: MinitrinoDockerObjectMixin, Network

Minitrino-wrapped network object.

Parameters:
  • base (Network) – The base Docker network to wrap.

  • cluster_name (str) – The name of the cluster this network belongs to.

property id: str[source]#

ID of the network.

property name: str[source]#

Name of the network.

property kind: str[source]#

Kind of object.

property cluster_name: str[source]#

Cluster name associated with the network.

class minitrino.core.docker.wrappers.MinitrinoImage(base: Image)[source][source]#

Bases: MinitrinoDockerObjectMixin, Image

Minitrino-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.

property id: str[source]#

ID of the image.

property name: str[source]#

Name of the image.

property kind: str[source]#

Kind of object.

property cluster_name: str[source]#

Cluster name associated with the image (always “images”).