Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use generics based teads curve #864

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 59 additions & 22 deletions manifests/bugs/aggregation-error-wrong-metric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,56 @@ 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
"operational-carbon":
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"
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
9 changes: 4 additions & 5 deletions manifests/bugs/initialize-error-no-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 9 additions & 5 deletions manifests/bugs/initialize-error-no-path.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 10 additions & 6 deletions manifests/bugs/input-error-missing-duration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 8 additions & 4 deletions manifests/bugs/pipeline-error-naming-mismatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 9 additions & 5 deletions manifests/bugs/pipeline-error-uninitialized-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
75 changes: 41 additions & 34 deletions manifests/bugs/pipeline-ordering-error.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,67 @@ 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
grid/carbon-intensity: 800
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
Expand Down
Loading