Skip to content

Artifact Stores

zenml.artifact_stores special

An artifact store is a place where artifacts are stored. These artifacts may have been produced by the pipeline steps, or they may be the data first ingested into a pipeline via an ingestion step.

Definitions of the BaseArtifactStore class and the LocalArtifactStore that builds on it are in this module.

Other artifact stores corresponding to specific integrations are to be found in the integrations module. For example, the GCPArtifactStore, used when running ZenML on Google Cloud Platform, is defined in integrations.gcp.artifact_stores.

base_artifact_store

BaseArtifactStore (StackComponent, ABC) pydantic-model

Base class for all ZenML artifact stores.

Attributes:

Name Type Description
path str

The root path of the artifact store.

Source code in zenml/artifact_stores/base_artifact_store.py
class BaseArtifactStore(StackComponent, ABC):
    """Base class for all ZenML artifact stores.

    Attributes:
        path: The root path of the artifact store.
    """

    path: str

    @property
    def type(self) -> StackComponentType:
        """The component type."""
        return StackComponentType.ARTIFACT_STORE

    @property
    @abstractmethod
    def flavor(self) -> ArtifactStoreFlavor:
        """The artifact store flavor."""
flavor: ArtifactStoreFlavor property readonly

The artifact store flavor.

type: StackComponentType property readonly

The component type.

local_artifact_store

LocalArtifactStore (BaseArtifactStore) pydantic-model

Artifact Store for local artifacts.

Source code in zenml/artifact_stores/local_artifact_store.py
class LocalArtifactStore(BaseArtifactStore):
    """Artifact Store for local artifacts."""

    supports_local_execution = True
    supports_remote_execution = False

    @property
    def flavor(self) -> ArtifactStoreFlavor:
        """The artifact store flavor."""
        return ArtifactStoreFlavor.LOCAL

    @validator("path")
    def ensure_path_is_local(cls, path: str) -> str:
        """Ensures that the artifact store path is local."""
        if fileio.is_remote(path):
            raise ValueError(
                f"Path '{path}' specified for LocalArtifactStore is not a "
                f"local path."
            )
        return path
flavor: ArtifactStoreFlavor property readonly

The artifact store flavor.

ensure_path_is_local(path) classmethod

Ensures that the artifact store path is local.

Source code in zenml/artifact_stores/local_artifact_store.py
@validator("path")
def ensure_path_is_local(cls, path: str) -> str:
    """Ensures that the artifact store path is local."""
    if fileio.is_remote(path):
        raise ValueError(
            f"Path '{path}' specified for LocalArtifactStore is not a "
            f"local path."
        )
    return path