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

Add aggregation-method into parameter-metadata #919

Merged
merged 19 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2bf8e47
feat(package): update if-core version
manushak Jul 23, 2024
fdced82
feat(util): add `aggregationMethod` into manifest schema
manushak Jul 23, 2024
dfcd5ea
feat(builtins): add `aggregationMethod` into plugins
manushak Jul 23, 2024
90f861f
test(builtins): update test according to changes
manushak Jul 23, 2024
192f261
feat(src): add `AggregationParamsWithoutType` type and update `storeA…
manushak Jul 23, 2024
d16ba4e
feat(util): add `storeAggregationMethods` functionality
manushak Jul 23, 2024
3836eb9
test(util): add tests for `storeAggregationMethods` function
manushak Jul 23, 2024
4b20ff0
feat(src): call `storeAggregationMethods` function from impactEngine
manushak Jul 23, 2024
24d6474
fix(manifests): update manifests with time-sync and mock-observations
manushak Jul 23, 2024
6e612f0
feat(package): update if-core version
manushak Jul 24, 2024
72db420
test(builtins): fix time-sync tests error messages
manushak Jul 24, 2024
44c74ec
fix(manifests): rename 'aggregationMethod' to 'aggregation-method'
manushak Jul 24, 2024
cf7f3ba
fix(util): rename 'aggregationMethod' to 'aggregation-method'
manushak Jul 24, 2024
8dbd79d
fix(builtins): rename 'aggregationMethod' to 'aggregation-method'
manushak Jul 24, 2024
8537a3e
test(util): rename 'aggregationMethod' to 'aggregation-method'
manushak Jul 24, 2024
91d4115
Merge branch 'main' into aggregation-method
manushak Jul 26, 2024
725fcfd
feat(package): update if-core version
manushak Jul 26, 2024
14a2d1e
test(lib): fix git and ts waning on these tests
manushak Jul 26, 2024
bbb219d
docs(builtins): add `aggregation-method` to the docs
manushak Jul 26, 2024
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
75 changes: 72 additions & 3 deletions manifests/examples/pipelines/pipeline-with-mocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,36 @@ initialize:
method: MockObservations
path: "builtin"
global-config:
timestamp-from: 2023-07-06T00:00
timestamp-to: 2023-07-06T00:10
timestamp-from: 2023-12-12T00:00
timestamp-to: 2023-12-12T00:10
duration: 60
components:
- cloud/instance-type: A1
generators:
common:
cloud/region: uk-west
common-key: common-val
randint:
cpu/utilization:
min: 1
max: 99
parameter-metadata:
inputs:
timestamp:
description: refers to the time of occurrence of the input
unit: RFC3339
aggregation-method: none
duration:
description: refers to the duration of the input
unit: seconds
aggregation-method: sum
cloud/instance-type:
description: type of Cloud Instance name used in the cloud provider APIs
unit: none
aggregation-method: none
cloud/region:
description: region cloud instance
unit: none
aggregation-method: none
"interpolate":
method: Interpolation
path: "builtin"
Expand All @@ -35,12 +52,34 @@ initialize:
y: [0.12, 0.32, 0.75, 1.02]
input-parameter: "cpu/utilization"
output-parameter: "cpu-factor"
parameter-metadata:
inputs:
cpu/utilization:
description: refers to CPU utilization.
unit: percentage
aggregation-method: avg
outputs:
cpu-factor:
description: result of interpolate
unit: kWh
aggregation-method: avg
"cpu-factor-to-wattage":
method: Multiply
path: builtin
global-config:
input-parameters: ["cpu-factor", "cpu/thermal-design-power"]
output-parameter: "cpu-wattage"
parameter-metadata:
inputs:
cpu/thermal-design-power:
description: thermal design power for a processor
unit: kwh
aggregation-method: avg
outputs:
cpu-wattage:
description: the energy used by the CPU
unit: kwh
aggregation-method: sum
"wattage-times-duration":
method: Multiply
path: builtin
Expand All @@ -61,6 +100,16 @@ initialize:
numerator: vcpus-total
denominator: vcpus-allocated
output: vcpu-ratio
parameter-metadata:
inputs:
vcpus-total:
description: total number of vcpus available on a particular resource
unit: count
aggregation-method: none
vcpus-allocated:
description: number of vcpus allocated to particular resource
unit: count
aggregation-method: none
"correct-cpu-energy-for-vcpu-ratio":
method: Divide
path: "builtin"
Expand All @@ -77,6 +126,12 @@ initialize:
global-config:
input-parameters: ["cpu-energy-kwh", "grid/carbon-intensity"]
output-parameter: "carbon-operational"
parameter-metadata:
inputs:
grid/carbon-intensity:
description: Carbon intensity for the grid
unit: gCO2eq/kWh
aggregation-method: avg
"sum-carbon":
path: "builtin"
method: Sum
Expand All @@ -90,6 +145,12 @@ initialize:
method: Sci
global-config:
functional-unit: "requests"
parameter-metadata:
inputs:
requests:
description: expressed the final SCI value
unit: none
aggregation-method: sum
"time-sync":
method: TimeSync
path: "builtin"
Expand All @@ -98,13 +159,20 @@ initialize:
end-time: "2023-12-12T00:01:00.000Z"
interval: 5
allow-padding: true
parameter-metadata:
inputs:
time-reserved:
description: time reserved for a component
unit: seconds
aggregation-method: avg
"group-by":
path: builtin
method: GroupBy
tree:
children:
child-1:
pipeline:
- mock-observations
- interpolate
- cpu-factor-to-wattage
- wattage-times-duration
Expand Down Expand Up @@ -156,6 +224,7 @@ tree:
requests: 50
child-2:
pipeline:
- mock-observations
- interpolate
- cpu-factor-to-wattage
- wattage-times-duration
Expand Down
47 changes: 43 additions & 4 deletions manifests/outputs/pipelines/mock-obs-time-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,36 @@ initialize:
path: builtin
method: MockObservations
global-config:
timestamp-from: 2023-07-06T00:00
timestamp-to: 2023-07-06T00:10
timestamp-from: 2023-12-12T00:00
timestamp-to: 2023-12-12T00:10
duration: 60
components:
- cloud/instance-type: A1
generators:
common:
cloud/region: uk-west
common-key: common-val
randint:
cpu/utilization:
min: 1
max: 99
parameter-metadata:
inputs:
timestamp:
description: refers to the time of occurrence of the input
unit: RFC3339
aggregation-method: none
duration:
description: refers to the duration of the input
unit: seconds
aggregation-method: sum
cloud/instance-type:
description: type of Cloud Instance name used in the cloud provider APIs
unit: none
aggregation-method: none
cloud/region:
description: region cloud instance
unit: none
aggregation-method: none
interpolate:
path: builtin
method: Interpolation
Expand All @@ -37,6 +54,12 @@ initialize:
- 1.02
input-parameter: cpu/utilization
output-parameter: cpu-factor
parameter-metadata:
inputs:
cpu/utilization:
description: refers to CPU utilization.
unit: percentage
aggregation-method: avg
cpu-factor-to-wattage:
path: builtin
method: Multiply
Expand All @@ -45,6 +68,12 @@ initialize:
- cpu-factor
- cpu/thermal-design-power
output-parameter: cpu-wattage
parameter-metadata:
inputs:
cpu/thermal-design-power:
description: thermal design power for a processor
unit: kwh
aggregation-method: avg
wattage-times-duration:
path: builtin
method: Multiply
Expand All @@ -67,6 +96,16 @@ initialize:
numerator: vcpus-total
denominator: vcpus-allocated
output: vcpu-ratio
parameter-metadata:
inputs:
vcpus-total:
description: total number of vcpus available on a particular resource
unit: count
aggregation-method: none
vcpus-allocated:
description: number of vcpus allocated to particular resource
unit: count
aggregation-method: none
correct-cpu-energy-for-vcpu-ratio:
path: builtin
method: Divide
Expand Down Expand Up @@ -100,7 +139,6 @@ execution:
- "@commitlint/[email protected]"
- "@commitlint/[email protected]"
- "@grnsft/[email protected]"

- "@jest/[email protected]"
- "@types/[email protected]"
- "@types/[email protected]"
Expand Down Expand Up @@ -131,6 +169,7 @@ tree:
children:
child-1:
pipeline:
- mock-observations
- interpolate
- cpu-factor-to-wattage
- wattage-times-duration
Expand Down
16 changes: 9 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dependencies": {
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@grnsft/if-core": "^0.0.12",
"@grnsft/if-core": "^0.0.16",
"axios": "^1.7.2",
"csv-parse": "^5.5.6",
"csv-stringify": "^6.4.6",
Expand Down
Loading