Architecture Diagram
Overview
Self-hosted executors allow you to:- Run builds on your own hardware or cloud infrastructure
- Use custom build images and tools
- Keep sensitive code and data within your network
- Scale execution capacity independently
- Integrate with existing CI/CD infrastructure
Architecture
Components
BuildBuddy Cloud/Server:- Scheduler service (task queue)
- Remote cache (CAS + Action Cache)
- Build event service
- Web UI and API
- Executor process running in your environment
- Connects to BuildBuddy scheduler via gRPC
- Pulls actions from queue
- Executes builds locally
- Uploads results to cache
- Virtual machines or bare metal servers
- Container orchestration (Kubernetes, ECS, etc.)
- Private network with internet egress
- Local storage for caching
Network Architecture
- Executors initiate outbound connections to BuildBuddy
- No inbound connections required
- Works through corporate firewalls and NAT
- All communication over gRPC with TLS
Deployment Options
1. Docker Container
Simplest deployment method:- Quick to get started
- Easy to update
- Good for testing
- Limited isolation
- Resource management requires Docker configuration
2. Kubernetes
Recommended for production:- Automatic scaling
- Health monitoring and restarts
- Resource management
- Easy to manage multiple executors
- Requires Kubernetes cluster
- More complex configuration
3. Virtual Machines
For bare-metal performance:- Full control over environment
- Maximum performance
- Can use specialized hardware (GPUs, etc.)
- Manual scaling
- More operational overhead
4. Cloud Provider Services
AWS ECS:Configuration
Basic Configuration
Advanced Configuration
Isolation Mechanisms
Docker Containers
Configuration:- Each action runs in fresh container
- Container image specified by action or default
- Inputs mounted into container
- Command executed
- Outputs extracted
- Container destroyed
- Strong filesystem isolation
- Reproducible environments
- Easy to customize (just change image)
- Requires Docker daemon
- Container startup overhead (usually <1s)
Podman Containers
Configuration:- Rootless execution (better security)
- Compatible with Docker images
- No daemon required
Firecracker VMs
Configuration:- Strong isolation (hardware virtualization)
- Fast startup (<1s)
- Minimal overhead
- Running untrusted code
- Multi-tenant environments
- Security-sensitive builds
Bare Metal Sandbox
Configuration:- Lowest overhead
- Fastest execution
- Minimal isolation
- Only for trusted code
Custom Build Images
Create custom images with your tools:Scaling
Horizontal Scaling
Add more executor instances: Kubernetes:- Deploy additional VMs
- Run executor on each
- All connect to same scheduler
Auto-scaling
Kubernetes HPA:- Configure ASG for executor instances
- Scale based on CPU or custom metrics
- BuildBuddy provides queue depth metrics
Monitoring
Health Checks
Metrics
Executor exposes Prometheus metrics:buildbuddy_executor_tasks_started_totalbuildbuddy_executor_tasks_completed_totalbuildbuddy_executor_task_duration_secondsbuildbuddy_executor_cpu_utilizationbuildbuddy_executor_memory_utilization
Logs
Security
API Key Management
Store API keys securely: Kubernetes Secret:Network Security
- TLS required for all connections
- Firewall rules:
- Allow outbound to BuildBuddy (port 443/1986)
- No inbound connections required
- Private network for executors
- VPC/subnet isolation
Isolation
- Use Firecracker VMs for untrusted code
- Run executors in separate network segment
- Limit resource access via IAM/RBAC
- Monitor for suspicious activity
Troubleshooting
Executor not connecting
- Check API key is correct
- Verify network connectivity to BuildBuddy
- Check firewall rules allow outbound HTTPS
- Review executor logs for errors
Slow execution
- Check executor resource utilization
- Monitor network bandwidth
- Check local cache hit rate
- Review action timeout settings
Actions failing
- Check action logs in BuildBuddy UI
- Verify container image is accessible
- Check resource limits (memory, disk)
- Review platform property matching