Architecture
EcoGuard is built as a pipeline of data collection, analysis, storage, and presentation.
System layers
- External data sources
- GitLab API for pipeline and job metadata
- Electricity Maps for live carbon intensity
- Processing layer
collect_real_data.py- agent modules in agents
- Storage and serving
- JSON metrics in dashboards/data
- Flask API in api_server.py
- Presentation layer
- static dashboard files in public
- Automation layer
- GitHub Actions and GitLab CI/CD workflows
Main data flow
- A commit, merge request, or scheduled job starts the pipeline.
- The collector fetches GitLab job data and external carbon intensity data.
- The agents convert runtime into energy and CO₂ estimates.
- The dashboard data agent writes JSON summaries.
- The backend or static site reads those JSON files.
- The dashboard displays trends, recommendations, and goals.