bundle.pods.manager

Attributes

Classes

PodSpec

Declarative specification for a single pod.

PodManager

Manages discovery and orchestration of local AI pods.

Module Contents

bundle.pods.manager.log
bundle.pods.manager.PODS_ROOT_ENV = 'BUNDLE_PODS_ROOT'
class bundle.pods.manager.PodSpec(/, **data: Any)[source]

Bases: bundle.core.data.Data

Declarative specification for a single pod.

name

Pod identifier (e.g. “comfyui”, “discord-bot”).

folder

Subdirectory name under the pods root.

service

Docker Compose service name, if the compose file defines one matching the pod name.

buildable

Whether the compose file contains a build: section.

containers

Explicit container_name values parsed from the compose file.

name: str
folder: str
service: str | None = None
buildable: bool = True
containers: list[str] = None
class bundle.pods.manager.PodManager(/, **data: Any)[source]

Bases: bundle.core.entity.Entity

Manages discovery and orchestration of local AI pods.

On construction the manager resolves the Docker Compose CLI, scans the pods_root directory for pod folders (each containing a docker-compose.yml), and caches the resulting PodSpec objects.

All compose operations (build, run, down, status, logs) are async and delegate to ProcessStream for streamed output or Process for captured output.

pods_root: pathlib.Path
classmethod create(pods_root: pathlib.Path | str | None = None) PodManager[source]

Factory that resolves the pods root and returns a ready-to-use manager.

property specs: dict[str, PodSpec]
get(name: str) PodSpec[source]

Look up a pod by name (case-insensitive). Raises ClickException if not found.

pod_path(pod: PodSpec) pathlib.Path[source]

Resolve and validate the filesystem path for a pod.

async running_containers() set[str][source]

Query Docker for currently running container names.

async compose(pod: PodSpec, subcommand: str, stream: bool = False) bundle.core.process.ProcessResult[source]

Execute a docker compose subcommand against a pod’s compose file.

async build(pod: PodSpec) bundle.core.process.ProcessResult | None[source]

Build the pod’s Docker image. Skips pods that use prebuilt images only.

async run(pod: PodSpec) bundle.core.process.ProcessResult[source]

Start a pod in detached mode (up -d).

async down(pod: PodSpec) bundle.core.process.ProcessResult[source]

Stop and remove a pod’s containers and networks.

async status(pod: PodSpec) bundle.core.process.ProcessResult[source]

Return the docker compose ps output for a pod.

async logs(pod: PodSpec, follow: bool = True, tail: int = 200) bundle.core.process.ProcessResult[source]

Stream or show pod container logs.