Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
deploy-pypi:
name: PyPI deployment
runs-on: ubuntu-latest
if: github.event_name != 'push' || github.repository == 'GreenDIGIT-project/GreenDIRAC'
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
src/GreenDIRAC/WorkloadManagementSystem/Client/cim.conf
src/GreenDIRAC/WorkloadManagementSystem/Agent/CIM2CSAgent.py

.idea/
__pycache__/
*.egg-info/
token
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
# GreenDIRAC
DIRAC developments for the GreenDIGIT Project

GreenDIRAC is a DIRAC extension built for the GreenDIGIT Project. It enriches
DIRAC workload management with sustainability data—power usage effectiveness
(PUE) and carbon intensity (CI)—so scheduling and reporting tools can account
for the environmental cost of running jobs.

## What GreenDIRAC adds
- Registers itself as a DIRAC extension so the agents and configuration entries
are available alongside standard DIRAC deployments.
- Uses the collected metrics to prefer greener queues when dispatching jobs and
to record energy/emissions for completed workloads.

## Core agents
- **Green-aware Site Director** – augments queue information with PUE, CI and
then computes a green score that ranks queues from greenest to least green
before scheduling.
- **GreenReportingAgent** – collects finished job records, queries CIM/CI
services for sustainability data, computes energy/emissions figures, and
persists the metrics to DIRAC databases and ElasticSearch when enabled.

## Local CIM configuration
`CIMClient` reads credentials and API endpoints from:
`src/GreenDIRAC/WorkloadManagementSystem/Client/cim.conf`

Required sections and keys:
- `[CIM]`: `EMAIL`, `PASSWORD`, `API_BASE`, `METRICS_URL`
- `[KPI]`: `API_BASE`
- `[Defaults]`: `PUE`, `CI`, `ENERGY_WH`
- `[Runtime]`: `TOKEN_MAX_AGE_H`, `CACHE_TTL`, `TOKEN_TIMEOUT_S`,
`PUE_TIMEOUT_S`, `CI_TIMEOUT_S`, `SUBMIT_TIMEOUT_S`

If `cim.conf` is missing, `CIMClient` fails at startup with
`RuntimeError("CIMClient config file not found: ...")`.
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = greendirac
version = RELEASE_VERSION
version = 0.1.0
author = GreenDIRAC
author_email = atsareg@in2p3.fr
description = GreenDIRAC is a DIRAC extension for the GreenDIGIT project
Expand All @@ -15,7 +15,7 @@ license = GPLv3
package_dir =
= src
packages = find:
python_requires = >=3.11
python_requires = >=3.10
include_package_data = True
install_requires =
DIRAC ~= 8.0.75
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from setuptools import setup

setup()
setup(install_requires=['dirac'])
Loading
Loading