Files
smom-dbis-138/.cursor/plans/phase-2-docker-compose-implementation-a13f0d0f.plan.md
defiQUG 1fb7266469 Add Oracle Aggregator and CCIP Integration
- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control.
- Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities.
- Created .gitmodules to include OpenZeppelin contracts as a submodule.
- Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment.
- Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks.
- Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring.
- Created scripts for resource import and usage validation across non-US regions.
- Added tests for CCIP error handling and integration to ensure robust functionality.
- Included various new files and directories for the orchestration portal and deployment scripts.
2025-12-12 14:57:48 -08:00

3.2 KiB

Phase 2 Docker Compose Implementation

Overview

Create and integrate 5 region-specific docker-compose files for Phase 2 deployment. Each file contains a complete multi-service stack for its respective region node.

Files to Create

Docker Compose Files

  • docker/phase2/docker-compose.cus.yml - Central US (Besu + FireFly Core A + Cacti Core A + Chainlink A + shared DBs + agents)
  • docker/phase2/docker-compose.eus.yml - East US (Besu + FireFly Core B + primary FireFly/Cacti DBs + Chainlink B + agents)
  • docker/phase2/docker-compose.eus2.yml - East US 2 (Besu + FireFly DataExchange A + IPFS + Cacti UI + Prometheus primary + agents)
  • docker/phase2/docker-compose.wus.yml - West US (Besu + FireFly DataExchange B + Prometheus secondary + Grafana + Alertmanager + Chainlink C + agents)
  • docker/phase2/docker-compose.wus2.yml - West US 2 (Besu + Loki + Log UI + FireFly Postgres Replica + Cacti Core B + agents)

Terraform Integration

  • terraform/phases/phase2/phase2-main.tf - Main Phase 2 Terraform configuration
  • terraform/phases/phase2/variables.tf - Phase 2 variables
  • terraform/phases/phase2/outputs.tf - Phase 2 outputs

Implementation Details

Docker Compose Files Structure

Each docker-compose file includes:

  • Besu service (consistent across all regions)
  • Region-specific services (FireFly, Cacti, Chainlink variants)
  • Database services (PostgreSQL for FireFly and Cacti)
  • Monitoring agents (node-exporter, cadvisor, log-shipper)
  • Additional services per region (IPFS, Prometheus, Grafana, Loki, etc.)

Terraform Integration Strategy

  1. Create Phase 2 Terraform configuration that:
  • References Phase 1 VM outputs to get VM connection details
  • Uses file provisioner or remote-exec to copy docker-compose files to VMs
  • Deploys docker-compose files to /opt/docker-compose/ directory on each VM
  • Updates systemd service or creates deployment script to use region-specific compose file
  1. Region-to-file mapping:
  • centralusdocker-compose.cus.yml
  • eastusdocker-compose.eus.yml
  • eastus2docker-compose.eus2.yml
  • westusdocker-compose.wus.yml
  • westus2docker-compose.wus2.yml

Key Considerations

  • Preserve Phase 1 deployment (don't modify existing Phase 1 configs)
  • Use Phase 1 outputs to reference existing VMs
  • Handle file deployment via Terraform provisioners
  • Update systemd service or create deployment scripts to use correct compose file per region
  • Ensure all volume paths are created (e.g., /opt/besu/*, /opt/firefly/*, /opt/cacti/*, /opt/prometheus/*, etc.)

To-dos

  • Create 5 docker-compose files in docker/phase2/ directory (cus, eus, eus2, wus, wus2) with all services from user specifications
  • Create terraform/phases/phase2/ directory structure with main.tf, variables.tf, and outputs.tf
  • Implement Terraform configuration to deploy docker-compose files to VMs using file provisioner or remote-exec
  • Create deployment scripts or systemd service updates to use region-specific docker-compose files on VMs
  • Add Terraform outputs for Phase 2 deployment status and VM connection information