Overview
Create, inspect, switch, and delete the stacks Kitaru uses for execution
A stack is where your flows run and where their checkpoints persist. It is the durable substrate replay depends on: checkpoints written to a stack's artifact store are what a later flow.replay(...) reads back to reproduce a run faithfully. A stack bundles three concerns:
Execution placement — the compute backend the runner uses for the run itself and for any
runtime="isolated"checkpoints (local, Kubernetes, AWS, GCP, Azure)Artifact persistence — the bucket or filesystem where checkpoint outputs and saved data are written (local, S3, GCS, Azure Blob)
Container registry — where Kitaru pushes the image it builds for remote execution
The active stack is the default. Per-flow and per-run overrides can bind a different stack for a single execution. See How It Works for how execution placement interacts with the runner.
The default stack
After kitaru init, you get a default stack that runs everything locally:
kitaru stack currentThis is enough to develop and test flows on your machine. No cloud accounts or containers required.
List available stacks
kitaru stack listThe table view shows each stack ID and marks the active one.
If you need machine-readable output, use JSON:
kitaru stack list --output jsonEach list item includes:
idnameis_activeis_managed
is_managed is true for stacks created by Kitaru's stack create command.
Switching stacks
You can pass either a stack name or a stack ID. The selected stack is persisted as your default until you switch it again.
Now every .run() call uses that stack. You can also override per-run:
This command changes the fallback stack Kitaru will use when no higher-precedence override is present. It does not rewrite any per-flow or per-run overrides.
Create a local stack
By default, Kitaru creates:
a local orchestrator named
deva local artifact store named
deva stack named
dev
Then it automatically activates the new stack.
You will see output like:
If you want to create the stack without switching to it yet:
Create a remote stack
Today, the CLI and MCP server can provision six shipped stack types:
localkubernetesmodalvertexsagemakerazureml
These remote stack commands assume you are already connected to the Kitaru server that should own the stack. If you already have a deployed server, connect first with kitaru login ... and verify with kitaru status.
Kitaru assembles the stack definition for you. For Kubernetes, Vertex, SageMaker, and AzureML stacks it also creates the cloud service connector. Modal stacks split that responsibility: the Modal runner itself is connectorless, but Kitaru can link existing server-side service connectors to the storage and registry components. If you pass explicit cloud credential flags, Kitaru creates a new connector instead.
Kubernetes example
For the end-to-end Kubernetes setup, see Kubernetes. For all available orchestrator fields (useful with --extra), see the ZenML Kubernetes orchestrator reference.
Vertex example
Vertex uses a managed runner, so there is no --cluster or --namespace flag. kitaru stack show prod-vertex will report the runner location that ZenML stores for the Vertex orchestrator. For all available orchestrator fields (useful with --extra), see the ZenML Vertex orchestrator reference.
SageMaker example
SageMaker is also a managed-runner path, so there is no --cluster or --namespace flag. kitaru stack show prod-sagemaker will report the runner region and execution role. For all available orchestrator fields (useful with --extra), see the ZenML SageMaker orchestrator reference.
AzureML example
AzureML is another managed-runner path, so there is no --cluster, --namespace, or --execution-role flag. kitaru stack show prod-azureml will report the runner subscription, resource group, workspace, and location that ZenML stores for the AzureML orchestrator. For all available orchestrator fields (useful with --extra), see the ZenML AzureML orchestrator reference.
Modal example
Install the Modal extra before creating Modal stacks:
Modal is a managed-runner path that is not tied to one cloud provider: Kitaru infers the provider from your artifact-store URI, so s3://, gs://, and az:// each pick the matching storage and registry flavors. Without explicit cloud credential flags, Kitaru first tries to reuse matching server-side service connectors for the bucket and registry; if none exist, it creates a connectorless stack for public or manually configured resources. --sandbox modal is optional and attaches a Modal sandbox for agent flows. For the end-to-end Modal setup, including AWS/GCP/Azure variants, connector reuse, explicit credential caveats, and the Docker CLI/BuildKit image-builder requirement, see Modal.
You can also keep the same inputs in a YAML file and create the stack with:
CLI flags still override YAML values when both are provided.
Advanced stack defaults with --extra and --async
--extra and --asyncThe named stack flags cover the common case: where artifacts live, which registry to use, which cluster or cloud region to target. When you need to set a field on an underlying stack component directly, use --extra.
Pass overrides as TARGET.FIELD=VALUE, where TARGET is one of:
orchestratorartifact_storecontainer_registrysandbox— only used when the stack includes a sandbox component, for example when you pass--sandbox modal
For example, this Vertex stack sets a pipeline root and leaves the orchestrator asynchronous by default:
--async is just a convenience flag for the common case orchestrator.synchronous=false.
If you need the explicit setting instead, --extra wins:
You can also keep the same advanced defaults in YAML:
CLI --extra values merge on top of YAML extra: values instead of replacing the whole object.
Kitaru does not try to duplicate every underlying field in its own docs. For full field inventories, see the ZenML component reference for your orchestrator type: Kubernetes, Vertex, SageMaker, AzureML.
Delete a stack
To delete only the stack record and keep its components:
To also remove Kitaru-managed components that are not shared with other stacks:
If the stack you are deleting is currently active, Kitaru protects you by default. Use --force to switch back to the default stack first and then continue:
Use the active stack sandbox from Python
kitaru.run_sandbox_command(...) runs a command in the sandbox attached to your active stack, rather than choosing one by type. It finds the stack's one sandbox component, runs the command in a temporary session, and returns the output.
If the active stack's sandbox is local, the command runs as a local subprocess, so treat it like running on your own machine, not a locked-down container. When a model chooses the command, use an isolated sandbox and minimal credentials. Kitaru raises an error instead of guessing if the active stack has no sandbox, or more than one.
For a runnable version inside a tracked flow, see features/sandbox/active_stack_sandbox_command.py in the examples guide.
Use the Python SDK
The SDK keeps StackInfo intentionally small: id, name, and is_active.
That means is_managed is part of structured list output, not part of StackInfo itself.
One important scope note: the public Python SDK kitaru.create_stack(...) currently provisions local stacks only. Kubernetes, Modal, Vertex, SageMaker, and AzureML stack creation are exposed through the CLI and MCP surfaces.
Precedence with flow-level stack overrides
The active stack is only one layer in the execution precedence chain. Higher layers override it (highest first):
my_flow.run(..., stack="gpu-cluster")@flow(stack="gpu-cluster")kitaru.configure(stack="gpu-cluster")KITARU_STACKpyproject.toml([tool.kitaru].stack)currently active stack
What each layer does:
kitaru stack use prodchanges your persisted default stackkitaru.configure(stack="gpu-cluster")changes the default only for the current Python process@flow(stack="gpu-cluster")binds a default to one specific flow definitionmy_flow.run(stack="gpu-cluster")overrides everything else for that one execution
Those higher-precedence overrides do not change the active stack you see in kitaru stack current; they are temporary execution-time bindings.
Related pages
Last updated
Was this helpful?