green-coding-solutions / eco-ci-energy-estimation

Eco CI Energy estimation for Github Actions Runner VMs
MIT License
48 stars 10 forks source link

Adds carbondb #61

Closed ribalba closed 2 months ago

github-actions[bot] commented 3 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|5.57227|24.7645|1.7689|24| |Measurement #1|5.81|12.3823|1.7689|8| |Sleep #2|6.05625|12.3823|1.7689|9| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ```
github-actions[bot] commented 3 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|6.71885|24.7645|1.7689|27| |Measurement #1|6.18875|12.3823|1.7689|8| |Sleep #2|5.55625|12.3823|1.7689|8| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ```
github-actions[bot] commented 3 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|6.83923|24.7645|1.7689|27| |Measurement #1|5.99|12.3823|1.7689|8| |Sleep #2|5.72625|12.3823|1.7689|8| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ``` 🌳 CO2 Data: City: San Francisco, Lat: 37.783, Lon: -122.417 Carbon Intensity for this location: 208 CO2eq emitted for this job: 0.005151
github-actions[bot] commented 3 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|7.50417|24.7645|1.7689|26| |Measurement #1|5.8525|12.3823|1.7689|8| |Sleep #2|6.5625|12.3823|1.7689|8| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ``` 🌳 CO2 Data: City: Chicago, Lat: 41.8819, Lon: -87.6278 Carbon Intensity for this location: 320 CO2eq emitted for this job: 0.007924
ribalba commented 3 months ago

@ArneTR feedback incorporated

github-actions[bot] commented 3 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|7.18875|24.7645|1.7689|26| |Measurement #1|5.7275|12.3823|1.7689|9| |Sleep #2|6.13375|12.3823|1.7689|8| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ``` 🌳 CO2 Data: City: Boydton, Lat: 36.677696, Lon: -78.37471 Carbon Intensity for this location: 349 CO2eq emitted for this job: 0.008643
github-actions[bot] commented 3 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|7.48708|24.7645|1.7689|25| |Measurement #1|6.295|12.3823|1.7689|8| |Sleep #2|6.20875|12.3823|1.7689|8| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ``` 🌳 CO2 Data: City: Boydton, Lat: 36.677696, Lon: -78.37471 Carbon Intensity for this location: 348 CO2eq emitted for this job: 0.008618
github-actions[bot] commented 3 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|7.16917|24.7645|1.7689|25| |Measurement #1|6.095|12.3823|1.7689|8| |Sleep #2|6.0225|12.3823|1.7689|9| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ``` 🌳 CO2 Data: City: San Francisco, Lat: 37.783, Lon: -122.417 Carbon Intensity for this location: 99 CO2eq emitted for this job: 0.002452
ArneTR commented 2 months ago

Thanks for the clarification that the token is optional.

I am not a fan however of the multiple ways to submit input. All other info is supplied via arguments. Only the Electricitymaps Token is now an exported environment var.

What is the rationale behind this?

In any case: I would favor for supplying it as argument and also making it a secret by default. Not a classic ENV.

  1. These two values submitted in the PR info need a dimension.

Carbon Intensity for this location: 99 (g / kg / tons per Wh, J , kwH ?) CO2eq emitted for this job: 0.002452 (g, kg, ton ?)

ribalba commented 2 months ago

The problem is that when we do it with a secret/ not as env we will need to add it as a parameter to the display_results.sh and then it will be visible in the logs. Which is not ideal. Secrets are only available in the action yml file.

github-actions[bot] commented 2 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|7.28375|24.8097|1.77212|25| |Measurement #1|6.03875|12.3823|1.7689|8| |Sleep #2|5.9825|12.4274|1.77535|8| 📈 Energy graph: ```bash 1.81 ┤ ╭╮ 1.81 ┤ ││ 1.81 ┤ ││ 1.80 ┤ ││ 1.80 ┤ ││ 1.79 ┤ ││ 1.79 ┤ ││ 1.78 ┤ ││ 1.78 ┤ ││ 1.77 ┤ ││ 1.77 ┼───────────╯╰ Watts over time ``` 🌳 CO2 Data: City: Boydton, Lat: 36.677696, Lon: -78.37471 Carbon Intensity for this location: 365 gCO₂eq/kWh CO2eq emitted for this job: 0.009055 gCO₂eq
github-actions[bot] commented 2 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|7.54708|24.7645|1.7689|25| |Measurement #1|5.94875|12.3823|1.7689|8| |Sleep #2|5.9525|12.3823|1.7689|9| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ``` 🌳 CO2 Data: City: Chicago, Lat: 41.8819, Lon: -87.6278 Carbon Intensity for this location: 365 gCO₂eq/kWh CO2eq emitted for this job: 0.009039 gCO₂eq
ArneTR commented 2 months ago

TBD tomorrow

github-actions[bot] commented 2 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|7.242|24.7645|1.7689|27| |Measurement #1|5.98375|12.3823|1.7689|9| |Sleep #2|5.4625|12.3823|1.7689|9| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ``` 🌳 CO2 Data: City: Boydton, Lat: 36.677696, Lon: -78.37471 Carbon Intensity for this location: 389 gCO₂eq/kWh CO2eq emitted for this job: 0.009633 gCO₂eq
github-actions[bot] commented 2 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|6.72417|24.7645|1.7689|26| |Measurement #1|5.805|12.3823|1.7689|9| |Sleep #2|5.80125|12.3823|1.7689|9| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ``` ❌ CO2 Data: Error in getting value. Please see the detail logs for the error messages!
github-actions[bot] commented 2 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|6.99346|24.8966|1.77833|27| |Measurement #1|6.18375|12.3823|1.7689|9| |Sleep #2|6.48375|12.5143|1.78775|8| 📈 Energy graph: ```bash 1.90 ┤ ╭ 1.89 ┤ │ 1.87 ┤ │ 1.86 ┤ │ 1.85 ┤ │ 1.83 ┤ │ 1.82 ┤ │ 1.81 ┤ │ 1.80 ┤ │ 1.78 ┤ │ 1.77 ┼────────────╯ Watts over time ``` 🌳 CO2 Data: City: San Francisco, Lat: 37.783, Lon: -122.417 Carbon Intensity for this location: 89 gCO₂eq/kWh CO2eq emitted for this job: 0.002216 gCO₂eq
github-actions[bot] commented 2 months ago
Old Energy Estimation Eco-CI Output: |Label|🖥 avg. CPU utilization [%]|🔋 Total Energy [Joules]|🔌 avg. Power [Watts]|Duration [Seconds]| |---|---|---|---|---| |Total Run|7.0608|24.7645|1.7689|25| |Measurement #1|6.06375|12.3823|1.7689|8| |Sleep #2|5.79125|12.3823|1.7689|8| 📈 Energy graph: ```bash 2.00 ┼───────────── Watts over time ``` ❌ CO2 Data: Error in retrieving values. Please see the detailed logs for the exact error messages!
github-actions[bot] commented 2 months ago
Eco-CI Output: Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run 8.02074 26.7165 1.90832 28
Measurement #1 9.95 14.3342 2.04774 9
Sleep #2 5.7475 12.3823 1.7689 9

📈 Energy graph:


 3.72 ┤     ╭╮
 3.53 ┤     ││
 3.33 ┤     ││
 3.14 ┤     ││
 2.94 ┤     ││
 2.74 ┤     ││
 2.55 ┤     ││
 2.35 ┤     ││
 2.16 ┤     ││
 1.96 ┤     ││
 1.77 ┼─────╯╰──────
       Watts over time

🌳 CO2 Data: City: Phoenix, Lat: 33.448376, Lon: -112.074036 Carbon Intensity for this location: 171 gCO₂eq/kWh CO2eq emitted for this job: 0.004568 gCO₂eq

ribalba commented 2 months ago

@ArneTR ready to merge