Skip to content

Commit

Permalink
Merge pull request #113 from Green-Software-Foundation/update-quick-s…
Browse files Browse the repository at this point in the history
…tart

fix quick start
  • Loading branch information
manushak authored Oct 1, 2024
2 parents ae4a15b + e98f34d commit 9295d26
Showing 1 changed file with 16 additions and 25 deletions.
41 changes: 16 additions & 25 deletions docs/users/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,26 @@ npm install -g @grnsft/if

Read our detailed guide to [installing IF](./how-to-install-if.md).

## 2: Install some plugins

Install some of the plugins you want to include in your pipeline. The following commands will install both the official and unofficial IF model packages.

```sh
npm install -g @grnsft/if-plugins
npm install -g @grnsft/if-unofficial-plugins
```

Read our detailed guide to [loading plugins](./how-to-import-plugins.md).

## 3: Create a manifest file
## 2: Create a manifest file

A manifest file contains all the configuration and input data required to measure your application's energy and carbon impacts and should have a `.yml` extension.

Open the file, add your data and save the file. The simple example below runs a single snapshot observation through a single plugin.
Open the file, add your data and save the file. The minimal example below runs two snapshot observations through a single plugin - all it does is multiply a value in each element of the `input` data by 2.

```yaml
name: basic-demo
description:
tags:
initialize:
plugins:
teads-curve:
path: '@grnsft/if-unofficial-plugins'
method: TeadsCurve
global-config:
interpolation: spline
double-a-value:
path: 'builtin'
method: Coefficient
config:
input-parameter: "cpu-utilization"
coefficient: 2
output-parameter: "cpu-utilization-doubled"
tree:
children:
child-0:
Expand All @@ -53,36 +45,35 @@ tree:
observe:
regroup:
compute:
- teads-curve
- double-a-value
inputs:
- timestamp: 2023-07-06T00:00
duration: 1
cpu/utilization: 20
- timestamp: 2023-07-06T00:01
duration: 1
cpu/utilization: 80
- timestamp: 2023-07-06T00:02
duration: 1
cpu/utilization: 20
```
Read our detailed guide to [writing manifest files](./how-to-write-manifests.md).
Read our detailed guides to [writing manifest files](./how-to-write-manifests.md).
## 4: Compute your manifest file
## 3: Compute your manifest file
Run the pipeline by passing the path to your manifest file to the `if-run` command line tool:

```sh
if-run --manifest <path-to-your-manifest>
```

:tada:**Congratulations** :tada:! You have just used the Impact Framework to compute the energy consumed by an application!
The output will be printed to the console.

:tada:**Congratulations** :tada:! You have just used the Impact Framework to compute a manifest file! Your challenge now is to use these principles to construct manifest files for real applications. Our docs will help!

## Next steps

Now you know how to use the `if-run` you can start building more complex pipelines of plugins and more complicated manifest files. Your overall aim is to create a manifest file that accurately represents a real software application, and a plugin pipeline that yields an environmental metric that's important to you (e.g. `carbon`).

Experiment by adding more plugins to the pipeline, for example add `sci-o` to convert energy into `operational-carbon`. Your output data will be displayed in your console.
Experiment by adding more plugins to the pipeline and observe how each plugin enriches each element in the `inputs` array with new values.

You can also configure `if` to save your output data to another `yaml` file. To do this, add the `--output` flag and the path to the output file where the results are saved.

Expand Down

0 comments on commit 9295d26

Please sign in to comment.