|
| 1 | +## Docker version of PowerAPI |
| 2 | + |
| 3 | +Lightweight docker images of PowerAPI packaged as docker images. |
| 4 | + |
| 5 | +You have first to create a [data volume](https://docs.docker.com/engine/userguide/containers/dockervolumes/#creating-and-mounting-a-data-volume-container) to store the configuration files (`conf` directory) for PowerAPI. |
| 6 | +It will include all parameters needed to PowerAPI for configuring its internal components. |
| 7 | +The different parameters to set up are described inside the [Wiki](https://github.com/Spirals-Team/powerapi/wiki). |
| 8 | + |
| 9 | +We assume that two data volumes `powerapi-cli-conf` and `powerapi-sampling-conf` are created on the host system. |
| 10 | + |
| 11 | +### PowerAPI: CLI |
| 12 | + |
| 13 | +This image is used to run automatically a various choices of software-defined power meters. |
| 14 | + |
| 15 | +#### Usage |
| 16 | + |
| 17 | +Show the help text: |
| 18 | + |
| 19 | +``` |
| 20 | +docker run --rm --privileged --net=host --pid=host \ |
| 21 | +--volumes-from powerapi-cli-conf \ |
| 22 | +spirals/powerapi-cli |
| 23 | +``` |
| 24 | + |
| 25 | +The `--privileged` option is used to get the root access to the host machine, |
| 26 | +the `--net=host` option is mandatory to be able to use the PowerSPY bluetooth power meter inside a container, |
| 27 | +and the `--pid=host` is required to be able to get an access to the running apps of the host machine. |
| 28 | + |
| 29 | +A classic example with the `ProcFS` module can be: |
| 30 | + |
| 31 | +powerapi.conf: |
| 32 | + |
| 33 | +``` |
| 34 | +powerapi.cpu.tdp = 35 |
| 35 | +``` |
| 36 | + |
| 37 | +Associated docker command: |
| 38 | + |
| 39 | +``` |
| 40 | +docker run --rm --privileged --net=host --pid=host \ |
| 41 | +--volumes-from powerapi-cli-conf \ |
| 42 | +spirals/powerapi-cli \ |
| 43 | +modules procfs-cpu-simple monitor --frequency 1000 --all --console |
| 44 | +``` |
| 45 | + |
| 46 | +### PowerAPI: Sampling |
| 47 | + |
| 48 | +This image is used to build a CPU power model. |
| 49 | + |
| 50 | +#### Usage |
| 51 | + |
| 52 | +Launch the sampling: |
| 53 | + |
| 54 | +``` |
| 55 | +docker run --rm --privileged --net=host --pid=host \ |
| 56 | +--volumes-from powerapi-sampling-conf \ |
| 57 | +spirals/powerapi-sampling |
| 58 | +``` |
| 59 | + |
| 60 | +Example of a sampling configuration file: |
| 61 | + |
| 62 | +sampling.conf: |
| 63 | + |
| 64 | +``` |
| 65 | +powerspy.mac = "00:0B:CE:07:1E:9B" |
| 66 | +
|
| 67 | +powerapi.cpu.topology = [ |
| 68 | + { core = 0, indexes = [0, 4] } |
| 69 | + { core = 1, indexes = [1, 5] } |
| 70 | + { core = 2, indexes = [2, 6] } |
| 71 | + { core = 3, indexes = [3, 7] } |
| 72 | +] |
| 73 | +
|
| 74 | +powerapi.sampling.dvfs = true |
| 75 | +powerapi.sampling.turbo = true |
| 76 | +
|
| 77 | +powerapi.cycles-polynom-regression.cpu-base-frequency = 0.133 |
| 78 | +powerapi.cycles-polynom-regression.cpu-max-frequency = 2.66 |
| 79 | +powerapi.cycles-polynom-regression.unhalted-cycles-event = "CPU_CLK_UNHALTED:THREAD_P" |
| 80 | +powerapi.cycles-polynom-regression.ref-cycles-event = "CPU_CLK_UNHALTED:REF_P" |
| 81 | +
|
| 82 | +interval = 1s |
| 83 | +powerapi.actors.timeout = 15s |
| 84 | +powerapi.sampling.interval = ${interval} |
| 85 | +powerspy.interval = ${interval} |
| 86 | +powerapi.sampling.steps = [100, 25] |
| 87 | +powerapi.sampling.step-duration = 10 |
| 88 | +``` |
0 commit comments