Phase 5: Deployment
Phase 5 builds the transpiled Rust project into a final binary, with support for release optimization, cross-compilation, and WebAssembly targets.
Overview
Deployment is the final phase of the transpilation pipeline. It compiles the validated Rust code into a distributable binary:
Validated .rs project
│
▼
┌──────────────────────────┐
│ cargo build │
│ --release │ ← Optional: release mode
│ --target <triple> │ ← Optional: cross-compile
│ --target wasm32-unknown │ ← Optional: WebAssembly
│ [extra cargo_flags] │ ← From batuta.toml
└────────────┬─────────────┘
│
▼
Final Binary / .wasm
Build Modes
Debug Build
Default mode for quick iteration:
batuta build
Release Build
Optimized binary with the profile settings from Phase 3:
batuta build --release
WebAssembly
Builds for wasm32-unknown-unknown target:
batuta build --wasm --release
Cross-Compilation
Target a specific platform:
batuta build --release --target aarch64-unknown-linux-gnu
batuta build --release --target x86_64-apple-darwin
Configuration
Build settings are read from batuta.toml:
[transpilation]
output_dir = "./rust-output" # Compiled project location
[build]
cargo_flags = ["--locked"] # Extra flags for cargo build
The build command:
- Reads
transpilation.output_dirto locate the project - Verifies
Cargo.tomlexists - Appends
build.cargo_flagsto the cargo command - Runs
cargo buildwith inherited stdio
Jidoka Integration
Build failures (non-zero cargo exit code) mark the Deployment phase as failed in the workflow state. The exit code is captured and reported. Success marks the full 5-phase migration as complete.
Beyond batuta build
For production deployment of ML models (not transpiled code), Batuta also provides:
batuta serve— Serve models via Realizar with OpenAI-compatible APIbatuta deploy— Generate Docker, Lambda, K8s, Fly.io, or Cloudflare deploymentsbatuta pacha— Model registry with versioning and Ed25519 signatures
CLI Reference
See batuta build for full command documentation.
Previous: Phase 4: Validation Next: Part III: The Tool Ecosystem