Develop a custom container registry
Learning how to develop a custom container registry.
Base Abstraction
from abc import abstractmethod
from typing import Type
from zenml.enums import StackComponentType
from zenml.stack import Flavor
from zenml.stack.authentication_mixin import (
AuthenticationConfigMixin,
AuthenticationMixin,
)
class BaseContainerRegistryConfig(AuthenticationConfigMixin):
"""Base config for a container registry."""
uri: str
class BaseContainerRegistry(AuthenticationMixin):
"""Base class for all ZenML container registries."""
def prepare_image_push(self, image_name: str) -> None:
"""Conduct necessary checks/preparations before an image gets pushed."""
class BaseContainerRegistryFlavor(Flavor):
"""Base flavor for container registries."""
@property
@abstractmethod
def name(self) -> str:
"""Returns the name of the flavor."""
@property
def type(self) -> StackComponentType:
"""Returns the flavor type."""
return StackComponentType.CONTAINER_REGISTRY
@property
def config_class(self) -> Type[BaseContainerRegistryConfig]:
"""Config class for this flavor."""
return BaseContainerRegistryConfig
@property
def implementation_class(self) -> Type[BaseContainerRegistry]:
"""Implementation class."""
return BaseContainerRegistryBuilding your own container registry
Last updated
Was this helpful?