Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cloud-metadata readme file #77

Merged
merged 3 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions src/lib/cloud-metadata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This plugin allows you to determine an instance's physical processor and thermal

## Plugin Config

Not Needed
- `fields`: An array of parameters that should be output (optional)

### Inputs

Expand All @@ -19,7 +19,6 @@ Not Needed

An array containing:


- `timestamp`: "2023-07-06T00:01"
- `duration`: 10
- `cloud/vendor`: the name of the cloud vendor as a string, options are "azure", "gcp" or "aws"
Expand All @@ -30,7 +29,6 @@ An array containing:
- `physical-processor`: name of the physical processor used by this instance as a string, e.g. "Intel® Xeon® Platinum 8259CL" (note some instances return multiple possible processors separated by commas)
- `cpu/thermal-design-power`: the thermal design power of the given processor (selects the first in the list of multiple are returned)


## IF Implementation

IF implements this plugin using data from Cloud Carbon Footprint. This allows determination of cpu for type of instance in a cloud and can be invoked as part of a plugin pipeline defined in a `manifest`.
Expand All @@ -48,8 +46,8 @@ You can see example Typescript invocations for each vendor below:
```typescript
import {CloudMetadata} from '@grnsft/if-plugins';

const cim = CloudMetadata();
const result = await cim.execute([
const cloudMetadata = CloudMetadata();
const result = await cloudMetadata.execute([
{
'cloud/vendor': 'aws',
'cloud/instance-type': 'm5n.large',
Expand All @@ -61,13 +59,15 @@ const result = await cim.execute([

The following is an example of how cloud metadata can be invoked using a `manifest`.

./examples/manifests/test/cim.yml
./examples/manifests/test/cloud-metadata.yml

```yaml
name: cloud-metadata
description: example manifest invoking Cloud Metadata plugin
tags:
initialize:
outputs:
- yaml
plugins:
cloud-metadata:
method: CloudMetadata
Expand All @@ -78,6 +78,11 @@ tree:
pipeline:
- cloud-metadata
config:
cloud-metadata:
fields:
- cpu/thermal-design-power
- physical-processor
- memory-available
inputs:
- timestamp: 2023-07-06T00:00 # [KEYWORD] [NO-SUBFIELDS] time when measurement occurred
cloud/vendor: aws
Expand All @@ -93,10 +98,10 @@ the project root:
```sh
npm i -g @grnsft/if
npm i -g @grnsft/if-plugins
ie --manifest ./examples/manifests/test/cim.yml --output ./outputs/cim.yml
ie --manifest ./examples/manifests/test/cloud-metadata.yml --output ./outputs/cloud-metadata.yml
```

This yields a result that looks like the following (saved to `./outputs/cim.yml`):
This yields a result that looks like the following (saved to `./outputs/cloud-metadata.yml`):

```yaml
name: cloud-metadata
Expand All @@ -114,6 +119,12 @@ tree:
front-end:
pipeline:
- cloud-metadata
config:
cloud-metadata:
fields:
- cpu/thermal-design-power
- physical-processor
- memory-available
inputs:
- timestamp: 2023-07-06T00:00
cloud/vendor: aws
Expand All @@ -133,7 +144,7 @@ tree:
cpu/thermal-design-power: 210
```

You can run this example `manifest` by saving it as `./examples/manifests/test/cim.yml` and executing the following command from the project root:
You can run this example `manifest` by saving it as `./examples/manifests/test/cloud-metadata.yml` and executing the following command from the project root:

```sh
npm i -g @grnsft/if
Expand Down
2 changes: 2 additions & 0 deletions src/lib/shell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ name: shell-demo
description:
tags:
initialize:
outputs:
- yaml
plugins:
sampler:
method: Shell
Expand Down
2 changes: 2 additions & 0 deletions src/lib/tdp-finder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ name: tdp-demo
description:
tags:
initialize:
outputs:
- yaml
plugins:
finder:
method: TdpFinder
Expand Down
Loading