Skip to content

Sophietn/if

 
 

Repository files navigation

[!important] Incubation Project: This project is an incubation project being run inside the Green Software Foundation; as such, we DON’T recommend using it in any critical use case. Incubation projects are experimental, offer no support guarantee, have minimal governance and process, and may be retired at any moment. This project may one day Graduate, in which case this disclaimer will be removed.

Impact Framework

Impact Framework (IF) is an Incubation project from the Open Source Working Group in the Green Software Foundation.

IF is a framework to Model, Measure, siMulate and Monitor the environmental impacts of software

Modern applications are composed of many smaller pieces of software (components) running on many different environments, for example, private cloud, public cloud, bare-metal, virtualized, containerized, mobile, laptops, and desktops.

Every environment requires a different model of measurement, and there is no single solution you can use to calculate the environmental impacts for all components across all environments.

The friction to measuring software emissions isn't that we need to know how, it's that we run software on many things and each thing has several different ways to measure.

Read the specification and design docs to begin.

Get started

The first thing to understand is that IF is a framework for running model plugins. This means that in order to do some calculations, you need to load some models from some external resource. We provide a standard library of models and a repository of community models to get you started.

Start by installing framework itself:

npm install -g "@grnsft/if"

Then installing some models:

npm install -g "@grnsft/if-models"

Then create an impl file that describes your application (see our docs for a detailed explanation).

Then, run impact-engine using the following command:

impact-engine --impl <path-to-your-impl-file>

You can also add an optional savepath for your output yaml (if you do not provide one, the output will be printed to the console):

impact-engine --impl <path-to-your-impl-file> --ompl <your-savepath>

The impact-engine CLI tool will configure and run the models defined in your input yaml (impl) and return the results as an output yaml (ompl).

Alternate version

Start by cloning repository locally:

git clone https://github.com/Green-Software-Foundation/if

cd if

yarn install

Then installing some models:

yarn add "@grnsft/if-models"

Then create an impl file that describes your application (see our docs for a detailed explanation).

Then, run impact-engine using the following command:

yarn impact-engine -- --impl <path-to-your-impl-file>

You can also add an optional savepath for your output yaml (if you do not provide one, the output will be printed to the console):

yarn impact-engine -- --impl <path-to-your-impl-file> --ompl <your-savepath>

The impact-engine CLI tool will configure and run the models defined in your input yaml (impl) and return the results as an output yaml (ompl).

Video walk-through

Watch this video to learn how to create and run an impl.

Watch the walk-through video

Run tests

To run the complete set of tests simply run

yarn test

To refresh the set of ompls used for validating the output files, run the scripts/impact-test.sh bash script (for unix only) as follows:

./scripts/impact-test.sh

Then run

yarn test

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 92.0%
  • JavaScript 3.9%
  • Makefile 3.6%
  • Shell 0.5%