Skip to content

Container Registries

zenml.container_registries special

Container Registry

A container registry is a store for (Docker) containers. A ZenML workflow involving a container registry would automatically containerize your code to be transported across stacks running remotely. As part of the deployment to the cluster, the ZenML base image would be downloaded (from a cloud container registry) and used as the basis for the deployed 'run'.

For instance, when you are running a local container-based stack, you would therefore have a local container registry which stores the container images you create that bundle up your pipeline code. You could also use a remote container registry like the Elastic Container Registry at AWS in a more production setting.

base_container_registry

BaseContainerRegistry (StackComponent) pydantic-model

Base class for all ZenML container registries.

Attributes:

Name Type Description
uri str

The URI of the container registry.

Source code in zenml/container_registries/base_container_registry.py
class BaseContainerRegistry(StackComponent):
    """Base class for all ZenML container registries.

    Attributes:
        uri: The URI of the container registry.
    """

    uri: str

    # Class Configuration
    TYPE: ClassVar[StackComponentType] = StackComponentType.CONTAINER_REGISTRY
    FLAVOR: ClassVar[str] = "default"

    @property
    def is_local(self) -> bool:
        """Returns whether the container registry is local or not.

        Returns:
            True if the container registry is local, False otherwise.
        """
        return bool(re.fullmatch(r"localhost:[0-9]{4,5}", self.uri))
is_local: bool property readonly

Returns whether the container registry is local or not.

Returns:

Type Description
bool

True if the container registry is local, False otherwise.