Note
Boavizta is a community plugin, not part of the IF standard library. This means the IF core team are not closely monitoring these plugins to keep them up to date. You should do your own research before implementing them!
Currently there is a known issue in Boavizta calculations, and the fix is coming soon. This disclaimer will be removed then!
Boavizta is an environmental impact calculator that exposes an API we use in IF to retrieve energy and embodied carbon estimates.
Boavizta exposes a REST API. If the boavizta
plugin is included in an IF pipeline, IF sends API requests to Boavizta. The request payload is generated from input data provided to IF in an manifest
file.
verbose
: determines how much information the API response contains (optional)
cpu/name
: the name of the physical processor being used (required forBoaviztaCpuOutput
)cpu/number-cores
: number of physical cores on a CPU (required forBoaviztaCpuOutput
)cpu/expected-lifespan
: the lifespan of the component, in seconds (optional)country
: the country used to lookup grid carbon intensity, e.g. "USA" (optional - falls back to Boavizta default)instance-type
: the name of the specific instance (required forBoaviztaCloudOutput
, optional forBoaviztaCpuOutput
)provider
: the name of cloud provider (required forBoaviztaCloudOutput
) One of the metric type should be provided in the inputcpu/utilization
: percentage CPU utilization for a given observation. If this metric is providedgpu-util
: percentage GPU quantity for a given observationram-util
: number of RAM
carbon-embodied
: carbon emitted in manufacturing the device, in gCO2eqcpu/energy
: energy used by CPU in kWh
To run the boavista-cpu
plugin an instance of BoaviztaCpuOutput
must be created using BoaviztaCpuOutput()
and, if applicable, passing global configurations. Subsequently, the execute()
function can be invoked to retrieve data on carbon-embodied
and cpu/energy
.
This is how you could run the plugin in Typescript:
import {BoaviztaCpuOutput} from '@grnsft/if-unofficial-plugins';
const output = BoaviztaCpuOutput({});
const usage = await output.execute([
{
timestamp: '2021-01-01T00:00:00Z',
duration: 1,
'cpu/utilization': 34,
'cpu/name': 'Intel Xeon Gold 6138f',
'cpu/number-cores': 24,
'cpu/expected-lifespan': 4 * 365 * 24 * 60 * 60,
},
{
timestamp: '2021-01-01T00:00:15Z',
duration: 1,
'cpu/utilization': 12,
'cpu/name': 'Intel Xeon Gold 6138f',
'cpu/number-cores': 24,
'cpu/expected-lifespan': 4 * 365 * 24 * 60 * 60,
},
{
timestamp: '2021-01-01T00:00:30Z',
duration: 1,
'cpu/utilization': 1,
'cpu/name': 'Intel Xeon Gold 6138f',
'cpu/number-cores': 24,
'cpu/expected-lifespan': 4 * 365 * 24 * 60 * 60,
},
{
timestamp: '2021-01-01T00:00:45Z',
duration: 1,
'cpu/utilization': 78,
'cpu/name': 'Intel Xeon Gold 6138f',
'cpu/number-cores': 24,
'cpu/expected-lifespan': 4 * 365 * 24 * 60 * 60,
},
]);
In IF plugins are expected to be invoked from an manifest
file. This is a yaml containing the plugin configuration and inputs. The following manifest
initializes and runs the boavizta-cpu
plugin:
name: boavizta-demo
description: calls boavizta api
tags:
initialize:
plugins:
boavizta-cpu:
method: BoaviztaCpuOutput
path: '@grnsft/if-unofficial-plugins'
global-config:
allocation: LINEAR
verbose: true
tree:
children:
child:
pipeline:
- boavizta-cpu
defaults:
cpu/number-cores: 24
cpu/name: Intel® Core™ i7-1185G7
inputs:
- timestamp: 2023-07-06T00:00 # [KEYWORD] [NO-SUBFIELDS] time when measurement occurred
duration: 3600 # Secs
cpu/utilization: 18.392
- timestamp: 2023-08-06T00:00 # [KEYWORD] [NO-SUBFIELDS] time when measurement occurred
duration: 3600 # Secs
cpu/utilization: 16
You can run this by passing it to ie
. Run impact using the following command run from the project root:
npm i -g @grnsft/if
npm i -g @grnsft/if-unofficial-plugins
ie --manifest ./examples/manifests/test/boavizta.yml --output ./examples/outputs/boavizta.yml
To run the boavista-cloud
plugin an instance of BoaviztaCloudOutput
must be created using BoaviztaCloudOutput()
and, if applicable, passing global configurations. Subsequently, the execute()
function can be invoked to retrieve data on carbon-embodied
and cpu/energy
.
This is how you could run the plugin in Typescript:
import {BoaviztaCloudOutput} from '@grnsft/if-unofficial-plugins';
const output = BoaviztaCloudOutput({});
const usage = await output.execute([
{
timestamp: '2021-01-01T00:00:00Z',
duration: 15,
'cpu/utilization': 34,
'instance-type': 't2.micro',
country: 'USA',
provider: 'aws',
},
]);
In IF plugins are expected to be invoked from an manifest
file. This is a yaml containing the plugin configuration and inputs. The following manifest
initializes and runs the boavizta-cloud
plugin:
name: boavizta cloud demo
description: calls boavizta api
tags:
initialize:
plugins:
'boavizta-cloud':
method: BoaviztaCloudOutput
path: '@grnsft/if-unofficial-plugins'
tree:
children:
child:
pipeline:
- boavizta-cloud
defaults:
instance-type: r6g.medium
provider: aws
inputs:
- timestamp: '2021-01-01T00:00:00Z'
duration: 15 # Secs
cpu/utilization: 34
You can run this by passing it to ie
. Run impact using the following command run from the project root:
npm i -g @grnsft/if
npm i -g @grnsft/if-unofficial-plugins
ie --manifest ./examples/manifests/test/boavizta-cloud.yml --output ./examples/outputs/boavizta-cloud.yml