from zenml.repository import Repository
from zenml.artifact_stores import LocalArtifactStore
from zenml.metadata_stores import SQLiteMetadataStore
from zenml.orchestrators import LocalOrchestrator
from zenml.stack import Stack
# Create a new orchestrator
orchestrator = LocalOrchestrator(name="local")
# Create a new metadata store
metadata_store = SQLiteMetadataStore(
uri="/tmp/zenml/zenml.db",
# Create a new artifact store
artifact_store = LocalArtifactStore(
path="/tmp/zenml/artifacts",
# Create a new stack with the new components
orchestrator=orchestrator,
metadata_store=metadata_store,
artifact_store=artifact_store,
# Register the new stack in the currently active profile
repo.register_stack(stack)
# Set the stack as the active stack of the repository
repo.activate_stack(stack.name)