Commit ed4d1dd1 authored by Valentin Reis's avatar Valentin Reis
Browse files

Merge branch 'refactor-config-format' into 'master'

[refactor] minor config file format simplifications.

See merge request !65
parents 5785c68f b69080e5
Pipeline #11762 passed with stages
in 1 minute and 35 seconds
......@@ -34,6 +34,7 @@ in { stages = [ "source", "build", "test", "deploy" ]
, tests/apps = mkT "app-tests"
, tests/rapl = mkT "tests-rapl" ⫽ { tags = [ "chimera" ] }
, tests/perf = mkT "tests-perf" ⫽ { tags = [ "chimera" ] }
, examples = mkT "examples"
, libnrm/autotools = mkB "libnrm/autotools"
, hsnrm/all = mkB "hsnrm/all"
, resources = mkS "resources"
......
......@@ -5,6 +5,12 @@ dhall-format:
tags:
- nix
- kvm
examples:
script: "nix-shell -p gnumake --run 'make examples'"
stage: test
tags:
- nix
- kvm
hsnrm-/dhall-format:
script: "nix-shell -p gnumake --run 'make hsnrm/dhall-format'"
stage: source
......
......@@ -31,6 +31,7 @@ pre-commit: hsnrm/pre-commit\
pynrm/pre-commit\
libnrm/pre-commit\
dhall-format\
examples\
shellcheck\
nixfmt\
resource-propagation\
......@@ -124,6 +125,10 @@ resources:
cd hsnrm; cabal v2-run hsnrm-extra/Codegen.hs ../resources
'
.PHONY: examples
examples:
@nix-shell --pure -p yq -p dhall -p haskellPackages.dhall-json --run ./tests/example-test.sh
############################# SECTION: libnrm pseudo-recursive targets (directory uses autotools)
libnrm/all: libnrm/autotools
......
......@@ -30,14 +30,13 @@ nrm --help
JSON schemas (raw) and Dhall types (documented with comments, for now)
are available.
when using JSON/YAML,
- JSON schemas: `resources/schemas/{nrmd,manifest}.json`
- default values: `resources/defauts/{nrmd,manifest}.json`
when using Dhall,
- types: `hsnrm/hsnrm/dhall/types/{nrmd,manifest}.dhall`
- default values: `hsnrm/hsnrm/dhall/defaults/{nrmd,manifest}.dhall`
when using JSON/YAML,
- default values: `resources/defauts/{nrmd,manifest}.json`
Example `nrmd` configurations and `nrm` manifests are available in the
`examples` folder in JSON,YAML and Dhall format.
......
......@@ -15,12 +15,13 @@ in default
, controlCfg =
types.ControlCfg.ControlCfg
{ minimumControlInterval.microseconds = 100000.0
, minimumWaitInterval.microseconds = 100000.0
, staticPower.microwatts = 2.0e8
, learnCfg = types.LearnCfg.Contextual { horizon = +4000 }
, speedThreshold = 1.1
, referenceMeasurementRoundInterval = +6
, hint = types.Hint.Full
}
, activeSensorFrequency.hertz = 1.0
, passiveSensorFrequency.hertz = 1.0
}
: types.Cfg
......@@ -7,6 +7,9 @@
"learnCfg": {
"horizon": 4000
},
"minimumWaitInterval": {
"microseconds": 100000
},
"minimumControlInterval": {
"microseconds": 100000
},
......
......@@ -4,6 +4,8 @@ controlCfg:
hint: Full
learnCfg:
horizon: 4000
minimumWaitInterval:
microseconds: 100000
minimumControlInterval:
microseconds: 100000
referenceMeasurementRoundInterval: 6
......
......@@ -4,8 +4,8 @@ let default = ../../hsnrm/hsnrm/dhall/defaults/nrmd.dhall
in default
⫽ { extraStaticActuators =
[ { staticActuatorKey = "example extra actuator ID"
, staticActuatorValue =
[ { actuatorID = "example extra actuator ID"
, actuator =
{ actuatorBinary = "bash"
, actuatorArguments =
[ "-c"
......
{
"extraStaticActuators": [
{
"staticActuatorKey": "example extra actuator ID",
"staticActuatorValue": {
"actuatorID": "example extra actuator ID",
"actuator": {
"actions": [
1,
2
......
extraStaticActuators:
- staticActuatorKey: "example extra actuator ID"
staticActuatorValue:
- actuatorID: "example extra actuator ID"
actuator:
actions:
- 1
- 2
......
......@@ -4,8 +4,8 @@ let default = ../../hsnrm/hsnrm/dhall/defaults/nrmd.dhall
in default
⫽ { extraStaticPassiveSensors =
[ { passiveSensorKey = "example extra static passive power sensor"
, passiveSensorValue =
[ { sensorID = "example extra static passive power sensor"
, sensor =
{ sensorBinary = "echo"
, sensorArguments = [ "30" ]
, range = { lower = 1.0, upper = 40.0 }
......
{
"extraStaticPassiveSensors": [
{
"passiveSensorKey": "example extra static passive power sensor",
"passiveSensorValue": {
"sensorID": "example extra static passive power sensor",
"sensor": {
"range": {
"lower": 1,
"upper": 40
......
extraStaticPassiveSensors:
- passiveSensorKey: "example extra static passive power sensor"
passiveSensorValue:
- sensorID: "example extra static passive power sensor"
sensor:
range:
lower: 1
upper: 40
......
......@@ -4,9 +4,9 @@ let default = ../../hsnrm/hsnrm/dhall/defaults/nrmd.dhall
in default
⫽ { extraStaticPassiveSensors =
[ { passiveSensorKey =
[ { sensorID =
"Sensor that gets package power limits for package 0 through variorum"
, passiveSensorValue =
, sensor =
{ sensorBinary = "bash"
, sensorArguments =
[ "-c"
......@@ -17,9 +17,9 @@ in default
, sensorBehavior = types.SensorBehavior.IntervalBased
}
}
, { passiveSensorKey =
, { sensorID =
"Sensor that gets package power limits for package 1 through variorum"
, passiveSensorValue =
, sensor =
{ sensorBinary = "bash"
, sensorArguments =
[ "-c"
......
{
"extraStaticPassiveSensors": [
{
"passiveSensorKey": "Sensor that gets package power limits for package 0 through variorum",
"passiveSensorValue": {
"sensorID": "Sensor that gets package power limits for package 0 through variorum",
"sensor": {
"range": {
"lower": 1,
"upper": 40
......@@ -17,8 +17,8 @@
}
},
{
"passiveSensorKey": "Sensor that gets package power limits for package 1 through variorum",
"passiveSensorValue": {
"sensorID": "Sensor that gets package power limits for package 1 through variorum",
"sensor": {
"range": {
"lower": 1,
"upper": 40
......
extraStaticPassiveSensors:
- passiveSensorKey: "Sensor that gets package power limits for package 0 through variorum"
passiveSensorValue:
- sensorID: "Sensor that gets package power limits for package 0 through variorum"
sensor:
range:
lower: 1
upper: 40
......@@ -10,8 +10,8 @@ extraStaticPassiveSensors:
sensorBehavior: IntervalBased
sensorBinary: bash
tags: []
- passiveSensorKey: "Sensor that gets package power limits for package 1 through variorum"
passiveSensorValue:
- sensorID: "Sensor that gets package power limits for package 1 through variorum"
sensor:
range:
lower: 1
upper: 40
......
......@@ -4,8 +4,8 @@ let default = ../../hsnrm/hsnrm/dhall/defaults/nrmd.dhall
in default
⫽ { extraStaticActuators =
[ { staticActuatorKey = "example extra actuator"
, staticActuatorValue =
[ { actuatorID = "example extra actuator"
, actuator =
{ actuatorBinary = "variorum-set-socket-power-limits-example"
, actuatorArguments = [] : List Text
, actions = [ 100.0, 150.0 ]
......
{
"extraStaticActuators": [
{
"staticActuatorKey": "example extra actuator",
"staticActuatorValue": {
"actuatorID": "example extra actuator",
"actuator": {
"actions": [
100,
150
......
extraStaticActuators:
- staticActuatorKey: "example extra actuator"
staticActuatorValue:
- actuatorID: "example extra actuator"
actuator:
actions:
- 100
- 150
......
......@@ -4,9 +4,9 @@ let default = ../../hsnrm/hsnrm/dhall/defaults/nrmd.dhall
in default
⫽ { extraStaticPassiveSensors =
[ { passiveSensorKey =
[ { sensorID =
"Sensor that gets package power limits for package 0 through variorum"
, passiveSensorValue =
, sensor =
{ sensorBinary = "bash"
, sensorArguments =
[ "-c"
......@@ -17,9 +17,9 @@ in default
, sensorBehavior = types.SensorBehavior.Cumulative
}
}
, { passiveSensorKey =
, { sensorID =
"Sensor that gets package power limits for package 1 through variorum"
, passiveSensorValue =
, sensor =
{ sensorBinary = "bash"
, sensorArguments =
[ "-c"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment