Rapl node capping daemon (#21)

* Initial work on rapl-daemon. Initial server set up. API to read max power per zone and API to write new power cap have both been written.

* Removing python script since this has been ported to go code now.

* Adding test for happy path retrieving max power.

* Change some data types around to avoid too much conversion.

* Add happy path test for cap zone

* Removing uncessary print statement.

* Change cap node to use a temporary setup.

* Renaming arguments to be more descriptive.

* Changing todo message.

* Changing test structure to only set up mock subsystem once and allowing functions to test on it later.

* Adding some more coverage for unhappy paths and fixing some values to reflect they are no longer floats.

* Keeping the old script around as it should be removed in a different PR.

* Delegating percentage check to capNode function.

* Fixing typo.

* Fixing typos.

* Changing shortWindow to longWindow as constraint_0 actually points to the long window.

* Renaming variable in test.

* capping funciton now returns which zones were sucessfully capped and which zones could not be capped. This information is now returned to the caller of the HTTP api.
This commit is contained in:
Renan I. Del Valle 2020-01-19 11:52:30 -08:00 committed by PRADYUMNA KAUSHIK
parent 3543960689
commit e76c1ae972
5 changed files with 311 additions and 0 deletions

39
rapl-daemon/README.md Normal file
View file

@ -0,0 +1,39 @@
# RAPL Daemon
This runs a server that is capable of changing the percentage at which
a node is being throttled to using RAPL. This daemon should be installed
on all worker nodes.
### Sample payload for testing:
```
curl --header "Content-Type: application/json" \
--request POST \
--data '{"percentage":75}' \
http://localhost:9090/powercap
```
### Payload
```json
{
"percentage":75
}
```
### Response
The daemon will respond with a json payload containing zones that were
successfully capped as well as the zones that were not capped.
```json
{
"cappedZones": null,
"failedZones": [
"intel-rapl:0",
"intel-rapl:1"
],
"error": "some zones were not able to be powercapped"
}
```
Field error will not exist if failed zones is empty.