Packaging & Deployment¶
Deploy Vertebra applications as standard Python packages (vtb run), containers with automatic cgroup sizing, or self-contained standalone and single-file binaries.
Standalone & Single-File Binaries¶
Build a relocatable directory or a SHA-256 verified single-file executable containing your Python application, compiled extensions, Python runtime, and frontend assets:
Pass --include-agent-skills to bundle .agents/skills inside the output (AGENTS.md and CLAUDE.md are excluded, and VERTEBRA_APP_ROOT is set at launch).
You can also drive builds from Python:
from pathlib import Path
from vertebra.build import BuildConfig
from vertebra.build.packaging import BuildTarget, OnefileBuilder, StandaloneBuilder
config = BuildConfig.load(Path("."))
target = BuildTarget.detect_host()
standalone = StandaloneBuilder(
project_dir=Path("."),
target=target,
entrypoint=config.app or "app:app",
)
dist_dir = standalone.build(Path("dist/standalone"))
onefile = OnefileBuilder(dist_dir=dist_dir, target=target)
TypeScript, Zod, OpenAPI & Protobuf Codegen¶
Generate TypeScript route types, Zod or Valibot validation schemas, RPC clients, OpenAPI 3.1 specs, and .proto definitions from your Python routes and msgspec.Struct models:
Release Wheels & Shared Python¶
Release wheels for vertebra-core on Linux (x86_64, aarch64) and macOS (arm64, x86_64) include the pre-compiled vertebra-server binary. Running it requires a Python installation built with a shared libpython (such as uv python install), unless you override the binary path with VERTEBRA_SERVER_BINARY.
Container Deployment & Process Supervision¶
When running inside Docker, Kubernetes, or Cloud Run:
- CPU limits: Reads container cgroup quotas automatically so
VERTEBRA_THREADSmatches the container's CPU limit. - Shared memory: Uses anonymous memory descriptors (or
/dev/shmwhen available), so--topology shmworks on read-only container filesystems. - Process supervision: With
--workers > 1, the supervisor monitors worker processes, coordinates gracefulSIGTERMdrains, and restarts crashed workers. - Google Cloud TLS certificates: Spanner Data and BigQuery Storage gRPC clients trust both system roots and bundled roots. Spanner admin DDL runs over REST using the OS certificate store, so minimal container images running Spanner DDL must include a CA bundle such as
ca-certificates. Standard proxy variables (HTTPS_PROXY,HTTP_PROXY,ALL_PROXY,NO_PROXY) apply to REST calls.
WebAssembly Plugin Sandboxes¶
Run untrusted plugins or custom data transforms inside WASI WebAssembly sandboxes bounded by memory, fuel, and timeout limits:
from vertebra.wasm import WASMModuleConfig, WASMPluginHost, WASMSandboxPolicy
policy = WASMSandboxPolicy(
max_memory_bytes=32 * 1024 * 1024,
max_fuel=5_000_000,
epoch_timeout_ms=250,
allow_network=False,
)
module = WASMModuleConfig(
name="transform",
wasm_source="plugins/transform.wasm",
policy=policy,
)
host = WASMPluginHost()