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

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

CPU Model support #57

Closed nstruharova closed 3 months ago

nstruharova commented 4 months ago

Hi, I am trying to run Eco CI on a runner with 2.3 GHz 8-Core Intel Core i9 (9880H). I looked through the source code and it seems that this model is not supported yet, and as a result, the measurement fails later on.

I had a question regarding extending the model support - if I get all the variables for the model (TDP, CPU_THREADS, etc.) and add this model number to the if statement, would the measurement work as expected? If yes, is it okay if I fork it and make a PR?

Thanks in advance!

dan-mm commented 4 months ago

Hi @nstruharova,

Yup! As long as the regex in the if statement matches what you get from (cat /proc/cpuinfo | grep "model name"), then just another clause with its values are all that are needed to support another model. And we are happy to take PR's :-)

Thinking about it though, the VHOST_RATIO (how many cpu cores the virtual machine is using vs how many are available) is configuration dependent, not cpu dependent. We based this value on what we saw on the github/gitlab public runners, but perhaps I need to add this as an optional value that can be passed in for the case of private runners.

nstruharova commented 4 months ago

Yes, I think it might be a nice idea to make the VHOST_RATIO variable, although I cannot tell how common this case is. I myself am using this for research only. Thanks for the reply, I will make the PR :)

ArneTR commented 4 months ago

Hi @nstruharova ,

one follow up question on this: Is this a self-hosted runner you are working on? Or a public runner? If it is the latter: which instance type / resource amount are you using?

nstruharova commented 4 months ago

Hi @ArneTR , this is a self-hosted runner, specifically a dockerised Ubuntu that's running on top of my macOS machine.

ArneTR commented 4 months ago

Ty for clarifying.

FYI: I already put Dan as reviewer in for your PR. Thanks for submitting!

dan-mm commented 3 months ago

Closing as it has been done :-)