Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix Linux: Different kill mechanism #115

Merged
merged 1 commit into from
Feb 12, 2025
Merged

Hotfix Linux: Different kill mechanism #115

merged 1 commit into from
Feb 12, 2025

Conversation

ArneTR
Copy link
Member

@ArneTR ArneTR commented Feb 12, 2025

We have seen runs having multiple kW which was due to truncation in the output of the CPU utilization stream
Screenshot 2025-02-12 at 11 30 21 AM

https://github.com/green-coding-solutions/argopy/actions/runs/13259456675

This hotfix kills the process more gracefully and thus truncation should not occur.

Greptile Summary

This PR modifies the process termination mechanism in setup.sh to address an issue where truncated CPU utilization data was causing incorrect energy measurements in the kWh range.

  • Replaces recursive kill_tree function with pkill -SIGTERM for Linux CPU monitoring termination
  • Keeps original kill_tree function for macOS process termination
  • Fixes critical bug where truncated CPU utilization output led to inflated energy measurements
  • Provides more graceful process termination to prevent data corruption during measurement collection

@ArneTR ArneTR changed the title Hotfix Linus: Different kill mechanism Hotfix Linux: Different kill mechanism Feb 12, 2025
Copy link

github-actions bot commented Feb 12, 2025

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 6.88917 32.4853 2.27 14.31
No quotes allowed in labels 11.65 7.3688 2.46 3.00
(Soo this is something) echo SHELL 7.58 9.56247 3.08 3.10
Environment setup (OS ubuntu-20.04, lint) 3.66 7.86485 2.56 3.07
No quotes allowed in labels 3.43333 7.68921 2.50 3.08

🌳 CO2 Data:
City: Washington, Lat: 38.7095, Lon: -78.1539
IP: 40.76.183.113
CO₂ from energy is: 0.014293400 g
CO₂ from manufacturing (embodied carbon) is: 0.004082841 g
Carbon Intensity for this location: 440 gCO₂eq/kWh
SCI: 0.018376 gCO₂eq / pipeline run emitted


Total cost of whole PR so far:

Copy link

github-actions bot commented Feb 12, 2025

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 6.96833 33.9793 2.43 14.00
No quotes allowed in labels 9.305 7.20817 2.58 2.79
(Soo this is something) echo SHELL 8.71 9.50589 3.07 3.10
Environment setup (OS ubuntu-24.04, lint) 4.09333 8.8817 2.90 3.06
No quotes allowed in labels 3.58667 8.38356 2.73 3.07

🌳 CO2 Data:
City: Boydton, Lat: 36.6676, Lon: -78.3875
IP: 20.57.71.205
CO₂ from energy is: 0.014950760 g
CO₂ from manufacturing (embodied carbon) is: 0.003994393 g
Carbon Intensity for this location: 440 gCO₂eq/kWh
SCI: 0.018945 gCO₂eq / pipeline run emitted


Total cost of whole PR so far:

Copy link

github-actions bot commented Feb 12, 2025

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 4.87917 31.1729 2.08 15.00
No quotes allowed in labels 8.425 6.37569 2.21 2.89
(Soo this is something) echo SHELL 4.9 9.6111 3.11 3.09
Environment setup (OS ubuntu-22.04, lint) 2.02 7.33759 2.40 3.06
No quotes allowed in labels 2.52333 7.84853 2.56 3.07

🌳 CO2 Data:
City: San Jose, Lat: 37.3388, Lon: -121.8916
IP: 52.238.27.205
CO₂ from energy is: 0.008634644 g
CO₂ from manufacturing (embodied carbon) is: 0.004279707 g
Carbon Intensity for this location: 277 gCO₂eq/kWh
SCI: 0.012914 gCO₂eq / pipeline run emitted


Total cost of whole PR so far:

Copy link

github-actions bot commented Feb 12, 2025

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 10.5 31.884 2.09 15.27
No quotes allowed in labels 23 4.90654 1.72 2.86
(Soo this is something) echo SHELL 11.5 8.97363 2.68 3.35
Environment setup (OS macos-14, lint) 6 8.96506 2.79 3.21
No quotes allowed in labels 6 9.03873 2.71 3.34

🌳 CO2 Data:
City: , Lat: , Lon:
IP:
CO₂ from energy is: 0.016037652 g
CO₂ from manufacturing (embodied carbon) is: 0.006246290 g
Carbon Intensity for this location: 503 gCO₂eq/kWh
SCI: 0.022284 gCO₂eq / pipeline run emitted


Total cost of whole PR so far:

Copy link

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 18.5 189.826 11.27 16.84
No quotes allowed in labels 40 31.6338 9.85 3.21
(Soo this is something) echo SHELL 11 50.522 14.27 3.54
Environment setup (OS macos-13, lint) 14.5 54.2763 15.92 3.41
No quotes allowed in labels 19.5 53.3935 15.48 3.45

🌳 CO2 Data:
City: San Antonio, Lat: 29.4227, Lon: -98.4927
IP: 13.105.117.9
CO₂ from energy is: 0.095482478 g
CO₂ from manufacturing (embodied carbon) is: 0.036044521 g
Carbon Intensity for this location: 503 gCO₂eq/kWh
SCI: 0.131527 gCO₂eq / pipeline run emitted


Total cost of whole PR so far:

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@ArneTR ArneTR merged commit 2601fdb into main Feb 12, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant