Why: Sub of #761
What: Add explain feature that collates metadata from all the plugins in a pipeline and reports it in a new explain block
Blocked by:
814
815
Context
In https://github.com/Green-Software-Foundation/if/issues/815 we are adding parameter metadata as a property of the initialized plugin instance that is set during the plugin initialization. The explain feature will list out the metadata for every initialized plugin in the manifest.
It should be triggered simply by passing a boolean to explain in the top level manifest context, e.g.
explainer: true
If any other value is passed to explainer the feature should not execute.
Scope of work:
[ ] Add explain feature to IF
[ ] add unit tests
Acceptance criteria
[ ] explain feature exists in IF and takes a boolean from context
GIVEN the feature exists
WHEN I run the following manifest:
name: pipeline-teads-sci
description: a full pipeline seeded with some hardcoded input data and yielding an SCI score
tags:
explain: true
initialize:
plugins:
"sum":
path: "builtin"
method: Sum
global-config:
input-parameters:
- cpu/energy
- network/energy
output-parameter: energy-sum
parameter-metadata:
inputs:
- cpu/energy
description: energy consumed by the CPU
unit: 'kWh'
- network/energy
description: energy consumed by network data ingress/egress
unit: 'kWh'
outputs:
- energy-sum
description: sum of energy components
unit: kWh
"coefficient":
path: "builtin"
method: Coefficient
global-config:
input-parameter: energy
coefficient: 2
output-parameter: energy-doubled
parameter-metadata:
inputs:
- energy
description: energy consumed by the CPU
unit: 'kWh'
- coefficient
description: coefficient applied to energy to yield energy-doubled
unit: 'dimensionless'
outputs:
- energy-doubled
description: energy multiplied by coefficient
unit: 'kWh'
tree:
children:
child-1:
pipeline:
- sum
- coefficient
defaults:
inputs:
- timestamp: "2023-12-12T00:00:00.000Z"
cloud/instance-type: A1
cloud/region: uk-west
duration: 1
cpu/utilization: 50
network/energy: 0.000001
- timestamp: "2023-12-12T00:00:01.000Z"
duration: 5
cpu/utilization: 20
cloud/instance-type: A1
cloud/region: uk-west
network/energy: 0.000001
- timestamp: "2023-12-12T00:00:06.000Z"
duration: 7
cpu/utilization: 15
cloud/instance-type: A1
cloud/region: uk-west
network/energy: 0.000001
- timestamp: "2023-12-12T00:00:13.000Z"
duration: 30
cloud/instance-type: A1
cloud/region: uk-west
cpu/utilization: 15
network/energy: 0.000001
THEN the following block would be added to the outputs, above the tree:
explain:
sum:
method: Sum
path: builtin
inputs:
- name: energy/cpu
description: energy consumed by cpu
unit: kWh
- name: energy/network
description: energy consumed by network data ingress/egress
unit: kWh
outputs:
- energy-sum
description: sum of energy components
unit: kWh
coefficient:
method: Coefficient
path: builtin
inputs:
- energy
description: energy consumed by the CPU
unit: 'kWh'
- coefficient
description: coefficient applied to energy to yield energy-doubled
unit: 'dimensionless'
outputs:
- energy-doubled
description: energy multiplied by coefficient
unit: 'kWh'
[ ] If the value of explainer is anything other than true, the feature is NOT executed
[ ] If the metadata in the plugin instance is empty, then explain simply reports it as empty, e.g.
Why: Sub of #761 What: Add
explain
feature that collatesmetadata
from all the plugins in a pipeline and reports it in a newexplain
blockBlocked by:
814
815
Context In https://github.com/Green-Software-Foundation/if/issues/815 we are adding parameter metadata as a property of the initialized plugin instance that is set during the plugin initialization. The
explain
feature will list out the metadata for every initialized plugin in the manifest.It should be triggered simply by passing a boolean to
explain
in the top level manifestcontext
, e.g.If any other value is passed to
explainer
the feature should not execute.Scope of work:
Acceptance criteria
[ ]
explain
feature exists in IF and takes a boolean fromcontext
GIVEN the feature exists WHEN I run the following manifest:
THEN the following block would be added to the outputs, above the
tree
:explainer
is anything other thantrue
, the feature is NOT executedexplain
simply reports it as empty, e.g.