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

Added success and failure cases to manifests #721

Merged
merged 5 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion manifests/bugs/azure-importer-ignoring-defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ tree:
inputs:
- timestamp: "2024-04-04T08:00:00.001Z"
duration: 3600
energy: 100
energy: 100
34 changes: 34 additions & 0 deletions manifests/bugs/mock-observations-failure-duration-is-zero.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: mock-observation-demo
description: a manifest demonstrating how to use the mock observations feature
tags:
initialize:
outputs: ['yaml']
plugins:
mock-observations:
kind: plugin
method: MockObservations
path: "@grnsft/if-plugins"
global-config:
timestamp-from: 2023-07-06T00:00
timestamp-to: 2023-07-06T00:10
duration: 0
components:
- cloud/instance-type: A1
- cloud/instance-type: B1
generators:
common:
region: uk-west
common-key: common-val
randint:
cpu/utilization:
min: 1
max: 99
memory/utilization:
min: 1
max: 99
tree:
children:
child:
pipeline:
- mock-observations
inputs:
24 changes: 24 additions & 0 deletions manifests/bugs/sci-m-missing-resources-total.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: sci-m
description: receiving incorrect error message when running sci-m without `resources-total` issue #716
tags:
initialize:
outputs: ['yaml']
plugins:
"sci-m": # a model that calculates m from te, tir, el, rr and rtor
method: SciM
verbose: false
path: "@grnsft/if-plugins"
tree:
children:
child:
pipeline:
- sci-m # duration & config -> embodied
defaults:
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
inputs:
- timestamp: 2023-07-06T00:00
duration: 3600
43 changes: 43 additions & 0 deletions manifests/features/aggregate-failure-inalid-metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Aggregation
description: Apply both `horizontal` and `vertical` aggregations
aggregation:
metrics:
- 'test'
type: 'both'
initialize:
plugins:
cloud-metadata:
method: CloudMetadata
path: "@grnsft/if-plugins"
tree:
children:
application:
pipeline:
- cloud-metadata
children:
uk-west:
children:
server-1:
inputs:
- timestamp: '2024-02-26 00:00:00'
duration: 300
cloud/instance-type: m5n.large
cloud/vendor: aws
cpu/utilization: 89
- timestamp: '2024-02-26 00:05:00'
duration: 300
cloud/instance-type: m5n.large
cloud/vendor: aws
cpu/utilization: 59
server-2:
inputs:
- timestamp: '2024-02-26 00:00:00'
duration: 300
cloud/instance-type: m5n.large
cloud/vendor: aws
cpu/utilization: 24
- timestamp: '2024-02-26 00:05:00'
duration: 300
cloud/instance-type: m5n.large
cloud/vendor: aws
cpu/utilization: 27
43 changes: 43 additions & 0 deletions manifests/features/aggregate-failure-missing-metric-in-inputs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Aggregation
description: Apply both `horizontal` and `vertical` aggregations
aggregation:
metrics:
- 'cpu/utilization'
type: 'both'
initialize:
plugins:
cloud-metadata:
method: CloudMetadata
path: "@grnsft/if-plugins"
tree:
children:
application:
pipeline:
- cloud-metadata
children:
uk-west:
children:
server-1:
inputs:
- timestamp: '2024-01-26 00:00:00'
duration: 300
cloud/instance-type: m5n.large
cloud/vendor: aws
cpu/utilization: 89
- timestamp: '2024-02-26 00:05:00'
duration: 300
cloud/instance-type: m5n.large
cloud/vendor: aws
cpu/utilization: 59
server-2:
inputs:
- timestamp: '2024-02-26 00:00:00'
duration: 300
cloud/instance-type: m5n.large
cloud/vendor: aws
# cpu/utilization: 110
- timestamp: '2024-02-26 00:15:00'
duration: 300
cloud/instance-type: m5n.large
cloud/vendor: aws
cpu/utilization: 27
51 changes: 51 additions & 0 deletions manifests/integrations/mock-obs-group-by-cloud-meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: My Manifest File
description: integration of mock observations, group by and cloud metadata
aggregation:
metrics:
- 'cpu/utilization'
type: 'both'
initialize:
# outputs: ['yaml']
plugins:
group-by:
path: 'builtin'
method: GroupBy
global-config:
input-parameters: ['cpu/energy', 'grid/carbon-intensity']
output-parameter: 'carbon'
cloud-metadata:
method: CloudMetadata
path: "@grnsft/if-plugins"
mock-observations:
path: '@grnsft/if-plugins'
method: MockObservations
global-config:
timestamp-from: 2024-03-05T00:00
timestamp-to: 2024-03-05T01:00
duration: 300
components:
- name: server-1
cloud/instance-type: Standard_E64_v3
cloud/region: eastus
- name: server-2
cloud/instance-type: Standard_E64_v3
cloud/region: france
generators:
common:
geolocation: 37.7749,-122.4194
cloud/vendor: azure
randint:
cpu/utilization:
min: 1
max: 99
tree:
pipeline:
- mock-observations
- group-by
- cloud-metadata
config:
group-by:
group:
- name
- cloud/instance-type
inputs: null
2 changes: 1 addition & 1 deletion manifests/integrations/mock-obs-groupby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ tree:
group:
- cloud/region
- name
inputs: null
inputs: null
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: cloud-metadata
description: cloud/instance-type instance type is not supported in the cloud vendor
tags:
initialize:
outputs: ['yaml']
plugins:
cloud-metadata:
method: CloudMetadata
path: "@grnsft/if-plugins"
tree:
children:
child:
pipeline:
- cloud-metadata
config:
inputs:
- timestamp: 2023-07-06T00:00 # [KEYWORD] [NO-SUBFIELDS] time when measurement occurred
cloud/vendor: aws
cloud/instance-type: m6
duration: 100
cpu/utilization: 10
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: cloud-metadata
description: failure with invalid `inputs.cloud/vendor`
tags:
initialize:
outputs: ['yaml']
#outputs: ['yaml']
plugins:
cloud-metadata:
method: CloudMetadata
Expand Down
21 changes: 21 additions & 0 deletions manifests/plugins/cloud-metadata/failure-missing-cloud-vendor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: cloud-metadata
description: failing because cloud/vendor is not provided
tags:
initialize:
outputs: ['yaml']
plugins:
cloud-metadata:
method: CloudMetadata
path: "@grnsft/if-plugins"
tree:
children:
child:
pipeline:
- cloud-metadata
config:
inputs:
- timestamp: 2023-07-06T00:00 # [KEYWORD] [NO-SUBFIELDS] time when measurement occurred
#cloud/vendor: aws
cloud/instance-type: m5n.large
duration: 100
cpu/utilization: 10
2 changes: 1 addition & 1 deletion manifests/plugins/cloud-metadata/success.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: cloud-metadata
description: successful path
tags:
initialize:
outputs: ['yaml']
# outputs: ['yaml']
plugins:
cloud-metadata:
method: CloudMetadata
Expand Down
24 changes: 24 additions & 0 deletions manifests/plugins/coefficient/failure-output-param-is-null.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: coefficient-demo
description: value of output-param is missing
tags:
initialize:
outputs: ['yaml']
plugins:
coefficient:
method: Coefficient
path: "@grnsft/if-plugins"
global-config:
input-parameter: "carbon"
coefficient: 3
output-parameter:
tree:
children:
child:
pipeline:
- coefficient
config:
sum:
inputs:
- timestamp: 2023-08-06T00:00
duration: 3600
carbon: 30
39 changes: 39 additions & 0 deletions manifests/plugins/divide/failure-denominator-equal-zero.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: divide
description: denominator is invalid, denominator is
tags:
initialize:
# outputs: ['yaml']
plugins:
cloud-metadata:
method: CloudMetadata
path: "@grnsft/if-plugins"
divide:
method: Divide
path: "@grnsft/if-plugins"
global-config:
numerator: vcpus-allocated
denominator: 0
output: cpu/number-cores
boavizta-cpu:
method: BoaviztaCpuOutput
path: "@grnsft/if-unofficial-plugins"
global-config:
allocation: LINEAR
verbose: true
tree:
children:
child:
pipeline:
- cloud-metadata
- divide
- boavizta-cpu
config:
divide:
defaults:
cloud/vendor: aws
cloud/instance-type: m5n.large
cpu/name: Intel® Core™ i7-1185G7
inputs:
- timestamp: 2023-08-06T00:00
duration: 3600
cpu/utilization: 80
39 changes: 39 additions & 0 deletions manifests/plugins/divide/failure-missing-numerator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: divide
description: success path
tags:
initialize:
# outputs: ['yaml']
plugins:
cloud-metadata:
method: CloudMetadata
path: "@grnsft/if-plugins"
divide:
method: Divide
path: "@grnsft/if-plugins"
global-config:
#numerator: vcpus-allocated
denominator: 2
output: cpu/number-cores
boavizta-cpu:
method: BoaviztaCpuOutput
path: "@grnsft/if-unofficial-plugins"
global-config:
allocation: LINEAR
verbose: true
tree:
children:
child:
pipeline:
- cloud-metadata
- divide
- boavizta-cpu
config:
divide:
defaults:
cloud/vendor: aws
cloud/instance-type: m5n.large
cpu/name: Intel® Core™ i7-1185G7
inputs:
- timestamp: 2023-08-06T00:00
duration: 3600
cpu/utilization: 80
2 changes: 1 addition & 1 deletion manifests/plugins/divide/success.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: divide
description: success path
tags:
initialize:
outputs: ['yaml']
# outputs: ['yaml']
plugins:
cloud-metadata:
method: CloudMetadata
Expand Down
Loading