diff --git a/manifests/bugs/aggregation-error-wrong-metric.yml b/manifests/bugs/aggregation-error-wrong-metric.yml index 536508b59..60a8dd8dd 100644 --- a/manifests/bugs/aggregation-error-wrong-metric.yml +++ b/manifests/bugs/aggregation-error-wrong-metric.yml @@ -7,19 +7,48 @@ aggregation: type: "both" initialize: plugins: - "teads-curve": - path: "@grnsft/if-unofficial-plugins" - method: TeadsCurve + "interpolate": + method: Interpolation + path: 'builtin' global-config: - interpolation: spline - "sum-energy-components": + method: linear + x: [0, 10, 50, 100] + y: [0.12, 0.32, 0.75, 1.02] + input-parameter: 'cpu/utilization' + output-parameter: 'cpu-factor' + "cpu-factor-to-wattage": + method: Multiply + path: builtin + global-config: + input-parameters: ["cpu-factor", "cpu/thermal-design-power"] + output-parameter: "cpu-wattage" + "wattage-times-duration": + method: Multiply + path: builtin + global-config: + input-parameters: ["cpu-wattage", "duration"] + output-parameter: "cpu-wattage-times-duration" + "wattage-to-energy-kwh": + method: Divide path: "builtin" - method: Sum global-config: - input-parameters: - - cpu/energy - - network/energy - output-parameter: energy + numerator: cpu-wattage-times-duration + denominator: 3600000 + output: cpu-energy-raw + "calculate-vcpu-ratio": + method: Divide + path: "builtin" + global-config: + numerator: vcpus-total + denominator: vcpus-allocated + output: vcpu-ratio + "correct-cpu-energy-for-vcpu-ratio": + method: Divide + path: "builtin" + global-config: + numerator: cpu-energy-raw + denominator: vcpu-ratio + output: cpu-energy-kwh "sci-embodied": path: "builtin" method: SciEmbodied @@ -27,7 +56,7 @@ initialize: method: Multiply path: builtin global-config: - input-parameters: ["energy", "grid/carbon-intensity"] + input-parameters: ["cpu-energy-kwh", "grid/carbon-intensity"] output-parameter: "carbon-operational" "sci": path: "builtin" @@ -49,12 +78,16 @@ tree: children: child-1: pipeline: - - teads-curve - - sum-energy-components + - interpolate + - cpu-factor-to-wattage + - wattage-times-duration + - wattage-to-energy-kwh + - calculate-vcpu-ratio + - correct-cpu-energy-for-vcpu-ratio - sci-embodied - operational-carbon - time-sync - - sci + # - sci config: group-by: group: @@ -66,8 +99,8 @@ tree: device/emissions-embodied: 1533.120 # gCO2eq time-reserved: 3600 # 1hr in seconds device/expected-lifespan: 94608000 # 3 years in seconds - resources-reserved: 1 - resources-total: 8 + vcpus-allocated: 1 + vcpus-total: 8 inputs: - timestamp: "2023-12-12T00:00:00.000Z" cloud/instance-type: A1 @@ -91,12 +124,16 @@ tree: cpu/utilization: 15 child-2: pipeline: - - teads-curve - - sci-e + - interpolate + - cpu-factor-to-wattage + - wattage-times-duration + - wattage-to-energy-kwh + - calculate-vcpu-ratio + - correct-cpu-energy-for-vcpu-ratio - sci-embodied - - sci-o + - operational-carbon - time-sync - - sci + # - sci config: group-by: group: @@ -108,8 +145,8 @@ tree: device/emissions-embodied: 1533.120 # gCO2eq time-reserved: 3600 # 1hr in seconds device/expected-lifespan: 94608000 # 3 years in seconds - resources-reserved: 1 - resources-total: 8 + vcpus-allocated: 1 + vcpus-total: 8 inputs: - timestamp: "2023-12-12T00:00:00.000Z" duration: 1 diff --git a/manifests/bugs/initialize-error-no-config.yml b/manifests/bugs/initialize-error-no-config.yml index 67973b53f..466c7f5f9 100644 --- a/manifests/bugs/initialize-error-no-config.yml +++ b/manifests/bugs/initialize-error-no-config.yml @@ -3,18 +3,17 @@ description: a negative test case that fails due to plugin initialization missin tags: initialize: plugins: - teads-curve: - path: '@grnsft/if-unofficial-plugins' - method: TeadsCurve + "interpolate": + method: Interpolation + path: 'builtin' global-config: - outputs: ['yaml'] tree: children: child-0: defaults: cpu/thermal-design-power: 100 pipeline: - - teads-curve + - interpolate inputs: - timestamp: 2023-07-06T00:00 duration: 1 diff --git a/manifests/bugs/initialize-error-no-path.yml b/manifests/bugs/initialize-error-no-path.yml index 21210c544..279f304e6 100644 --- a/manifests/bugs/initialize-error-no-path.yml +++ b/manifests/bugs/initialize-error-no-path.yml @@ -3,19 +3,23 @@ description: a negative test case that fails because the path is mising in a plu tags: initialize: plugins: - teads-curve: + "interpolate": + method: Interpolation path: - method: TeadsCurve global-config: - interpolation: spline - outputs: ['yaml'] + method: linear + x: [0, 10, 50, 100] + y: [0.12, 0.32, 0.75, 1.02] + input-parameter: 'cpu/utilization' + output-parameter: 'cpu-factor' + # outputs: ['yaml'] tree: children: child-0: defaults: cpu/thermal-design-power: 100 pipeline: - - teads-curve + - interpolate inputs: - timestamp: 2023-07-06T00:00 duration: 1 diff --git a/manifests/bugs/input-error-missing-duration.yml b/manifests/bugs/input-error-missing-duration.yml index 1a4a5d9ef..a2e7f3ca4 100644 --- a/manifests/bugs/input-error-missing-duration.yml +++ b/manifests/bugs/input-error-missing-duration.yml @@ -3,19 +3,23 @@ description: a negative test case that fails due to the required `duration` fiel tags: initialize: plugins: - teads-curve: - path: '@grnsft/if-unofficial-plugins' - method: TeadsCurve + "interpolate": + method: Interpolation + path: builtin global-config: - interpolation: spline - outputs: ['yaml'] + method: linear + x: [0, 10, 50, 100] + y: [0.12, 0.32, 0.75, 1.02] + input-parameter: 'cpu/utilization' + output-parameter: 'cpu-factor' + # outputs: ['yaml'] tree: children: child-0: defaults: cpu/thermal-design-power: 100 pipeline: - - teads-curve + - interpolate inputs: - timestamp: 2023-07-06T00:00 cpu/utilization: 20 diff --git a/manifests/bugs/pipeline-error-naming-mismatch.yml b/manifests/bugs/pipeline-error-naming-mismatch.yml index 22bb804a4..982e89088 100644 --- a/manifests/bugs/pipeline-error-naming-mismatch.yml +++ b/manifests/bugs/pipeline-error-naming-mismatch.yml @@ -3,11 +3,15 @@ description: a negative test case that fails due to the plugin name in the pipel tags: initialize: plugins: - teads-curve: - path: '@grnsft/if-unofficial-plugins' - method: TeadsCurve + "interpolate": + method: Interpolation + path: builtin global-config: - interpolation: spline + method: linear + x: [0, 10, 50, 100] + y: [0.12, 0.32, 0.75, 1.02] + input-parameter: 'cpu/utilization' + output-parameter: 'cpu-factor' outputs: ['yaml'] tree: children: diff --git a/manifests/bugs/pipeline-error-uninitialized-plugin.yml b/manifests/bugs/pipeline-error-uninitialized-plugin.yml index 95afc196b..7bead556b 100644 --- a/manifests/bugs/pipeline-error-uninitialized-plugin.yml +++ b/manifests/bugs/pipeline-error-uninitialized-plugin.yml @@ -4,18 +4,22 @@ tags: initialize: # outputs: ['yaml'] plugins: - teads-curve: - path: '@grnsft/if-unofficial-plugins' - method: TeadsCurve + "interpolate": + method: Interpolation + path: builtin global-config: - interpolation: spline + method: linear + x: [0, 10, 50, 100] + y: [0.12, 0.32, 0.75, 1.02] + input-parameter: 'cpu/utilization' + output-parameter: 'cpu-factor' tree: children: child-0: defaults: cpu/thermal-design-power: 100 pipeline: - - teads-curve + - interpolate - multiply inputs: - timestamp: 2023-07-06T00:00 diff --git a/manifests/bugs/pipeline-ordering-error.yml b/manifests/bugs/pipeline-ordering-error.yml index a561ea24d..7fa8836c1 100644 --- a/manifests/bugs/pipeline-ordering-error.yml +++ b/manifests/bugs/pipeline-ordering-error.yml @@ -3,51 +3,58 @@ description: a negative test case that fails because sci-o is invoked too early tags: initialize: plugins: - "teads-curve": - path: "@grnsft/if-unofficial-plugins" - method: TeadsCurve + "interpolate": + method: Interpolation + path: 'builtin' global-config: - interpolation: spline - "sum": - path: "builtin" - method: Sum + method: linear + x: [0, 10, 50, 100] + y: [0.12, 0.32, 0.75, 1.02] + input-parameter: 'cpu/utilization' + output-parameter: 'cpu-factor' + "cpu-factor-to-wattage": + method: Multiply + path: builtin global-config: - input-parameters: - - cpu/energy - - network/energy - output-parameter: energy - "sci-embodied": - path: "builtin" - method: SciEmbodied - "operational-carbon": + input-parameters: ["cpu-factor", "cpu/thermal-design-power"] + output-parameter: "cpu-wattage" + "wattage-times-duration": method: Multiply path: builtin global-config: - input-parameters: ["cpu/energy", "grid/carbon-intensity"] - output-parameter: "carbon-operational" - "sci": + input-parameters: ["cpu-wattage", "duration"] + output-parameter: "cpu-wattage-times-duration" + "wattage-to-energy-kwh": + method: Divide + path: "builtin" + global-config: + numerator: cpu-wattage-times-duration + denominator: 3600000 + output: cpu-energy-raw + "calculate-vcpu-ratio": + method: Divide path: "builtin" - method: Sci global-config: - functional-unit: "" - "time-sync": - method: TimeSync + numerator: vcpus-total + denominator: vcpus-allocated + output: vcpu-ratio + "correct-cpu-energy-for-vcpu-ratio": + method: Divide path: "builtin" global-config: - start-time: "2023-12-12T00:00:00.000Z" - end-time: "2023-12-12T00:01:00.000Z" - interval: 5 - allow-padding: true + numerator: cpu-energy-raw + denominator: vcpu-ratio + output: cpu-energy-kwh tree: children: child-1: pipeline: - - teads-curve - - operational-carbon - - sum - - sci-embodied - - time-sync - - sci + - interpolate + - correct-cpu-energy-for-vcpu-ratio + - calculate-vcpu-ratio + - cpu-factor-to-wattage + - wattage-times-duration + - wattage-to-energy-kwh config: defaults: cpu/thermal-design-power: 100 @@ -55,8 +62,8 @@ tree: device/emissions-embodied: 1533.120 # gCO2eq time-reserved: 3600 # 1hr in seconds device/expected-lifespan: 94608000 # 3 years in seconds - resources-reserved: 1 - resources-total: 8 + vcpus-allocated: 1 + vcpus-total: 8 inputs: - timestamp: "2023-12-12T00:00:00.000Z" cloud/instance-type: A1 diff --git a/manifests/examples/generics.yml b/manifests/examples/generics.yml index b3de5e007..c319967f0 100644 --- a/manifests/examples/generics.yml +++ b/manifests/examples/generics.yml @@ -3,24 +3,53 @@ description: a pipeline that does arbitrary calculations using our generic arith tags: initialize: plugins: - teads-curve: - path: "@grnsft/if-unofficial-plugins" - method: TeadsCurve + "interpolate": + method: Interpolation + path: 'builtin' global-config: - interpolation: spline - "sum": + method: linear + x: [0, 10, 50, 100] + y: [0.12, 0.32, 0.75, 1.02] + input-parameter: 'cpu/utilization' + output-parameter: 'cpu-factor' + "cpu-factor-to-wattage": + method: Multiply + path: builtin + global-config: + input-parameters: ["cpu-factor", "cpu/thermal-design-power"] + output-parameter: "cpu-wattage" + "wattage-times-duration": + method: Multiply + path: builtin + global-config: + input-parameters: ["cpu-wattage", "duration"] + output-parameter: "cpu-wattage-times-duration" + "wattage-to-energy-kwh": + method: Divide + path: "builtin" + global-config: + numerator: cpu-wattage-times-duration + denominator: 3600000 + output: cpu-energy-raw + "calculate-vcpu-ratio": + method: Divide + path: "builtin" + global-config: + numerator: vcpus-total + denominator: vcpus-allocated + output: vcpu-ratio + "correct-cpu-energy-for-vcpu-ratio": + method: Divide path: "builtin" - method: Sum global-config: - input-parameters: - - cpu/energy - - network/energy - output-parameter: energy-sum + numerator: cpu-energy-raw + denominator: vcpu-ratio + output: cpu-energy-kwh "coefficient": path: "builtin" method: Coefficient global-config: - input-parameter: energy + input-parameter: cpu-energy-kwh coefficient: 2 output-parameter: energy-doubled "multiply": @@ -33,12 +62,19 @@ tree: children: child-1: pipeline: - - sum + - interpolate + - cpu-factor-to-wattage + - wattage-times-duration + - wattage-to-energy-kwh + - calculate-vcpu-ratio + - correct-cpu-energy-for-vcpu-ratio - coefficient - multiply config: defaults: cpu/thermal-design-power: 100 + vcpus-allocated: 1 + vcpus-total: 8 inputs: - timestamp: "2023-12-12T00:00:00.000Z" cloud/instance-type: A1 diff --git a/manifests/examples/nesting.yml b/manifests/examples/nesting.yml index a5bf89230..b274ae7f0 100644 --- a/manifests/examples/nesting.yml +++ b/manifests/examples/nesting.yml @@ -7,25 +7,53 @@ tags: aggregation: metrics: - "carbon" - - "energy" type: "both" params: initialize: - outputs: ['yaml'] + # outputs: ['yaml'] plugins: - teads-curve: - path: "@grnsft/if-unofficial-plugins" - method: TeadsCurve + "interpolate": + method: Interpolation + path: 'builtin' global-config: - interpolation: spline - sum: + method: linear + x: [0, 10, 50, 100] + y: [0.12, 0.32, 0.75, 1.02] + input-parameter: 'cpu/utilization' + output-parameter: 'cpu-factor' + "cpu-factor-to-wattage": + method: Multiply + path: builtin + global-config: + input-parameters: ["cpu-factor", "cpu/thermal-design-power"] + output-parameter: "cpu-wattage" + "wattage-times-duration": + method: Multiply + path: builtin + global-config: + input-parameters: ["cpu-wattage", "duration"] + output-parameter: "cpu-wattage-times-duration" + "wattage-to-energy-kwh": + method: Divide path: "builtin" - method: Sum global-config: - input-parameters: - - cpu/energy - - network/energy - output-parameter: energy + numerator: cpu-wattage-times-duration + denominator: 3600000 + output: cpu-energy-raw + "calculate-vcpu-ratio": + method: Divide + path: "builtin" + global-config: + numerator: vcpus-total + denominator: vcpus-allocated + output: vcpu-ratio + "correct-cpu-energy-for-vcpu-ratio": + method: Divide + path: "builtin" + global-config: + numerator: cpu-energy-raw + denominator: vcpu-ratio + output: cpu-energy-kwh sci-embodied: path: "builtin" method: SciEmbodied @@ -33,7 +61,7 @@ initialize: method: Multiply path: builtin global-config: - input-parameters: ["energy", "grid/carbon-intensity"] + input-parameters: ["cpu-energy-kwh", "grid/carbon-intensity"] output-parameter: "carbon-operational" sci: path: "builtin" @@ -65,16 +93,20 @@ tree: device/emissions-embodied: 1533.120 # gCO2eq time-reserved: 3600 # 1hr in seconds device/expected-lifespan: 94608000 # 3 years in seconds - resources-reserved: 1 - resources-total: 8 + vcpus-allocated: 1 + vcpus-total: 8 pipeline: - - teads-curve - - sum + - interpolate + - cpu-factor-to-wattage + - wattage-times-duration + - wattage-to-energy-kwh + - calculate-vcpu-ratio + - correct-cpu-energy-for-vcpu-ratio - sci-embodied - operational-carbon - sum-carbon - time-sync - - sci + # - sci inputs: - timestamp: "2023-12-12T00:00:00.000Z" cloud/instance-type: A1 @@ -111,16 +143,20 @@ tree: device/emissions-embodied: 1533.120 # gCO2eq time-reserved: 3600 # 1hr in seconds device/expected-lifespan: 94608000 # 3 years in seconds - resources-reserved: 1 - resources-total: 8 + vcpus-allocated: 1 + vcpus-total: 8 pipeline: - - teads-curve - - sum + - interpolate + - cpu-factor-to-wattage + - wattage-times-duration + - wattage-to-energy-kwh + - calculate-vcpu-ratio + - correct-cpu-energy-for-vcpu-ratio - sci-embodied - - sci-o + - operational-carbon - sum-carbon - time-sync - - sci + # - sci inputs: - timestamp: "2023-12-12T00:00:00.000Z" cloud/instance-type: A1 @@ -159,16 +195,20 @@ tree: device/emissions-embodied: 1533.120 # gCO2eq time-reserved: 3600 # 1hr in seconds device/expected-lifespan: 94608000 # 3 years in seconds - resources-reserved: 1 - resources-total: 8 + vcpus-allocated: 1 + vcpus-total: 8 pipeline: - - teads-curve - - sum + - interpolate + - cpu-factor-to-wattage + - wattage-times-duration + - wattage-to-energy-kwh + - calculate-vcpu-ratio + - correct-cpu-energy-for-vcpu-ratio - sci-embodied - - sci-o + - operational-carbon - sum-carbon - time-sync - - sci + # - sci inputs: - timestamp: "2023-12-12T00:00:00.000Z" cloud/instance-type: A1 @@ -205,16 +245,20 @@ tree: device/emissions-embodied: 1533.120 # gCO2eq time-reserved: 3600 # 1hr in seconds device/expected-lifespan: 94608000 # 3 years in seconds - resources-reserved: 1 - resources-total: 8 + vcpus-allocated: 1 + vcpus-total: 8 pipeline: - - teads-curve - - sum + - interpolate + - cpu-factor-to-wattage + - wattage-times-duration + - wattage-to-energy-kwh + - calculate-vcpu-ratio + - correct-cpu-energy-for-vcpu-ratio - sci-embodied - - sci-o + - operational-carbon - sum-carbon - time-sync - - sci + # - sci inputs: - timestamp: "2023-12-12T00:00:00.000Z" cloud/instance-type: A1 diff --git a/manifests/examples/pipeline-teads-sci.yml b/manifests/examples/pipeline-teads-sci.yml index bf20cc251..c07b093bd 100644 --- a/manifests/examples/pipeline-teads-sci.yml +++ b/manifests/examples/pipeline-teads-sci.yml @@ -3,19 +3,48 @@ description: a full pipeline seeded with some hardcoded input data and yielding tags: initialize: plugins: - "teads-curve": - path: "@grnsft/if-unofficial-plugins" - method: TeadsCurve + "interpolate": + method: Interpolation + path: 'builtin' global-config: - interpolation: spline - "sum": + method: linear + x: [0, 10, 50, 100] + y: [0.12, 0.32, 0.75, 1.02] + input-parameter: 'cpu/utilization' + output-parameter: 'cpu-factor' + "cpu-factor-to-wattage": + method: Multiply + path: builtin + global-config: + input-parameters: ["cpu-factor", "cpu/thermal-design-power"] + output-parameter: "cpu-wattage" + "wattage-times-duration": + method: Multiply + path: builtin + global-config: + input-parameters: ["cpu-wattage", "duration"] + output-parameter: "cpu-wattage-times-duration" + "wattage-to-energy-kwh": + method: Divide path: "builtin" - method: Sum global-config: - input-parameters: - - cpu/energy - - network/energy - output-parameter: energy + numerator: cpu-wattage-times-duration + denominator: 3600000 + output: cpu-energy-raw + "calculate-vcpu-ratio": + method: Divide + path: "builtin" + global-config: + numerator: vcpus-total + denominator: vcpus-allocated + output: vcpu-ratio + "correct-cpu-energy-for-vcpu-ratio": + method: Divide + path: "builtin" + global-config: + numerator: cpu-energy-raw + denominator: vcpu-ratio + output: cpu-energy-kwh "sci-embodied": path: "builtin" method: SciEmbodied @@ -23,7 +52,7 @@ initialize: method: Multiply path: builtin global-config: - input-parameters: ["cpu/energy", "grid/carbon-intensity"] + input-parameters: ["cpu-energy-kwh", "grid/carbon-intensity"] output-parameter: "carbon-operational" "sci": path: "builtin" @@ -50,8 +79,12 @@ tree: children: child-1: pipeline: - - teads-curve - - sum + - interpolate + - cpu-factor-to-wattage + - wattage-times-duration + - wattage-to-energy-kwh + - calculate-vcpu-ratio + - correct-cpu-energy-for-vcpu-ratio - sci-embodied - operational-carbon - sum-carbon @@ -63,8 +96,8 @@ tree: device/emissions-embodied: 1533.120 # gCO2eq time-reserved: 3600 # 1hr in seconds device/expected-lifespan: 94608000 # 3 years in seconds - resources-reserved: 1 - resources-total: 8 + vcpus-total: 8 + vcpus-allocated: 1 component: 1 inputs: - timestamp: "2023-12-12T00:00:00.000Z" diff --git a/manifests/integrations/mock-obs-time-sync.yml b/manifests/integrations/mock-obs-time-sync.yml index 727caf363..f1f176eb3 100644 --- a/manifests/integrations/mock-obs-time-sync.yml +++ b/manifests/integrations/mock-obs-time-sync.yml @@ -21,11 +21,48 @@ initialize: cpu/utilization: min: 1 max: 99 - "teads-curve": - path: "@grnsft/if-unofficial-plugins" - method: TeadsCurve + "interpolate": + method: Interpolation + path: 'builtin' global-config: - interpolation: spline + method: linear + x: [0, 10, 50, 100] + y: [0.12, 0.32, 0.75, 1.02] + input-parameter: 'cpu/utilization' + output-parameter: 'cpu-factor' + "cpu-factor-to-wattage": + method: Multiply + path: builtin + global-config: + input-parameters: ["cpu-factor", "cpu/thermal-design-power"] + output-parameter: "cpu-wattage" + "wattage-times-duration": + method: Multiply + path: builtin + global-config: + input-parameters: ["cpu-wattage", "duration"] + output-parameter: "cpu-wattage-times-duration" + "wattage-to-energy-kwh": + method: Divide + path: "builtin" + global-config: + numerator: cpu-wattage-times-duration + denominator: 3600000 + output: cpu-energy-raw + "calculate-vcpu-ratio": + method: Divide + path: "builtin" + global-config: + numerator: vcpus-total + denominator: vcpus-allocated + output: vcpu-ratio + "correct-cpu-energy-for-vcpu-ratio": + method: Divide + path: "builtin" + global-config: + numerator: cpu-energy-raw + denominator: vcpu-ratio + output: cpu-energy-kwh "time-sync": method: TimeSync path: "builtin" @@ -38,10 +75,18 @@ tree: children: child-1: pipeline: - - teads-curve + # - mock-observations + - interpolate + - cpu-factor-to-wattage + - wattage-times-duration + - wattage-to-energy-kwh + - calculate-vcpu-ratio + - correct-cpu-energy-for-vcpu-ratio - time-sync defaults: cpu/thermal-design-power: 100 + vcpus-total: 8 + vcpus-allocated: 1 inputs: - timestamp: "2023-12-12T00:00:00.000Z" cloud/instance-type: A1