Skip to content

Commit

Permalink
Merge pull request #743 from Green-Software-Foundation/simplify-sci
Browse files Browse the repository at this point in the history
Simplify logic in SCI plugin
  • Loading branch information
jmcook1186 authored May 31, 2024
2 parents fcb0868 + 188e5e7 commit 49205ff
Show file tree
Hide file tree
Showing 10 changed files with 153 additions and 543 deletions.
31 changes: 29 additions & 2 deletions manifests/examples/nesting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ aggregation:
type: "both"
params:
initialize:
#outputs: ['yaml']
outputs: ['yaml']
plugins:
teads-curve:
path: "@grnsft/if-unofficial-plugins"
Expand All @@ -37,7 +37,14 @@ initialize:
method: Sci
global-config:
functional-unit: "requests"
functional-unit-time: "1 minute"
"sum-carbon":
path: "builtin"
method: Sum
global-config:
input-parameters:
- carbon-operational
- carbon-embodied
output-parameter: carbon
time-sync:
method: TimeSync
path: "builtin"
Expand All @@ -62,6 +69,7 @@ tree:
- sum
- sci-embodied
- sci-o
- sum-carbon
- time-sync
- sci
inputs:
Expand All @@ -71,24 +79,28 @@ tree:
duration: 1
cpu/utilization: 50
network/energy: 0.000001
requests: 50
- timestamp: "2023-12-12T00:00:01.000Z"
duration: 5
cpu/utilization: 20
cloud/instance-type: A1
cloud/region: uk-west
network/energy: 0.000001
requests: 60
- timestamp: "2023-12-12T00:00:06.000Z"
duration: 7
cpu/utilization: 15
cloud/instance-type: A1
cloud/region: uk-west
network/energy: 0.000001
requests: 70
- timestamp: "2023-12-12T00:00:13.000Z"
duration: 30
cloud/instance-type: A1
cloud/region: uk-west
cpu/utilization: 15
network/energy: 0.000001
requests: 55
child-1:
defaults:
cpu/thermal-design-power: 100
Expand All @@ -103,6 +115,7 @@ tree:
- sum
- sci-embodied
- sci-o
- sum-carbon
- time-sync
- sci
inputs:
Expand All @@ -112,24 +125,28 @@ tree:
duration: 1
cpu/utilization: 50
network/energy: 0.000001
requests: 10
- timestamp: "2023-12-12T00:00:01.000Z"
duration: 5
cpu/utilization: 20
cloud/instance-type: A1
cloud/region: uk-west
network/energy: 0.000001
requests: 90
- timestamp: "2023-12-12T00:00:06.000Z"
duration: 7
cpu/utilization: 15
cloud/instance-type: A1
cloud/region: uk-west
network/energy: 0.000001
requests: 30
- timestamp: "2023-12-12T00:00:13.000Z"
duration: 30
cloud/instance-type: A1
cloud/region: uk-west
cpu/utilization: 15
network/energy: 0.000001
requests: 22
child-2:
children:
child-2-0:
Expand All @@ -146,6 +163,7 @@ tree:
- sum
- sci-embodied
- sci-o
- sum-carbon
- time-sync
- sci
inputs:
Expand All @@ -155,24 +173,28 @@ tree:
duration: 1
cpu/utilization: 50
network/energy: 0.000001
requests: 50
- timestamp: "2023-12-12T00:00:01.000Z"
duration: 5
cpu/utilization: 20
cloud/instance-type: A1
cloud/region: uk-west
network/energy: 0.000001
requests: 65
- timestamp: "2023-12-12T00:00:06.000Z"
duration: 7
cpu/utilization: 15
cloud/instance-type: A1
cloud/region: uk-west
network/energy: 0.000001
requests: 80
- timestamp: "2023-12-12T00:00:13.000Z"
duration: 30
cloud/instance-type: A1
cloud/region: uk-west
cpu/utilization: 15
network/energy: 0.000001
requests: 40
child-2-1:
defaults:
cpu/thermal-design-power: 100
Expand All @@ -187,6 +209,7 @@ tree:
- sum
- sci-embodied
- sci-o
- sum-carbon
- time-sync
- sci
inputs:
Expand All @@ -196,21 +219,25 @@ tree:
duration: 1
cpu/utilization: 50
network/energy: 0.000001
requests: 50
- timestamp: "2023-12-12T00:00:01.000Z"
duration: 5
cpu/utilization: 20
cloud/instance-type: A1
cloud/region: uk-west
network/energy: 0.000001
requests: 50
- timestamp: "2023-12-12T00:00:06.000Z"
duration: 7
cpu/utilization: 15
cloud/instance-type: A1
cloud/region: uk-west
network/energy: 0.000001
requests: 60
- timestamp: "2023-12-12T00:00:13.000Z"
duration: 30
cloud/instance-type: A1
cloud/region: uk-west
cpu/utilization: 15
network/energy: 0.000001
requests: 40
14 changes: 11 additions & 3 deletions manifests/examples/pipeline-teads-sci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@ initialize:
path: "builtin"
method: Sci
global-config:
functional-unit: ""
functional-unit-time: "1-day"
functional-unit: "component"
"sum-carbon":
path: "builtin"
method: Sum
global-config:
input-parameters:
- carbon-operational
- carbon-embodied
output-parameter: carbon
"time-sync":
method: TimeSync
path: "builtin"
Expand All @@ -44,7 +51,7 @@ tree:
- sum
- sci-embodied
- sci-o
- time-sync
- sum-carbon
- sci
config:
defaults:
Expand All @@ -55,6 +62,7 @@ tree:
device/expected-lifespan: 94608000 # 3 years in seconds
resources-reserved: 1
resources-total: 8
component: 1
inputs:
- timestamp: "2023-12-12T00:00:00.000Z"
cloud/instance-type: A1
Expand Down
21 changes: 18 additions & 3 deletions manifests/examples/pipeline-with-aggregate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ initialize:
method: Sci
global-config:
functional-unit: "requests"
functional-unit-time: "1 minute"
"sum-carbon":
path: "builtin"
method: Sum
global-config:
input-parameters:
- carbon-operational
- carbon-embodied
output-parameter: carbon
"time-sync":
method: TimeSync
path: "builtin"
Expand All @@ -46,6 +53,7 @@ tree:
- sci-e
- sci-embodied
- sci-o
- sum-carbon
- time-sync
- sci
config:
Expand All @@ -61,34 +69,38 @@ tree:
device/expected-lifespan: 94608000 # 3 years in seconds
resources-reserved: 1
resources-total: 8
functional-unit-time: "1 min"
inputs:
- timestamp: "2023-12-12T00:00:00.000Z"
cloud/instance-type: A1
cloud/region: uk-west
duration: 1
cpu/utilization: 10
requests: 10
- timestamp: "2023-12-12T00:00:01.000Z"
duration: 5
cpu/utilization: 20
cloud/instance-type: A1
cloud/region: uk-west
requests: 5
- timestamp: "2023-12-12T00:00:06.000Z"
duration: 7
cpu/utilization: 15
cloud/instance-type: A1
cloud/region: uk-west
requests: 15
- timestamp: "2023-12-12T00:00:13.000Z"
duration: 30
cloud/instance-type: A1
cloud/region: uk-west
cpu/utilization: 15
requests: 30
child-2:
pipeline:
- teads-curve
- sci-e
- sci-embodied
- sci-o
- sum-carbon
- time-sync
- sci
config:
Expand All @@ -104,25 +116,28 @@ tree:
device/expected-lifespan: 94608000 # 3 years in seconds
resources-reserved: 1
resources-total: 8
functional-unit-time: "1 min"
inputs:
- timestamp: "2023-12-12T00:00:00.000Z"
duration: 1
cpu/utilization: 30
cloud/instance-type: A1
cloud/region: uk-west
requests: 100
- timestamp: "2023-12-12T00:00:01.000Z"
duration: 5
cpu/utilization: 28
cloud/instance-type: A1
cloud/region: uk-west
requests: 150
- timestamp: "2023-12-12T00:00:06.000Z"
duration: 7
cpu/utilization: 40
cloud/instance-type: A1
cloud/region: uk-west
requests: 110
- timestamp: "2023-12-12T00:00:13.000Z"
duration: 30
cpu/utilization: 33
cloud/instance-type: A1
cloud/region: uk-west
requests: 180
21 changes: 19 additions & 2 deletions manifests/examples/pipeline-with-mocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,19 @@ initialize:
"sci-o":
path: "@grnsft/if-plugins"
method: SciO
"sum-carbon":
path: "builtin"
method: Sum
global-config:
input-parameters:
- carbon-operational
- carbon-embodied
output-parameter: carbon
"sci":
path: "builtin"
method: Sci
global-config:
functional-unit: "requests"
functional-unit-time: "1 minute"
"time-sync":
method: TimeSync
path: "builtin"
Expand All @@ -56,7 +63,7 @@ initialize:
"group-by":
path: builtin
method: GroupBy
outputs: ['yaml']
# outputs: ['yaml']
tree:
children:
child-1:
Expand All @@ -65,6 +72,7 @@ tree:
- sci-e
- sci-embodied
- sci-o
- sum-carbon
- time-sync
- sci
config:
Expand All @@ -87,27 +95,32 @@ tree:
cloud/region: uk-west
duration: 1
cpu/utilization: 10
requests: 30
- timestamp: "2023-12-12T00:00:01.000Z"
duration: 5
cpu/utilization: 20
cloud/instance-type: A1
cloud/region: uk-west
requests: 40
- timestamp: "2023-12-12T00:00:06.000Z"
duration: 7
cpu/utilization: 15
cloud/instance-type: A1
cloud/region: uk-west
requests: 30
- timestamp: "2023-12-12T00:00:13.000Z"
duration: 30
cloud/instance-type: A1
cloud/region: uk-west
cpu/utilization: 15
requests: 50
child-2:
pipeline:
- teads-curve
- sci-e
- sci-embodied
- sci-o
- sum-carbon
- time-sync
- sci
config:
Expand All @@ -130,18 +143,22 @@ tree:
cpu/utilization: 30
cloud/instance-type: A1
cloud/region: uk-west
requests: 30
- timestamp: "2023-12-12T00:00:01.000Z"
duration: 5
cpu/utilization: 28
cloud/instance-type: A1
cloud/region: uk-west
requests: 40
- timestamp: "2023-12-12T00:00:06.000Z"
duration: 7
cpu/utilization: 40
cloud/instance-type: A1
cloud/region: uk-west
requests: 50
- timestamp: "2023-12-12T00:00:13.000Z"
duration: 30
cpu/utilization: 33
cloud/instance-type: A1
cloud/region: uk-west
requests: 60
Loading

0 comments on commit 49205ff

Please sign in to comment.