Carbon Aware Computing

Execute computing tasks when the grid is powered by renewable energy.

time-shifting shape shape

Provide developers with hassle free, easy to use, ready to run tools for Carbon Aware Computing

Get tools to forecast the best execution time for tasks to minimize carbon emissions or use the Grid Carbon Intensity to calculate the Carbon Emissions of your digital services. All libraries and data are open source & open data with unrestricted usage within personal, open source and commercial software.

Time Shifting, Demand Shifting, Carbon Intensity

The basic idea behind the time shifting approach is moving the computing load into a point in time when the power grid has a maximum of renewable energy. This will result in a lower emission of CO2 of your computing task.

In addition to energy and hardware efficiency, carbon efficiency is one of the most important principles of green software development, like the Energiewende. Energy is used when it is available from renewables. We shift the energy demand to a point in time when the carbon intensity of the grid is lower. To do this we need forecast data and some libs to calculate the appropriate execution window. The carbon intensity is also used to calculate the carbon emissions based on electric power

about-image
shape

Libraries & services

A set of packages for .NET, public execution forecast & carbon intensity Web-API, Prometheus metrics and k8s configmap exporter and access to the actual & forecast json formatted data files.

For more details, download and usage check the GitHub Repository.

This project delivers a set of libraries, services and data. They are mostly extensions to other projects and all credits belong to them. To forecast the best execution time the Carbon Aware SDK from the Green Software Foundation is used; the forecast data is from Energy Charts provided by Frauenhofer ISE.

Use the NuGet-Package for your .NET project to get the optimal execution time for a task, in a given time slot, for a estimated duration. The lib will calculate the best execution time within the provided forecast data.


Install-Package CarbonAwareComputing
                      


var provider = new CarbonAwareDataProviderOpenData();
var forecast = provider.CalculateBestExecutionTime(
    ComputingLocations.Germany,
    DateTimeOffset.Now,
    DateTimeOffset.Now + TimeSpan.FromHours(8),
    TimeSpan.FromMinutes(20)
);
var executionTime = forecast.Match(
    noForecast =>
    {
        Console.WriteLine("No forecast. Use fallback");
        return DateTimeOffset.Now;
    },
    bestExecutionTime =>
    {
        return bestExecutionTime.ExecutionTime;
    });
                      

We provide a live and ready to use subset of the Carbon Aware SDK. The API is available at https://forecast.carbon-aware-computing.com/. Use the Swagger UI to play around with the API.


To use the API, you must register to the service by submitting a valid email address. This registration is also suitable for the intensity API. Please check the register endpoint in the Swagger UI. The API-Key is sent to this email.


We will use this address only to inform you about important changes to the service.


For more details check the GitHub Repository.

Use a PowerShell Cmdlet in automation scripts to forecast the beste execution time.

The module is available from PowerShell Gallery.


Install-Module -Name CarbonAwareComputing
                    
See the GitHub Repository for more details.

Get the grid carbon intensity as Prometheus metrics. See the GitHub Repository for more details.

To support the Carbon Aware KEDA Operator a compatible data exporter is provided. The data is used to adjust the scaling of k8s nodes based on the carbon intensity to implement Demand Shaping.

See the GitHub Repository for more details.

Use the NuGet-Package for your .NET project to get the actual grid carbon intensity for a given location.


Install-Package CarbonAwareComputing
                      


var intensity = provider.GetCarbonIntensity(
    ComputingLocations.Germany,
    DateTimeOffset.Now);
intensity.Match(
    emissionData =>
    {
        Console.WriteLine($"Current grid carbon intensity: {emissionData.Value}");
    },
    _ =>
    {
        Console.WriteLine($"Data not available);
    });                      
                      

We provide a live and ready to use API to get the actual grid carbon intensity for a given location. The API is available at https://intensity.carbon-aware-computing.com/. Use the Swagger UI to play around with the API.


To use the API, you must register to the service by submitting a valid email address. This registration is also suitable for the forecast API. Please check the register endpoint in the Swagger UI. The API-Key is sent to this email.


We will use this address only to inform you about important changes to the service.


For more details check the GitHub Repository.

Hangfire is one of the most used tools for background processing in .NET. Use the Hangfire.Community.CarbonAwareExecution Extension to enqueue and schedule your jobs.


Install-Package Hangfire.Community.CarbonAwareExecution
                      


builder.Services.AddHangfireCarbonAwareExecution(configuration => configuration.
UseCarbonAwareDataProvider(
    new CarbonAwareDataProviderOpenData(), 
    ComputingLocations.Germany));                    
                      

We have fork the Carbon Aware SDK and provide the SDK as a NuGet-Package. The fork has also some additions for cached data provider. You may use this package for your extensions.


The unofficial Carbon Aware SDK is available from nuget.org.


Install-Package GSF.CarbonAware.Unofficial
                    
about-image

Open Data

The forecast and actual data for Europe (without UK) is gathered from Energy Charts provided by Frauenhofer ISE. It is licensed as CC0. You may use it for any purpose without any credits.

The forecast and actual data for United Kingdom is gathered from UK National Grid ESO. It is licensed as CC BY 4.0 DEED. See terms of usage

The forecast and actual data is available as json formatted files, separated for every single location. The files are directly consumable by the Carbon Aware SDK. For more details and download instructions check the GitHub Repository.

The forecast and actual data for Europe (without UK) is based on reported energy production (current) and forecast production for Wind (on-shore & off-shore) and Solar. There are publicly available from the ENTSO-E Transparency Platform maintained by the power grid Transmission System Operators (TSO). For the additional renewable energy sources like running water or biomass, the forecast is calculated as an interpolation of the last hours.

We support all European countries. To avoid unnecessary computation, not all are active. Currently we provide data for Germany, France, Austria, Switzerland and the United Kingdom. If you have a need for some other countries, please contact us. We will activate that country.

Contribution

Every contribution is warmly welcomed.


You may contribute to forecast and actual data for other regions than Europe or help to integrate time shifting in other popular processing systems and libraries. Migration to other programming languages and runtime systems is very efficacious as well. Please drop a message to am@bluehands.de to get in touch.

Love to hear from you
Let’s talk about Green Software Development

Aydin Mir Mohammadi

am@bluehands.de

+49 721 1610874

Sponsorship

This project is founded, supported and maintained by bluehands.

Other companies & NGOs are welcomed.