This notebook calculates the coefficients used in Cloud Carbon Footprint, an application that estimates the energy (kilowatt hours) and carbon emissions (metric tons CO2e) from public cloud provider utilization.
These values are based on the SPECpower_ssj2008 results. New data is released every quarter so the notebook helps calculate updated coefficients. The full results are in data/.
The recommended way to use this notebook is in Deepnote, which provides free environments and has a good UI.
- Click the button below to create a a copy of the project in Deepnote.
- Press the "Run notebook" button at the top (open
coefficients.ipynb
from the left menu if it does not open automatically).
A .devcontainer
is provided if you want to run this inside a container or
using GitHub Codespaces. This will automatically set up the environment with
Python 3.9. You can then open the coefficients.ipynb
file in VS Code and press
the Run all cells
button.
The notebook requires Python 3.9 and Jupyter (Lab or
Notebook). Install both of these for your platform
and then open coefficients.ipynb
.
- Copy the new lines from the full results table into the CSV.
- Ensure the "CPU Description" column is clean by following the instructions in the notebook.
- Run the notebook to calculate the new values.
- The final three sections of the notebook - Azure, AWS, GCP - explain where to place the values from the output tables.
Basic tests exist in-line. They can also be executed from the terminal:
nbdev_test_nbs
Git hooks from nbdev
are used to clean notebooks
before they're committed. This avoids committing all the metadata that changes
on each run. See the nbdev
Git hooks
docs for more details.
Cleaning the notebook before commit can be done with nbdev_clean_nbs
.
Installing the Git hooks using nbdev_install_git_hooks
will do this
automatically on commit.