Deployment Guide
Deployment Guide
Section titled “Deployment Guide”This document covers deployment architecture, service endpoints, and testing deployed environments.
Architecture Overview
Section titled “Architecture Overview”The consumer-agent service is deployed as an internal-only service using AWS ECS Fargate with service discovery. It is not exposed through the partners-gateway and uses AWS Cloud Map for internal service-to-service communication.
Service Architecture
Section titled “Service Architecture”┌─────────────────┐│ Rover Agent │ (Go Service - Public API)└────────┬────────┘ │ HTTP via Service Discovery ▼┌─────────────────┐│ Consumer Agent │ (Python Service - Internal)└────────┬────────┘ │ ├─► OpenAI API ├─► Rover MCP (via partners-gateway) ├─► DynamoDB (conversation history) └─► Opik (observability)Key Points:
- Consumer-agent is internal, accessed via AWS Cloud Map service discovery
- Rover-agent (Go service) is the public-facing API
- Endpoints:
https://{env}-consumer-agent.us-east-1.{env}-services.fetchrewards.com
Deployment Endpoints
Section titled “Deployment Endpoints”| Environment | Endpoint URL |
|---|---|
| Stage | https://stage-consumer-agent.us-east-1.stage-services.fetchrewards.com |
| Prod | https://prod-consumer-agent.us-east-1.prod-services.fetchrewards.com |
Access: Requires VPN (Cloudflare WARP) for testing.
Deployment Process
Section titled “Deployment Process”Via GitHub Actions
Section titled “Via GitHub Actions”- Go to Actions → Stage/Prod Deploy FSD
- Run workflow with environment, deployment YAML, region, and image tag
- Workflow: Test → Build → Push to ECR → Deploy FSD
Manual Deployment
Section titled “Manual Deployment”# Build and pushdocker build -t consumer-agent:latest .docker tag consumer-agent:latest 292095839402.dkr.ecr.us-east-1.amazonaws.com/fetchrewards/consumer-agent:latestaws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 292095839402.dkr.ecr.us-east-1.amazonaws.comdocker push 292095839402.dkr.ecr.us-east-1.amazonaws.com/fetchrewards/consumer-agent:latest
# Deploy with FSDfsd service ecs \ --env stage \ deploy \ --account stage-services \ --region us-east-1 \ --version latest \ --source-legacy consumer-agent.ymlTesting Deployed Environments
Section titled “Testing Deployed Environments”VPN Connection
Section titled “VPN Connection”warp-cli status # Check statuswarp-cli connect # Connect if neededHealth Check
Section titled “Health Check”curl -s https://stage-consumer-agent.us-east-1.stage-services.fetchrewards.com/health | jqStream Endpoint Test
Section titled “Stream Endpoint Test”curl -X POST https://stage-consumer-agent.us-east-1.stage-services.fetchrewards.com/agent/stream \ -H "Content-Type: application/json" \ -H "userId: 663cdb01ae78d11e2f19ab44" \ -d '{ "messages": [{"role": "user", "content": "Hello"}], "agent_id": "conversational", "enabled_components": [], "latitude": 41.8781, "longitude": -87.6298, "locale": "en" }' | head -50Parameters:
enabled_components:["offer-list", "prompt-suggestion", "general-instructions"]locale:enores-419
Infrastructure
Section titled “Infrastructure”ECS Service (consumer-agent.yml)
Section titled “ECS Service (consumer-agent.yml)”- Cluster:
{env}-fargate - CPU: 1 vCPU, Memory: 2 GB
- Port: 8080, Health Check:
/health - Auto-scaling: Min 1, Max 1 (no scaling enabled)
- Alarms: Disabled (
alarms_enabled: false)
DynamoDB Table
Section titled “DynamoDB Table”Name: {env}-consumer-agent-history
Schema:
- Primary Key:
UserId(HASH) +MessageId(RANGE) - GSI:
GSI_UserRole(UserId + CreatedAt) - TTL: 90 days
- Billing: On-demand
Secrets Manager
Section titled “Secrets Manager”| Secret Path | Description |
|---|---|
rover-agent-{env}/openai-api-key | OpenAI API key |
rover-agent-{env}/opik-api-key | Opik observability key |
rover-mcp/auth-tokens | Rover MCP authorization |
Service Discovery
Section titled “Service Discovery”- Namespace:
{env}-services.fetchrewards.com - Service:
consumer-agent - Region:
us-east-1 - Protocol: HTTPS
Monitoring
Section titled “Monitoring”CloudWatch Logs
Section titled “CloudWatch Logs”{env}-consumer-agent/default- Application logs{env}-consumer-agent/firelens- Fluent Bit logs{env}-consumer-agent/otel- OpenTelemetry logs
Opik Tracing
Section titled “Opik Tracing”- Projects:
consumer-agent-stage,consumer-agent-prod - Workspace:
consumer-agent - Traces: request metadata, prompts, tool calls, tokens, timing
Troubleshooting
Section titled “Troubleshooting”Health Check Returns 404
Section titled “Health Check Returns 404”- Check VPN connection:
warp-cli status - Verify ECS service exists:
Terminal window aws ecs describe-services \--cluster stage-fargate \--services consumer-agent \--profile stage-services-admin \--region us-east-1
Rover MCP Connection Timeout
Section titled “Rover MCP Connection Timeout”Check:
ROVER_MCP_AUTHORIZATIONsecret configuredrover_mcp.server_urlin settings.yaml correct- Rover MCP service healthy
DynamoDB Access Denied
Section titled “DynamoDB Access Denied”Check:
- IAM role has DynamoDB permissions (in consumer-agent.yml)
- Table exists:
{env}-consumer-agent-history - Correct region:
us-east-1
Opik Tracing Not Working
Section titled “Opik Tracing Not Working”Check:
OPIK_API_KEYsecret existsopik.enabled: truein settings.yaml- Correct project name for environment
Configuration Reference
Section titled “Configuration Reference”Runtime Environment Variables
Section titled “Runtime Environment Variables”| Variable | Description |
|---|---|
AWS_REGION | AWS region (us-east-1) |
ENVIRONMENT | Environment (stage/prod) |
PORT | HTTP port (8080) |
FSD_DEPLOY | Indicates FSD deployment (true) |
HISTORY_TABLE_NAME | DynamoDB table name |
Production Recommendations
Section titled “Production Recommendations”- Enable Auto-scaling: Set
autoscale_minsize: 2,autoscale_maxsize: 10 - Enable Alarms: Set
alarms_enabled: true,alarm_priority: sre-high-priority - Increase Resources: Consider
cpu: 2,memory: 4if needed - Multi-AZ Deployment: Configure in FSD for high availability
Related Documentation
Section titled “Related Documentation”- Setup Guide - Local development setup
- Architecture - Agent architecture and patterns
- MCP Integration - Tool server integration
- Integration Testing - Testing with AWS services