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 explain that collates metadata from plugins in a pipeline #818

Closed
5 tasks done
Tracked by #761
zanete opened this issue Jun 11, 2024 · 3 comments
Closed
5 tasks done
Tracked by #761

Add explain that collates metadata from plugins in a pipeline #818

zanete opened this issue Jun 11, 2024 · 3 comments
Assignees
Labels
core-only This issue is reserved for the IF core team only

Comments

@zanete
Copy link

zanete commented Jun 11, 2024

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:

Context
In #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.

explain: true

If any other value is passed to explain 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.
explain:
  example:
    method: SomeMethod
    path: '@grnsft/dummy-plugins'
    inputs:
    outputs:
@zanete zanete added this to the Inputs and Outputs milestone Jun 11, 2024
@zanete zanete moved this to In Design in IF Jun 11, 2024
@zanete zanete added draft The issue is still being written, no need to respond or action on anything. core-only This issue is reserved for the IF core team only labels Jun 11, 2024
@zanete zanete changed the title Add explainer feature that collates metadata from all the plugins in a pipeline and either enriches the initialize info or adds a new block. Add explainer that collates metadata from plugins in a pipeline Jun 11, 2024
@zanete zanete mentioned this issue Jun 11, 2024
1 task
@zanete zanete added the blocked The issue is blocked and cannot proceed. label Jun 11, 2024
@jmcook1186 jmcook1186 moved this from In Design to In Refinement in IF Jun 17, 2024
@zanete
Copy link
Author

zanete commented Jun 18, 2024

@manushak @narekhovhannisyan please review ac to confirm you're ok with it

@narekhovhannisyan narekhovhannisyan removed their assignment Jun 27, 2024
@narekhovhannisyan narekhovhannisyan removed their assignment Jun 27, 2024
@zanete zanete moved this from In Refinement to Ready in IF Jun 27, 2024
@manushak manushak moved this from Ready to In Progress in IF Jul 15, 2024
@zanete zanete changed the title Add explainer that collates metadata from plugins in a pipeline Add explain that collates metadata from plugins in a pipeline Jul 15, 2024
@manushak manushak moved this from In Progress to Pending Review in IF Jul 16, 2024
@manushak manushak linked a pull request Jul 16, 2024 that will close this issue
9 tasks
@zanete zanete removed blocked The issue is blocked and cannot proceed. draft The issue is still being written, no need to respond or action on anything. labels Jul 16, 2024
@zanete zanete moved this from Pending Review to In Progress in IF Jul 22, 2024
@zanete
Copy link
Author

zanete commented Jul 23, 2024

@jmcook1186 please take a look at the comment on the PR

@jmcook1186 jmcook1186 removed a link to a pull request Jul 23, 2024
9 tasks
@zanete
Copy link
Author

zanete commented Jul 24, 2024

@narekhovhannisyan please review 🙏

@zanete zanete moved this from In Progress to Pending Review in IF Jul 24, 2024
@zanete zanete closed this as completed Jul 25, 2024
@github-project-automation github-project-automation bot moved this from Pending Review to Done in IF Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-only This issue is reserved for the IF core team only
Projects
Status: Done
Development

No branches or pull requests

4 participants