Infrastructure
This directory contains Terraform configurations for deploying agent-eval-harness to various cloud providers.
Directory Structure
infra/
├── modules/ # Reusable Terraform modules
│ ├── aws-ecs/ # AWS ECS Fargate compute
│ ├── aws-rds/ # AWS RDS PostgreSQL database
│ ├── aws-redis/ # AWS ElastiCache Redis
│ ├── aws-s3/ # AWS S3 storage
│ ├── aws-secrets/ # AWS Secrets Manager
│ ├── azure-container-apps/ # Azure Container Apps
│ ├── cloud-run/ # GCP Cloud Run
│ ├── netlify/ # Netlify deployment
│ ├── oci-oke/ # Oracle Container Engine (OKE)
│ └── vercel/ # Vercel deployment
└── environments/ # Environment-specific configurations
├── aws/ # AWS deployment
├── azure/ # Azure deployment
├── dev/ # GCP development
├── netlify/ # Netlify deployment
├── oci/ # Oracle Cloud deployment
├── prod/ # GCP production
└── vercel/ # Vercel deployment
Supported Platforms
| Platform | Compute | Database | Cache | Storage | Status |
|---|---|---|---|---|---|
| AWS | ECS Fargate | RDS PostgreSQL | ElastiCache Redis | S3 | ✅ Complete |
| Azure | Container Apps | PostgreSQL | Redis Cache | Blob Storage | ✅ Complete |
| GCP | Cloud Run | Cloud SQL | Memorystore | Cloud Storage | ✅ Complete |
| OCI | OKE (Kubernetes) | Autonomous DB | Redis | Object Storage | ✅ Complete |
| Netlify | Serverless Functions | External | External | External | ✅ Complete |
| Vercel | Serverless Functions | External | External | External | ✅ Complete |
AWS Deployment
Prerequisites
- AWS CLI configured with appropriate credentials
- Terraform >= 1.0
- A VPC with private and public subnets
- Docker image built and pushed to ECR or public registry
Quick Start
-
Navigate to the AWS environment:
terminalcd environments/aws -
Copy and configure the terraform.tfvars file:
terminalcp terraform.tfvars.example terraform.tfvars # Edit terraform.tfvars with your values -
Required variables:
vpc_id- ID of your VPCimage_url- Docker image URLdb_password- Secure password for the database
-
Initialize and deploy:
terminalterraform init terraform plan terraform apply
Architecture
┌─────────────────────────────────────────────────────────────┐
│ VPC │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Private Subnets │ │
│ │ ┌───────────┐ ┌───────────┐ ┌───────────┐ │ │
│ │ │ RDS │ │ Redis │ │ ECS │ │ │
│ │ │ PostgreSQL│ │ElastiCache│ │ Fargate │ │ │
│ │ └───────────┘ └───────────┘ └───────────┘ │ │
│ │ │ │ │
│ │ ┌───────────┐ │ │ │
│ │ │ S3 │◄─────────────────────────┘ │ │
│ │ └───────────┘ │ │
│ └─────────────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Secrets Manager │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Azure Deployment
Prerequisites
- Azure CLI configured with appropriate credentials
- Terraform >= 1.0
- Docker image pushed to Azure Container Registry
Quick Start
-
Navigate to the Azure environment:
terminalcd environments/azure -
Configure terraform.tfvars:
resource_group_name- Name of resource grouplocation- Azure regionimage_url- ACR image URLdb_admin_username- PostgreSQL admindb_admin_password- PostgreSQL password
-
Initialize and deploy:
terminalterraform init terraform plan terraform apply
Architecture
- Compute: Azure Container Apps with auto-scaling
- Database: Azure Database for PostgreSQL
- Cache: Azure Cache for Redis
- Storage: Azure Blob Storage
- Monitoring: Application Insights + Log Analytics
GCP Deployment
Prerequisites
- GCP CLI (gcloud) configured
- Terraform >= 1.0
- Docker image pushed to GCR or Artifact Registry
Quick Start
-
Navigate to the GCP environment:
terminalcd environments/dev # or environments/prod -
Configure terraform.tfvars:
project_id- GCP project IDregion- GCP regionimage_url- Container image URL
-
Initialize and deploy:
terminalterraform init terraform plan terraform apply
Architecture
- Compute: Cloud Run (serverless containers)
- Secrets: Secret Manager
- Storage: Cloud Storage
- Monitoring: Cloud Monitoring + Cloud Trace
OCI Deployment
Prerequisites
- OCI CLI configured with API signing keys
- Terraform >= 1.0
- Docker image pushed to OCI Registry
Quick Start
-
Navigate to the OCI environment:
terminalcd environments/oci -
Configure terraform.tfvars:
compartment_id- OCI compartmentregion- OCI regiontenancy_ocid,user_ocid,fingerprint- API credentialsimage_url- Container image URL
-
Initialize and deploy:
terminalterraform init terraform plan terraform apply
Architecture
- Compute: Oracle Container Engine for Kubernetes (OKE)
- Network: VCN with public/private subnets
- Storage: Object Storage
- Monitoring: OCI Monitoring + Logging
Netlify Deployment
Prerequisites
- Netlify account with API token
- Terraform >= 1.0
- Frontend build artifacts
Quick Start
-
Navigate to the Netlify environment:
terminalcd environments/netlify -
Configure terraform.tfvars:
netlify_token- Netlify API tokensite_name- Site nameaccount_slug- Account slug
-
Initialize and deploy:
terminalterraform init terraform plan terraform apply
Features
- Automatic HTTPS
- CDN distribution
- Serverless functions
- Preview deployments
- Custom headers and redirects
Vercel Deployment
Prerequisites
- Vercel account with API token
- Terraform >= 1.0
- GitHub repository connected to Vercel
Quick Start
-
Navigate to the Vercel environment:
terminalcd environments/vercel -
Configure terraform.tfvars:
vercel_token- Vercel API tokenproject_name- Project namerepo- GitHub repository (owner/repo)
-
Initialize and deploy:
terminalterraform init terraform plan terraform apply
Features
- Automatic preview deployments for PRs
- Edge functions
- Serverless functions
- Custom domains
- Analytics integration
Development
Running Locally
For local development, use Docker Compose:
cd ../.. # Project root
docker-compose upModule Development
When creating new modules:
- Create directory:
modules/<provider>-<service>/ - Add
main.tf,variables.tf,outputs.tf - Follow naming conventions
- Document all variables and outputs
Testing Changes
- Run
terraform fmt -recursiveto format all files - Run
terraform validatein each environment - Run
terraform planto preview changes - Test in dev environment first
Troubleshooting
Common Issues
- VPC Subnet Discovery (AWS): Ensure your VPC has subnets tagged appropriately
- Image Pull Errors: Verify the image URL is accessible from your account
- Database Connection: Check security group rules and network connectivity
- Permissions: Ensure your credentials have sufficient permissions
Getting Help
- Check the specific environment’s README for detailed documentation
- Review the module’s variables.tf for configuration options
- Check CloudWatch/Cloud Monitoring logs for runtime issues
