Skip to content

Commit

Permalink
docs: note added on top and fixed import code examples
Browse files Browse the repository at this point in the history
Signed-off-by: Gnanakeethan Balasubramaniam <[email protected]>
  • Loading branch information
gnanakeethan committed Nov 14, 2023
1 parent 437970e commit 3fdd79d
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 28 deletions.
5 changes: 4 additions & 1 deletion src/lib/azure-importer/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

# Azure-importer

> **Note**
> `Azure Importer` is a community model, not part of the IF standard library. This means the IF core team are not closely monitoring these models to keep them up to date. You should do your own research before implementing them!

The Azure importer model allows you to provide some basic details about an Azure virtual machine and automatically populate your `impl` with usage metrics that can then be passed along a model pipeline to calculate energy and carbon impacts.


Expand Down
3 changes: 2 additions & 1 deletion src/lib/boavizta/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Boavizta

**Please note** Boavizta is an unofficial model, not part of the IF standard library. This means the IF core team are not closely monitoring these models to keep them up to date. You should do your own research before implementing them!
> **Note**
> Boavizta is a community model, not part of the IF standard library. This means the IF core team are not closely monitoring these models to keep them up to date. You should do your own research before implementing them!

[Boavizta](https://boavizta.org/) is an environmental impact calculator that exposes an API we use in IEF to retrieve energy and embodied carbon estimates.
Expand Down
8 changes: 5 additions & 3 deletions src/lib/ccf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ graph:
This impl is run using `impact-engine` using the following command, run from the project root:

```sh
npx ts-node scripts/impact.ts --impl ./examples/impls/ccf-test.yml --ompl ./examples/ompls/ccf-test.yml
npm i -g @grnsft/if
npm i -g @grnsft/if-unofficial-models
impact-engine --impl ./examples/impls/ccf-test.yml --ompl ./examples/ompls/ccf-test.yml
```

This yields a result that looks like the following (saved to `/ompls/ccf-test.yml`):
Expand All @@ -148,9 +151,8 @@ description: example impl invoking CCF model
initialize:
models:
- name: ccf
kind: plugin
model: CloudCarbonFootprint
path: ccf
path: '@grnsft/if-unofficial-models'
graph:
children:
front-end:
Expand Down
20 changes: 10 additions & 10 deletions src/lib/teads-aws/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Teads' AWS Estimation Model

**Please note** `Teads-AWS` is a community model, not part of the IF standard library. This means the IF core team are not closely monitoring these models to keep them up to date. You should do your own research before implementing them!
> **Note**
> `Teads-AWS` is a community model, not part of the IF standard library. This means the IF core team are not closely monitoring these models to keep them up to date. You should do your own research before implementing them!

Teads Engineering Team built a model for estimating AWS Instances energy usage. This model creates a power curve on a correlation to SPEC Power database. This allows the model to generate a power curve for any AWS EC2 instance type based on publicly available AWS EC2 Instance CPU data.
Teads Engineering Team built a model for estimating AWS Instances energy usage. This model creates a power curve on a correlation to SPEC Power database. This allows the model to generate a power curve for any AWS EC2 instance type based on publicly available AWS EC2 Instance CPU data.

The main benefit of this model is that it accounts for all the components involved in an instance's compute capacity.
The main benefit of this model is that it accounts for all the components involved in an instance's compute capacity.


## Model name
Expand Down Expand Up @@ -35,15 +36,15 @@ IF recognizes the Teads AWS mdoel as `teads-aws`

IEF implements this plugin based off the data embedded from the CCF (Cloud Carbon Footprint) dataset.

Spline interpolation is implemented as the default method of estimating the usage using the power curve provided by `IDLE`, `10%`, `50%`, `100%` values in the dataset.
Spline interpolation is implemented as the default method of estimating the usage using the power curve provided by `IDLE`, `10%`, `50%`, `100%` values in the dataset.

Resulting values are an approximation / estimation based on the testing done by Teads' Engineering Team. Further information can be found in the following links.
Resulting values are an approximation / estimation based on the testing done by Teads' Engineering Team. Further information can be found in the following links.
1. [TEADS Engineering: Building An AWS EC2 Carbon Emissions Dataset](https://medium.com/teads-engineering/building-an-aws-ec2-carbon-emissions-dataset-3f0fd76c98ac)
2. [TEADS Engineering: Estimating AWS EC2 Instances Power Consumption](https://medium.com/teads-engineering/estimating-aws-ec2-instances-power-consumption-c9745e347959)

## Example
```typescript
import {TeadsAWS} from 'ief';
import {TeadsAWS} from '@grnsft/if-unofficial-models';

const teads = new TeadsAWS();
teads.configure({
Expand All @@ -67,16 +68,15 @@ tags:
initialize:
models:
- name: teads-aws
kind: plugin
model: TeadsAWS
path: teads-aws
path: '@grnsft/if-unofficial-models'
graph:
children:
child:
pipeline:
pipeline:
- teads-aws # duration & config -> embodied
config:
inputs:
inputs:
- timestamp: 2023-07-06T00:00
duration: 3600
```
13 changes: 7 additions & 6 deletions src/lib/teads-curve/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Teads' CPU Estimation Model

**Please note** `Teads-AWS` is a community model, not part of the IF standard library. This means the IF core team are not closely monitoring these models to keep them up to date. You should do your own research before implementing them!
> **Note**
> `Teads-Curve` is a community model, not part of the IF standard library. This means the IF core team are not closely monitoring these models to keep them up to date. You should do your own research before implementing them!
Teads Engineering team has built a model that is capable of estimating CPU usages across varying type of CPUs using a curve commonly known as Teads Curve.

Expand All @@ -17,7 +18,7 @@ IF recognizes the Teads CPU model as `teads-curve`.

### Observations

- `cpu-util`: percentage CPU utilization for the observation
- `cpu-util`: percentage CPU utilization for the observation

## Returns

Expand All @@ -34,7 +35,7 @@ The power curve provided for `IDLE`, `10%`, `50%`, `100%` in the Teads Curve are

The algorithm in linear interpolation will take the lowest possible base value + linear interpolated value. ie. 75% usage will be calculated as follows.
`100%` and `50%` are the known values hence we are interpolating linearly between them.
(`50%` + `(100%-50%)` `x` `(75%-50%))` `x` `thermal-design-power`.
(`50%` + `(100%-50%)` `x` `(75%-50%))` `x` `thermal-design-power`.



Expand Down Expand Up @@ -99,16 +100,16 @@ initialize:
graph:
children:
child:
pipeline:
pipeline:
- teads-cpu # duration & config -> embodied
config:
sci-m:
total-embodied-emissions: 1533.120 # gCO2eq
time-reserved: 1 # s per hour
expected-lifespan: 3 # 3 years in seconds
expected-lifespan: 3 # 3 years in seconds
resources-reserved: 1
total-resources: 8
inputs:
inputs:
- timestamp: 2023-07-06T00:00
duration: 3600
```
15 changes: 8 additions & 7 deletions src/lib/watt-time/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# WattTime Grid Emissions Model

**Please note** `Watt-time` is a community model, not part of the IF standard library. This means the IF core team are not closely monitoring these models to keep them up to date. You should do your own research before implementing them!
> **Note**
> `Watt-time` is a community model, not part of the IF standard library. This means the IF core team are not closely monitoring these models to keep them up to date. You should do your own research before implementing them!
## Introduction

WattTime technology—based on real-time grid data, cutting-edge algorithms, and machine learning—provides first-of-its-kind insight into your local electricity grid’s marginal emissions rate. [Read More...](https://www.watttime.org/api-documentation/#introduction)


## Scope
## Scope

WattTime Model provides a way to calculate emissions for a given time in a specific location.
WattTime Model provides a way to calculate emissions for a given time in a specific location.

The model is based on the WattTime API. The model uses the following inputs:
* location: Location of the software system (latitude in decimal degrees, longitude in decimal degrees). "latitude,longitude"
Expand All @@ -19,8 +20,8 @@ The model is based on the WattTime API. The model uses the following inputs:

## Implementation

Limitations:
* Set of inputs are to be within 32 days of each other.
Limitations:
* Set of inputs are to be within 32 days of each other.
* Emissions are aggregated for every 5 minutes regardless of the granularity of the inputs.

### Authentication
Expand All @@ -41,7 +42,7 @@ https://www.watttime.org/get-the-data/data-plans/
* ENV_WATT_TIME_PASSWORD - specifying this value enables the Impact to load the value from the environment variable `WATT_TIME_PASSWORD`


### inputs
### inputs

**Required Parameters:**
* timestamp: Timestamp of the recorded event (2021-01-01T00:00:00Z) RFC3339
Expand Down Expand Up @@ -71,7 +72,7 @@ const results = env_model.calculateEmissions(inputs);
### IMPL Usage
#### Environment Variable based configuration for IMPL
```yaml
# environment variable config , prefix the environment variables with "ENV" to load them inside the model.
# environment variable config , prefix the environment variables with "ENV" to load them inside the model.
# export WATT_TIME_USERNAME=test1
# export WATT_TIME_PASSWORD=test2
config:
Expand Down

0 comments on commit 3fdd79d

Please sign in to comment.