🛠️ Infrastructure Setup Guide
This guide explains how to deploy the Automation Center on a Linux server (Oracle Cloud / VPS).
1. Prerequisites
Ensure the following are available before deployment:
- Linux server with SSH access (Oracle Cloud, AWS, VPS, etc.)
- Docker & Docker Compose installed
- MongoDB Atlas connection string
- Open ports for HTTP/HTTPS and RabbitMQ (if external)
- Gemini API Key: Required for the AI Root Cause Analysis feature.
2. Server Configuration (.env)
The system now supports dynamic environment mapping and AI integration.
# Database & Queue (PaaS Infrastructure)
MONGODB_URL=mongodb+srv://<user>:<pass>@cluster.mongodb.net/automation_platform
RABBITMQ_URL=amqp://automation-rabbitmq
REDIS_URL=redis://automation-redis:6379
# AI Configuration (NEW)
GEMINI_API_KEY=AIzaSy...your_key_here
# Dashboard Defaults (Pre-fills the UI)
DEFAULT_TEST_IMAGE=keinar101/my-automation-tests:latest
DEFAULT_BASE_URL=https://your-app.com
DEFAULT_TEST_FOLDER=all
# --- AGNOSTIC SECRET INJECTION ---
# These variables belong to the CLIENT tests.
# The platform does not interpret them — it only injects them.
ADMIN_USER=admin@example.com
ADMIN_PASS=secure_password
MONGO_URI=mongodb+srv://... (Client DB)
# --- DYNAMIC ENVIRONMENTS ---
# Defining these variables will automatically enable them in the Dashboard UI
DEV_URL=http://localhost:5173
STAGING_URL=https://staging.photographer.keinar.com
PRODUCTION_URL=https://photographer.keinar.com
# WHITE LIST
# Only variables declared here are injected into the test container
INJECT_ENV_VARS=ADMIN_USER,ADMIN_PASS,GEMINI_API_KEY,MONGO_URI
3. The Worker Service Workflow
The Worker is the heart of the execution engine. Here is the updated lifecycle of a test run:
-
Pull: Worker pulls the requested Docker image (if not cached).
-
Run: Executes the container with the secure
entrypoint.sh. -
Stream: Logs are streamed in real-time to Redis/MongoDB and the Dashboard.
-
Completion Check:
- ✅ PASS: Status updated to
PASSED. - ❌ FAIL: Status updated to
ANALYZING.
- ✅ PASS: Status updated to
-
AI Analysis (If Failed):
- The Worker gathers the failure logs.
- It sends them to the Gemini 2.5 Flash model.
- Generates a "Root Cause Analysis" and "Suggested Fix".
- Updates the execution record with the analysis report.
- Final status set to
FAILED(orUNSTABLE).
4. Deployment
Build and start the production stack:
docker compose -f docker-compose.prod.yml up -d --build
Once deployed:
- The Dashboard becomes accessible via browser.
- The Producer API handles job requests.
- The Worker listens for tasks on RabbitMQ.
5. Troubleshooting
| Issue | Resolution |
|---|---|
| Tests fail instantly | Verify INJECT_ENV_VARS in .env. |
| No AI Analysis | Check if GEMINI_API_KEY is set and valid. |
| Container exits immediately | Check entrypoint.sh permissions. |
| Status stuck on ANALYZING | Check Worker logs for timeouts connecting to Google AI. |