Orchestrator is an experimental, Rust-based build orchestration system designed to execute builds inside isolated Firecracker microVMs for secure, deterministic, and reproducible builds.
This project explores the design and implementation of a minimal CI-style pipeline focused on strong isolation guarantees, explicit build lifecycles, and transparent artifact handling β without relying on Docker or heavyweight orchestration platforms.
β οΈ Project Status: MVP / R&D Orchestrator is intentionally scoped and not production-hardened. It exists to explore microVM-based build isolation, Firecracker control flows, and end-to-end build orchestration in Rust.
What this project is:
- A hands-on exploration of Firecracker-based build isolation
- A reference implementation of a microVM-driven build pipeline
- A systems-level Rust project focused on clarity and control
What this project is not:
- A drop-in replacement for GitHub Actions, Tekton, or Buildkite
- A multi-tenant or horizontally scalable CI platform
- β Firecracker VM Control: Start/stop/kill microVMs with unique sockets
- β Git Repository Support: Clone repos with specific branch/commit
- β Build Execution: Run builds inside isolated VMs with shared workspace
- β Artifact Storage: Collect and store build artifacts
- β REST API: HTTP endpoints for triggering and monitoring builds
- β Real-time Status: Track build progress through multiple stages
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β HTTP API βββββΆβ Build Pipeline βββββΆβ Firecracker β
β (Axum) β β (Worker) β β Manager β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Git Manager β β Artifact Manager β β VM Storage β
β (git2) β β (Filesystem) β β (Sockets) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
- Linux (Firecracker is Linux-only)
- Rust 1.70+
- Firecracker v1.13+
- sudo access (for VM management)
# System dependencies
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
git \
pkg-config \
libssl-dev \
libffi-dev \
python3-dev \
debootstrap \
e2fsprogs \
qemu-utils \
curl \
wget
# Rust (if not installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
# Firecracker
sudo apt-get install -y firecracker
# Or download from GitHub releases
wget https://github.com/firecracker-microvm/firecracker/releases/download/v1.13.1/firecracker-v1.13.1-x86_64.tgz
tar xzf firecracker-v1.13.1-x86_64.tgz
sudo cp release-v1.13.1-x86_64/firecracker /usr/local/bin/
sudo chmod +x /usr/local/bin/firecrackersudo yum groupinstall -y "Development Tools"
sudo yum install -y \
cmake \
git \
pkgconfig \
openssl-devel \
libffi-devel \
python3-devel \
debootstrap \
e2fsprogs \
qemu-imggit clone <repository-url>
cd orchestratorcargo build --release# This creates an Alpine Linux rootfs with Rust toolchain
./setup_builder_rootfs.sh# Create base directory
mkdir -p ~/.orchestrator/firecracker/{kernel,rootfs,sockets,vms,logs}
# Create or install a kernel image (vmlinux) suitable for Firecracker.
# You can provide a prebuilt vmlinux via URL or build one locally using the included helper script.
# Example (download a prebuilt vmlinux):
# ./setup_kernel.sh --download https://example.com/path/to/vmlinux
# Example (build from kernel source tree on your machine):
# ./setup_kernel.sh --build 5.15
# If you already have a vmlinux file, copy it here:
# cp /path/to/vmlinux ~/.orchestrator/firecracker/kernel/
# The rootfs should be created by setup_builder_rootfs.sh# Optional: Set custom directory
export ORCHESTRATOR_DIR=/custom/path
# Optional: Set server host/port
export HOST=0.0.0.0
export PORT=8080cargo runcargo run --releaseORCHESTRATOR_DIR=/data/orchestrator HOST=0.0.0.0 PORT=9090 cargo run --releaseThe server will start on http://127.0.0.1:8080 by default.
curl -X POST http://localhost:8080/build \
-H "Content-Type: application/json" \
-d '{
"repo_url": "https://github.com/ari/platform-repo",
"branch": "feature-x",
"commit": "abc123def456"
}'Response:
{
"build_id": "build_01234567-89ab-cdef-0123-456789abcdef",
"status": "queued"
}curl http://localhost:8080/build/build_01234567-89ab-cdef-0123-456789abcdefResponse:
{
"id": "build_01234567-89ab-cdef-0123-456789abcdef",
"status": "completed",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:35:00Z",
"repo_url": "https://github.com/ari/platform-repo",
"branch": "feature-x",
"commit": "abc123def456",
"artifacts_count": 3,
"log": [
"[2024-01-15 10:30:00 UTC] Build queued",
"[2024-01-15 10:30:05 UTC] Cloning repository",
"[2024-01-15 10:30:15 UTC] Starting VM",
"[2024-01-15 10:30:20 UTC] Running build",
"[2024-01-15 10:35:00 UTC] Collecting artifacts",
"[2024-01-15 10:35:05 UTC] Build completed"
]
}curl http://localhost:8080/buildscurl http://localhost:8080/health- Queued β Build request received
- CloningRepo β Git repository being cloned
- StartingVM β Firecracker VM starting
- RunningBuild β Build command executing in VM
- CollectingArtifacts β Gathering build outputs
- Completed β Build finished successfully
- Failed β Build failed with error message
~/.orchestrator/
βββ firecracker/
β βββ kernel/
β β βββ vmlinux # Linux kernel
β βββ rootfs/
β β βββ builder.ext4 # Builder rootfs
β βββ sockets/ # VM API sockets
β βββ vms/ # VM-specific data
β βββ logs/ # Firecracker logs
βββ builds/
β βββ <build_id>/
β βββ repo/ # Cloned repository
β βββ workspace/ # Shared workspace
βββ artifacts/
βββ <build_id>/
βββ target/release/ # Build artifacts
βββ manifest.json # Artifact manifest
βββ ... # Other build outputs
ORCHESTRATOR_DIR: Base directory (default:~/.orchestrator)HOST: Server host (default:127.0.0.1)PORT: Server port (default:8080)RUST_LOG: Log level (default:info)
FIRECRACKER_KERNEL: Absolute path to the kernel image (vmlinux). If unset, defaults to~/.orchestrator/firecracker/kernel/vmlinux.FIRECRACKER_ROOTFS: Absolute path to the builder root filesystem (ext4). If unset, defaults to~/.orchestrator/firecracker/rootfs/builder.ext4.
You can quickly inspect the resolved paths with:
cargo run --bin pathsBuilds use these default settings:
- VM Resources: 2 vCPUs, 2GB RAM
- Build Command:
cargo build --release - Workspace:
/workspace(shared hostβVM) - Timeout: 10 minutes per build
# Install Firecracker
which firecracker
# Should output: /usr/local/bin/firecracker# Use the helper script to download or build a kernel, or ensure a vmlinux exists in the kernel dir
./setup_kernel.sh --download <url-to-vmlinux>
ls -la ~/.orchestrator/firecracker/kernel/vmlinux# Create builder rootfs
./setup_builder_rootfs.sh
ls -la ~/.orchestrator/firecracker/rootfs/builder.ext4# Check permissions
ls -la ~/.orchestrator/
sudo chown -R $USER:$USER ~/.orchestrator/# Check Firecracker logs
tail -f ~/.orchestrator/firecracker/logs/<vm_id>.log
# Check if socket exists
ls -la ~/.orchestrator/firecracker/sockets/# Enable debug logging
RUST_LOG=debug cargo run
# Check VM status
./monitor_firecracker_vms.sh# Stop all VMs
./kill_firecracker_vms.sh all
# Clean orchestrator data
rm -rf ~/.orchestrator/# Delete all vmlinux and *.ext4 images under your orchestrator data dir
find "${ORCHESTRATOR_DIR:-$HOME/.orchestrator}" -type f \( -name 'vmlinux' -o -name '*.ext4' \) -print -deletecargo testsrc/
βββ main.rs # Application entry point
βββ api/ # HTTP API handlers
βββ build/ # Build data structures
βββ firecracker/ # VM management
βββ git/ # Git operations
βββ artifacts/ # Artifact collection
βββ pipeline/ # Build orchestration
- Add new API endpoints in
src/api/mod.rs - Extend build pipeline in
src/pipeline/mod.rs - Update data structures in
src/build/mod.rs - Add configuration options as needed
- β No networking between VM and host
- β No persistent VMs (fresh VM per build)
- β No parallel builds (single worker)
- β No GitHub webhooks
- β No artifact publishing
- β No preview URLs
- β No user accounts
- β No Kubernetes integration
- β SSH into VM for debugging
- β Multiple builders (VM pool)
- β Snapshot-based fast builders
- β GitHub App for automatic PR builds
- β Preview deployments
- β Full pipeline definitions
- β API for listing builds, logs
- β Artifact signing
- β Multi-tenant isolation
- β VMs in Firecracker jailer
- β WASI+WASM build environments
MIT License - see LICENSE file for details.
- Fork the repository
- Create feature branch
- Make your changes
- Add tests
- Submit pull request
- Create an issue for bugs or feature requests
- Check existing issues before creating new ones
- Provide detailed reproduction steps
Built with β€οΈ for secure, reproducible builds