Green-Software-Foundation / if

Impact Framework
https://if.greensoftware.foundation/
MIT License
138 stars 40 forks source link

Create EcoCI plugin #909

Closed zanete closed 1 month ago

zanete commented 1 month ago

Why: Sub of #898 What: Create a EcoCI plugin

We recently merged a PR adding the EcoCI tool to our CI/CD which uses a model to estimate the energy and carbon consumption of our Github Actions. The data is presented on a dashboard and also exposed via an API. We would like to be able to pull this data into an IF manifest file so that the energy consumed and carbon emitted by our CI/CD can be accounted for in more comprehensive assessments of our project's imapcts.

Scope of work:

Acceptance criteria

Given the plugin works as intended When I run the following manifest:

name: eco-ci demo
description: 
tags:
initialize:
  plugins:
    ci/cd:
      method: EcoCiApi
      path: "eco-ci-plugin"
      global-config:
        repo: "Green-Software-Foundation/if"
        branch: main
        workflow: "66389738"
tree:
  children:
    child:
      pipeline:
        - ci/cd
      config:
      inputs:
        - timestamp: '2024-07-10T11:51:48.467730+00:00'
          duration: 3600

I should receive the following output (actual values will be different):

name: eco-ci demo
description: 
tags:
initialize:
  plugins:
    ci/cd:
      method: EcoCiApi
      path: "eco-ci-plugin"
      global-config:
        repo: "Green-Software-Foundation/if"
        branch: main
        workflow: "66389738"
tree:
  children:
    child:
      pipeline:
        - ci/cd
      config:
      inputs:
        - timestamp: '2024-07-10T11:51:48.467730+00:00'
          duration: 3600
          energy: 0.0003 #kWh`
          carbon: 0.00004 #gCo2eq
zanete commented 1 month ago

@manushak please confirm the AC is clear

manushak commented 1 month ago

yeah, it's clear.

@jmcook1186 can you create the repo for this plugin?

zanete commented 1 month ago

@narekhovhannisyan @jmcook1186 please review the PR 🙏