- 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.
7.1 KiB
7.1 KiB
Script Consolidation Complete
✅ Completed Consolidations
1. Monitor Scripts (9 → 1 script)
Consolidated into: scripts/deployment/monitor-deployment-consolidated.sh
Replaced scripts:
monitor-deployment.shmonitor-and-complete.shmonitor-and-fix.shmonitor-continuous.shmonitor-deployment-live.shlive-monitor.shcontinuous-monitor.shmonitor-36-region-deployment.shdeployment-dashboard.sh
Features:
- Multiple modes:
status,continuous,live,complete,fix,dashboard - Configurable intervals and max checks
- Uses common libraries for consistent logging and error handling
Usage:
# Quick status check
./scripts/deployment/monitor-deployment-consolidated.sh
# Continuous monitoring
./scripts/deployment/monitor-deployment-consolidated.sh --mode continuous
# Live updates
./scripts/deployment/monitor-deployment-consolidated.sh --mode live --interval 10
# Dashboard view
./scripts/deployment/monitor-deployment-consolidated.sh --mode dashboard
2. Parallel Deployment Scripts (11 → 1 script)
Consolidated into: scripts/deployment/deploy-parallel-consolidated.sh
Replaced scripts:
deploy-parallel.shdeploy-all-parallel.shdeploy-besu-parallel.shdeploy-max-parallel.shdeploy-ultra-parallel.shdeploy-besu-max-parallel.shdeploy-monitoring-parallel.shconfigure-kubernetes-parallel.shconfigure-kubernetes-max-parallel.shdeploy-contracts-parallel.shverify-all-clusters-parallel.shverify-all-max-parallel.sh
Features:
- Multiple resource types:
infrastructure,kubernetes,besu,monitoring,contracts,verify - Configurable parallelism
- Region selection support
- Uses common libraries
Usage:
# Deploy infrastructure to all regions
./scripts/deployment/deploy-parallel-consolidated.sh --resource infrastructure
# Deploy Besu network
./scripts/deployment/deploy-parallel-consolidated.sh --resource besu --parallelism 24
# Deploy to specific regions
./scripts/deployment/deploy-parallel-consolidated.sh --regions westeurope,northeurope
3. Cost Calculation Scripts (12 → 1 script + library)
Consolidated into:
- Library:
scripts/lib/deployment/costs.sh - Script:
scripts/deployment/calculate-costs-consolidated.sh
Replaced scripts:
calculate-accurate-costs.shcalculate-accurate-deployment-costs.shcalculate-conservative-costs.shcalculate-contract-deployment-costs.shcalculate-gas-fees.shupdate-all-cost-estimates.shupdate-cost-estimates.shfinalize-cost-estimates.shget-accurate-gas-price.shget-conservative-gas-price.shget-mainnet-gas-prices.shget-real-gas-prices.shtest-etherscan-gas-api.sh
Features:
- Multiple gas price sources:
auto,rpc,infura,default,conservative - Multiple gas types:
deployment,configuration,total,custom - Multiple output formats:
table,json,csv - Reusable library functions for other scripts
Usage:
# Calculate total costs
./scripts/deployment/calculate-costs-consolidated.sh
# Use conservative estimate
./scripts/deployment/calculate-costs-consolidated.sh --source conservative
# JSON output
./scripts/deployment/calculate-costs-consolidated.sh --format json
# Custom gas amount
./scripts/deployment/calculate-costs-consolidated.sh --gas custom --custom-gas 500000
🔄 Migrated Scripts to Use Libraries
Completed Migrations
-
scripts/azure/check-naming-conventions.sh- ✅ Uses
lib/init.sh - ✅ Uses logging functions
- ✅ Uses Azure CLI wrappers
- ✅ Uses region code library
- ✅ Uses
-
scripts/key-management/check-keyvault-status.sh- ✅ Uses
lib/init.sh - ✅ Uses logging functions
- ✅ Uses Azure CLI wrappers
- ✅ Uses region code library
- ✅ Uses
Migration Benefits
- Reduced code: Removed ~50 lines of duplicate code per script
- Consistency: All scripts use same patterns
- Maintainability: Update once, applies everywhere
- Error handling: Standardized error messages
- Documentation: Clear library structure
📊 Impact Summary
Before
- Monitor scripts: 9 separate scripts (~900 lines total)
- Parallel deployment scripts: 11 separate scripts (~1100 lines total)
- Cost calculation scripts: 12 separate scripts (~1200 lines total)
- Total: 32 scripts (~3200 lines)
After
- Monitor script: 1 consolidated script (~400 lines)
- Parallel deployment script: 1 consolidated script (~250 lines)
- Cost library + script: 1 library (~200 lines) + 1 script (~150 lines)
- Total: 3 scripts + 1 library (~1000 lines)
Reduction
- Scripts: 32 → 4 (87.5% reduction)
- Lines of code: ~3200 → ~1000 (68.75% reduction)
- Maintainability: Significantly improved with library reuse
📚 Library Usage
All consolidated scripts use the common library structure:
#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/init.sh"
# Now available:
# - Logging: log_info, log_success, log_error, etc.
# - Azure: ensure_azure_cli, get_subscription_id, etc.
# - Regions: get_region_code, get_region_name, get_all_regions
# - Colors: color_red, color_green, etc.
# - Utils: confirm, require_command, etc.
🎯 Next Steps
- Update Makefile targets to use consolidated scripts
- Mark old scripts as deprecated (add deprecation notices)
- Migrate remaining high-priority scripts to use libraries
- Update documentation to reference new consolidated scripts
- Create migration guide for scripts that call old scripts
📝 Deprecation Notice
The following scripts are now deprecated and should be replaced with their consolidated versions:
Monitor Scripts
Replace calls to:
monitor-deployment.sh→monitor-deployment-consolidated.sh --mode statusmonitor-and-complete.sh→monitor-deployment-consolidated.sh --mode completemonitor-continuous.sh→monitor-deployment-consolidated.sh --mode continuouslive-monitor.sh→monitor-deployment-consolidated.sh --mode livedeployment-dashboard.sh→monitor-deployment-consolidated.sh --mode dashboard
Parallel Deployment Scripts
Replace calls to:
deploy-parallel.sh→deploy-parallel-consolidated.sh --resource infrastructuredeploy-besu-parallel.sh→deploy-parallel-consolidated.sh --resource besuconfigure-kubernetes-parallel.sh→deploy-parallel-consolidated.sh --resource kubernetesverify-all-clusters-parallel.sh→deploy-parallel-consolidated.sh --resource verify
Cost Calculation Scripts
Replace calls to:
calculate-accurate-costs.sh→calculate-costs-consolidated.shget-accurate-gas-price.sh→calculate-costs-consolidated.sh --format json | jq -r '.gas_price_gwei'calculate-conservative-costs.sh→calculate-costs-consolidated.sh --source conservative
✅ Success Metrics
- ✅ 87.5% reduction in script count for consolidated categories
- ✅ 68.75% reduction in lines of code
- ✅ Single source of truth for region codes
- ✅ Consistent logging and error handling
- ✅ Reusable library functions
- ✅ Clear documentation