-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from Green-Software-Foundation/ccf-imp
- Loading branch information
Showing
22 changed files
with
1,083 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "third-party/ccf-coefficients"] | ||
path = third-party/ccf-coefficients | ||
url = https://github.com/cloud-carbon-footprint/ccf-coefficients |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
|
||
#Converts the CSV files from CCF Coefficients Database to JSON. | ||
ccf-data: | ||
cat third-party/ccf-coefficients/data/aws-instances.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/aws-instances.json | ||
cat third-party/ccf-coefficients/output/coefficients-aws-use.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/aws-use.json | ||
cat third-party/ccf-coefficients/output/coefficients-aws-embodied.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/aws-embodied.json | ||
cat third-party/ccf-coefficients/data/gcp-instances.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/gcp-instances.json | ||
cat third-party/ccf-coefficients/output/coefficients-gcp-use.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/gcp-use.json | ||
cat third-party/ccf-coefficients/output/coefficients-gcp-embodied.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/gcp-embodied.json | ||
cat third-party/ccf-coefficients/data/azure-instances.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/azure-instances.json | ||
cat third-party/ccf-coefficients/output/coefficients-azure-use.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/azure-use.json | ||
cat third-party/ccf-coefficients/output/coefficients-azure-embodied.csv | python -c 'import csv, json, sys; print(json.dumps([dict(r) for r in csv.DictReader(sys.stdin)]))' > lib/ccf/azure-embodied.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Implementations | ||
|
||
[CCF](./ccf.md) - Cloud Carbon Footprint Impact Plugin Documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Cloud Carbon Footprint | ||
|
||
Cloud Carbon Footprint is an open source tool that provides visibility and tooling to measure, monitor and reduce your cloud carbon emissions. We use best practice methodologies to convert cloud utilization into estimated energy usage and carbon emissions, producing metrics and carbon savings estimates that can be shared with employees, investors, and other stakeholders. | ||
|
||
## Implementation | ||
|
||
IEF implements this plugin to the IEF Specification based on the computational methodology used by the Cloud Carbon Footprint. | ||
|
||
Cloud Carbon Footprint includes calculations for three cloud providers namely AWS, Azure and GCP. | ||
|
||
By default, Linear interpolation is used to estimate the energy. Interpolation is performed using the CPU Design Cycle, for example in Intel Chips, **CoffeeLake** and for example in AMD Chips, **EPYC 2nd Gen**. | ||
|
||
Additionally, **TEADS model curve for AWS** available in the CCF dataset can be used for spline curve interpolation for instances in AWS infrastructure. | ||
|
||
Resulting values are generally approximation and should be revalidated across different models as there can be significant difference between values. | ||
|
||
New instances across all cloud providers might not be recognized by CCF. Earliest possible instances recognized are released before 2021 December. | ||
|
||
## Usage | ||
|
||
Configure method has to be called on the instantiated object before any other calls are done. | ||
|
||
Calculate method expects an array of observations. Each observation should feature `duration`,`cpu`,`datetime` in the formats specified below. | ||
|
||
|
||
### AWS | ||
|
||
```typescript | ||
import {CloudCarbonFootprint} from 'ief'; | ||
|
||
const ccf = new CloudCarbonFootprint(); | ||
ccf.configure({ | ||
provider: 'aws', | ||
instance_type: 'c6i.large' | ||
}) | ||
const results = ccf.calculate([ | ||
{ | ||
duration: 3600, // duration institute | ||
cpu: 0.1, // CPU usage as a value between 0 and 1 in floating point number | ||
datetime: '2021-01-01T00:00:00Z', // ISO8601 / RFC3339 timestamp | ||
} | ||
]) | ||
``` | ||
|
||
### Azure | ||
|
||
```typescript | ||
import {CloudCarbonFootprint} from 'ief'; | ||
|
||
const ccf = new CloudCarbonFootprint(); | ||
ccf.configure({ | ||
provider: 'azure', | ||
instance_type: 'D4 v4' | ||
}) | ||
const results = ccf.calculate([ | ||
{ | ||
duration: 3600, // duration institute | ||
cpu: 0.1, // CPU usage as a value between 0 and 1 in floating point number | ||
datetime: '2021-01-01T00:00:00Z', // ISO8601 / RFC3339 timestamp | ||
} | ||
]) | ||
``` | ||
|
||
### GCP | ||
|
||
```typescript | ||
import {CloudCarbonFootprint} from 'ief'; | ||
|
||
const ccf = new CloudCarbonFootprint(); | ||
ccf.configure({ | ||
provider: 'aws', | ||
instance_type: 'n2-standard-2' | ||
}) | ||
const results = ccf.calculate([ | ||
{ | ||
duration: 3600, // duration institute | ||
cpu: 0.1, // CPU usage as a value between 0 and 1 in floating point number | ||
datetime: '2021-01-01T00:00:00Z', // ISO8601 / RFC3339 timestamp | ||
} | ||
]) | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
[ | ||
{ | ||
"": "0", | ||
"Architecture": "Graviton", | ||
"Min Watts": "0.4742621527777778", | ||
"Max Watts": "1.6929615162037037", | ||
"GB/Chip": "129.77777777777777" | ||
}, | ||
{ | ||
"": "1", | ||
"Architecture": "Ivy Bridge", | ||
"Min Watts": "3.0369270833333335", | ||
"Max Watts": "8.248611111111112", | ||
"GB/Chip": "14.933333333333334" | ||
}, | ||
{ | ||
"": "2", | ||
"Architecture": "Sandy Bridge", | ||
"Min Watts": "2.1694411458333334", | ||
"Max Watts": "8.575357663690477", | ||
"GB/Chip": "16.480916030534353" | ||
}, | ||
{ | ||
"": "3", | ||
"Architecture": "Haswell", | ||
"Min Watts": "1.9005681818181814", | ||
"Max Watts": "6.012910353535353", | ||
"GB/Chip": "27.310344827586206" | ||
}, | ||
{ | ||
"": "4", | ||
"Architecture": "Sky Lake", | ||
"Min Watts": "0.6446044454253452", | ||
"Max Watts": "4.193436438541878", | ||
"GB/Chip": "80.43037974683544" | ||
}, | ||
{ | ||
"": "5", | ||
"Architecture": "Cascade Lake", | ||
"Min Watts": "0.6389493581523519", | ||
"Max Watts": "3.9673047343937564", | ||
"GB/Chip": "98.11764705882354" | ||
}, | ||
{ | ||
"": "6", | ||
"Architecture": "EPYC 2nd Gen", | ||
"Min Watts": "0.4742621527777778", | ||
"Max Watts": "1.6929615162037037", | ||
"GB/Chip": "129.77777777777777" | ||
}, | ||
{ | ||
"": "7", | ||
"Architecture": "Graviton2", | ||
"Min Watts": "0.4742621527777778", | ||
"Max Watts": "1.6929615162037037", | ||
"GB/Chip": "129.77777777777777" | ||
}, | ||
{ | ||
"": "8", | ||
"Architecture": "Broadwell", | ||
"Min Watts": "0.7128342245989304", | ||
"Max Watts": "3.6853275401069516", | ||
"GB/Chip": "69.6470588235294" | ||
}, | ||
{ | ||
"": "9", | ||
"Architecture": "EPYC 1st Gen", | ||
"Min Watts": "0.82265625", | ||
"Max Watts": "2.553125", | ||
"GB/Chip": "89.6" | ||
}, | ||
{ | ||
"": "10", | ||
"Architecture": "Coffee Lake", | ||
"Min Watts": "1.138425925925926", | ||
"Max Watts": "5.421759259259258", | ||
"GB/Chip": "19.555555555555557" | ||
} | ||
] |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[ | ||
{ | ||
"": "0", | ||
"Architecture": "EPYC 3rd Gen", | ||
"Min Watts": "0.44538981119791665", | ||
"Max Watts": "2.0193277994791665", | ||
"GB/Chip": "128.0" | ||
}, | ||
{ | ||
"": "1", | ||
"Architecture": "Haswell", | ||
"Min Watts": "1.9005681818181814", | ||
"Max Watts": "6.012910353535353", | ||
"GB/Chip": "27.310344827586206" | ||
}, | ||
{ | ||
"": "2", | ||
"Architecture": "Cascade Lake", | ||
"Min Watts": "0.6389493581523519", | ||
"Max Watts": "3.9673047343937564", | ||
"GB/Chip": "98.11764705882354" | ||
}, | ||
{ | ||
"": "3", | ||
"Architecture": "Skylake", | ||
"Min Watts": "0.6446044454253452", | ||
"Max Watts": "4.193436438541878", | ||
"GB/Chip": "80.43037974683544" | ||
}, | ||
{ | ||
"": "4", | ||
"Architecture": "Broadwell", | ||
"Min Watts": "0.7128342245989304", | ||
"Max Watts": "3.6853275401069516", | ||
"GB/Chip": "69.6470588235294" | ||
}, | ||
{ | ||
"": "5", | ||
"Architecture": "EPYC 2nd Gen", | ||
"Min Watts": "0.4742621527777778", | ||
"Max Watts": "1.6929615162037037", | ||
"GB/Chip": "129.77777777777777" | ||
}, | ||
{ | ||
"": "6", | ||
"Architecture": "Coffee Lake", | ||
"Min Watts": "1.138425925925926", | ||
"Max Watts": "5.421759259259258", | ||
"GB/Chip": "19.555555555555557" | ||
}, | ||
{ | ||
"": "7", | ||
"Architecture": "EPYC 1st Gen", | ||
"Min Watts": "0.82265625", | ||
"Max Watts": "2.553125", | ||
"GB/Chip": "89.6" | ||
} | ||
] |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"": "0", "Architecture": "Skylake", "Min Watts": "0.6446044454253452", "Max Watts": "3.8984738056304855", "GB/Chip": "80.43037974683544"}, {"": "1", "Architecture": "Broadwell", "Min Watts": "0.7128342245989304", "Max Watts": "3.3857473048128344", "GB/Chip": "69.6470588235294"}, {"": "2", "Architecture": "Haswell", "Min Watts": "1.9005681818181814", "Max Watts": "5.9688982156043195", "GB/Chip": "27.310344827586206"}, {"": "3", "Architecture": "EPYC 2nd Gen", "Min Watts": "0.4742621527777778", "Max Watts": "1.5751872939814815", "GB/Chip": "129.77777777777777"}, {"": "4", "Architecture": "Cascade Lake", "Min Watts": "0.6389493581523519", "Max Watts": "3.6424520285114035", "GB/Chip": "98.11764705882354"}, {"": "5", "Architecture": "EPYC 3rd Gen", "Min Watts": "0.44538981119791665", "Max Watts": "1.8719357994791666", "GB/Chip": "128.0"}, {"": "6", "Architecture": "Ivy Bridge", "Min Watts": "3.0369270833333335", "Max Watts": "8.199689511111112", "GB/Chip": "14.933333333333334"}, {"": "7", "Architecture": "Sandy Bridge", "Min Watts": "2.1694411458333334", "Max Watts": "8.550185877430936", "GB/Chip": "16.480916030534353"}] |
Oops, something went wrong.