|
1 |
| -## Automated SCI Measurements with Green Metrics Tool |
| 1 | +# Simple and automated SCI measurements |
2 | 2 |
|
3 |
| -### Teaser |
4 |
| -The Green Metrics Tool is a free, open-source software that offers an initial implementation for automatically generating the SCI metric. |
| 3 | +## Executive Summary |
| 4 | +The Green Metrics Tool (GMT) is an open-source software solution that provides the capabilities of automating the process |
| 5 | +of generating an SCI metric for a given piece of software. |
5 | 6 |
|
6 |
| -### Summary |
7 |
| -The Green Metrics Tool (GMT) is an open-source software solution designed to automate the generation of the Software Carbon Intensity (SCI) metric for a given software. It acts as a container native benchmarking tool, simulating typical software interactions and measuring parameters such as machine energy, CPU energy, and network traffic. In other words, the GMT mimics the software and inspects how much electricity the computer uses, how hard the processor (CPU) is working, and how much data is being sent over the internet. |
| 7 | +The GMT is essentially a container native benchmarking tool that instruments a software according to a so called *usage scenario*. |
| 8 | +Which describes the usual interaction with the software in an computer executable fashion. |
| 9 | +While executing this scenario different measurement sources are polled like machine energy, cpu energy, network traffic etc. and then put into context with a unit of work. |
8 | 10 |
|
9 |
| -By supplying specific input variables and instrumenting the software to output a unit of work variable, the GMT automatically calculates the SCI metric. Teams can integrate this instrumentation into a standard DevOps infrastructure as code, such as Docker compose files, and into a Git repository, enabling businesses to easily include carbon footprint assessments in their software development processes. |
| 11 | +When supplying the basic input variables to the SCI like (I, EL, RS, TE) and instrumenting the software so that it outputs the unit of work variable (R) to a standard output stream the tool automatically generates the SCI metric. |
10 | 12 |
|
11 |
| -### Limitations of the SCI as a starting point |
12 |
| -When evaluating software energy efficiency, comparing the work with the total energy cost is common. The SCI takes this a step further by considering embodied carbon and current carbon grid intensity. Unfortunately, the SCI currently lacks a reference implementation in open-source software, making it challenging to derive, reproduce, and validate. Additionally, there's no straightforward way to continuously track the SCI without automation. |
| 13 | +All of this instrumentation is fixated in a typical DevOps like standard infrastructure as code (for instance Docker compose files) and can be part of the git repository. |
| 14 | +Thus, businesses can seamlessly integrate carbon footprint assessments into their software development pipelines, fostering a culture of sustainability. |
13 | 15 |
|
14 |
| -### An automated benchmarking approach |
15 |
| -The solution to the problem involves using an automated benchmarking approach, which simplifies and helps to replicate the SCI metric consistently. The Green Metrics Tool is a free, open-source software that offers an initial implementation for automatically generating the SCI metric. |
| 16 | +## Description of problem |
16 | 17 |
|
17 |
| -The tool provides the necessary software for local measurement setups. It offers reference hardware for running measurements with specialized hardware and software at no cost. To use the GMT, start with a Git repository and add a simple, well-documented usage scenario file. Submit the repository to the GMT cluster for automatic benchmarking. Users can run benchmarks at specified intervals, enabling detailed tracking of the software's energy efficiency over time. Any changes to the software get reflected immediately in the published SCI score. |
| 18 | +When talking about the energy efficiency of a software it is a common approach to look at the work done and also at the total energy cost and put these metrics in relation to one another. The SCI goes one step further and also adds the embodied carbon as well as the current carbon grid intensity. However so far the SCI has to be manually derived and there is no reference implementation in an open source software |
| 19 | +that showcases the process and also makes it reproducible. This makes the SCI less approachable and also harder to replicate and validate. |
| 20 | +There is also no way to easily track SCI over time with a fine resolution as the measurement can not be automatically made. |
18 | 21 |
|
19 |
| -### Wagtail - sample case |
| 22 | +## The solution / How the use case solves the problem |
20 | 23 |
|
21 |
| -Wagtail is a popular open-source CMS based on Django, which comes with a detailed reference implementation: The Bakery. In a clone of the repository, we added the needed instrumentation files and defined the required SCI variables. To make it reproducible, we used the freely usable machines in the GMT measurement cluster and their respective lifetime and embodied carbon values. |
| 24 | +By using an automated benchmark approach the process of generating the SCI metric is not only easier, but also reproducible. |
| 25 | +When the to be benchmarked software also is open source it additionally allows for the possbilty to validate the metrics by the open source community. |
22 | 26 |
|
23 |
| -As the unit of work in Wagtail, we defined R as the per-page visited since, as a CMS, its primary use is offering a framework that creates websites mainly visited by a browser. The SCI value we are calculating here, as an example, is the carbon cost per webpage viewed. The SCI score here is ~0.02 gCO2e/page request. |
| 27 | +As a free and open-source software (FOSS) the Green Metrics Tool presents a first approach to an implementation of automatically and reproducible generating the SCI metric. |
24 | 28 |
|
25 |
| -### Exemplary SCI values for Wagtail page visits |
| 29 | +The tool not only provides all the software to set up a measurement locally, but also a [reference hardware](https://docs.green-coding.berlin/docs/installation/installation-cluster/) where |
| 30 | +measurements can be [run for free](https://metrics.green-coding.berlin/request.html) with specialized measurement hardware and software. |
| 31 | +This allows everyone to trace back claims and also generates better results as it is not feasible for an individual or small company to invest in a dedicated measurement cluster, when just starting with green software practices. |
26 | 32 |
|
27 |
| - |
| 33 | +Starting with a *git* repository the software needs a simple *usage scenario* file which is |
| 34 | +[extensively documented](https://docs.green-coding.berlin) and also [many example implementations](https://github.com/green-coding-berlin/example-applications) are provided. Once the *usage scenario* file has been added the repo can be submitted the the GMT cluster and will automatically benchmarked. It is also possible to run the benchmark on every commit or in any other timely matter. This enables a detailed tracking of the software over time. Also changes on the software are reflected right away in the SCI score published. |
28 | 35 |
|
29 |
| -Case link: https://metrics.green-coding.berlin/stats.html?id=6e4936e0-2a78-4f5b-afe2-1299ed37a964 |
| 36 | +### Example case - Wagtail |
30 | 37 |
|
31 |
| -### Nextcloud Talk - sample case |
32 |
| -Nextcloud is a well-known open-source software that enables users to create a self-hosted platform similar to Google Workspaces. In this case, we employed standard Nextcloud Docker images to initiate a Talk session involving multiple users. We executed the scenario using Chrome browsers in headless mode. Once again, we utilized a machine from the freely available GMT measurement cluster to ensure reproducibility, along with associated lifetime and embodied carbon values. |
33 |
| -The specific SCI calculated here is the carbon cost per Talk message, which resulted in 0.15 grams of CO2 equivalent per Talk message. |
| 38 | +Wagtail is a popular open-source CMS based on Django which comes with a detailed reference implementation: *The Bakery*. |
34 | 39 |
|
35 |
| -### Exemplary SCI values for Nextcloud Talk |
| 40 | +In a clone of the repository we added the needed instrumentation files and defined the needed SCI variables. |
36 | 41 |
|
37 |
| - |
| 42 | +To make it reproducible we used the machines that are freely usable in the [Green Metrics Tool measurement cluster](https://docs.green-coding.berlin/docs/installation/installation-cluster/) |
| 43 | +and their respective lifetime and embodied carbon values. |
38 | 44 |
|
39 |
| -Case link: https://metrics.green-coding.berlin/stats.html?id=84645f34-2195-43e2-8c61-dcb3afe37120 |
| 45 | +As the unit of work in Wagtail we defined R as the *per page visited*, since it is a CMS and one of it's main use cases |
| 46 | +is offering a framework that creates websites that are mainly visited by a browser. |
40 | 47 |
|
41 |
| -### The broad applicability of the tool |
| 48 | +The SCI value we are calculating here, as an example, is the cost *webpage viewed*. The SCI here is **0.02 gCO2e/page request** |
| 49 | + |
| 50 | +Example case link: https://metrics.green-coding.berlin/stats.html?id=6e4936e0-2a78-4f5b-afe2-1299ed37a964 |
| 51 | + |
| 52 | +<figure> |
| 53 | +<img width="1434" alt="Screenshot 2023-09-11 at 2 01 45 PM" src="https://github.com/Green-Software-Foundation/sci-guide/assets/250671/c5360e10-5e2f-41b4-8190-7bedf9e45292"> |
| 54 | +<figcaption>Exemplary SCI values for Wagtail page visits</figcaption> |
| 55 | +</figure> |
| 56 | + |
| 57 | +### Example case - Nextcloud Talk |
| 58 | + |
| 59 | +Nextcloud is another very prominent open source software that allows to set up a Google Workspaces like platform on ones own infrastructure. |
| 60 | + |
| 61 | +Here we used the standard Nextcloud docker images and then initiated a Talk session betwen multiple users. The scenario is run with Chrome browsers running in headless mode. |
| 62 | + |
| 63 | +Also, to make it reproducible, we used one of the machines that are freely usable in the [Green Metrics Tool measurement cluster](https://docs.green-coding.berlin/docs/installation/installation-cluster/) |
| 64 | +and their respective lifetime and embodied carbon values. |
| 65 | + |
| 66 | +The SCI value we are calculating here as an example is the cost *per Talk message*. The SCI here is **0.15 gCO2e/Talk Message** |
| 67 | + |
| 68 | +Example case link: https://metrics.green-coding.berlin/stats.html?id=84645f34-2195-43e2-8c61-dcb3afe37120 |
| 69 | + |
| 70 | +<figure> |
| 71 | +<img width="1197" alt="Screenshot 2023-09-11 at 12 24 23 PM" src="https://github.com/Green-Software-Foundation/sci-guide/assets/250671/6da3b17f-a885-4d7e-b575-358ade8ea886"> |
| 72 | +<figcaption>Exemplary SCI values for Nextcloud Talk</figcaption> |
| 73 | +</figure> |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | +### Further example cases |
| 78 | + |
| 79 | +We have started benchmarking various open source projects. With the aim to see how the SCI developes over time and how design decisions affect the benchmark. Also it illustrates how simple it is to add the the SCI to a piece of software. The idea to monitor various projects is called [Energy ID](https://www.green-coding.berlin/projects/energy-id/) |
| 80 | + |
| 81 | +At the moment this includes: |
| 82 | + |
| 83 | +- Wagtail |
| 84 | +- Wordpress |
| 85 | +- Django |
| 86 | +- Nextcloud |
| 87 | + |
| 88 | +However, we also have other example projects to highlight the broad applicability |
42 | 89 |
|
43 |
| -We have started to benchmark various open-source projects, aiming to track the development of the SCI over time and evaluate how design decisions impact these benchmarks. The effort also demonstrates the ease of integrating SCI into software. The monitored applications include Wagtail, WordPress, Django, and Nextcloud. You can find those projects here. |
44 |
| -Other projects that demonstrate the broad applicability of the tool: |
45 | 90 | - [Algorithmic / AI workloads](https://github.com/green-coding-berlin/example-applications/tree/main/green-software-foundation-sci/static-algorithm)
|
46 | 91 | - [APIs](https://github.com/green-coding-berlin/example-applications/tree/main/green-software-foundation-sci/simple-api)
|
47 | 92 | - [Idle scenarios](https://github.com/green-coding-berlin/example-applications/tree/main/green-software-foundation-sci/idle)
|
48 | 93 |
|
49 |
| -It's important to note that energy consumption is not a static metric but a dynamic one. With a timeline of the software's development, create badges to display how the software performs based on resource usage to elevate the SCI metric's significance in the deployment process. |
| 94 | +It's crucial to understand that energy consumption isn't a static metric but a dynamic one. As we now have a timeline over the development of the software we can create badges that showcase how the software performs in relation to resource usage. Thus hopefully making the metric a first class citizen in deployment. |
| 95 | + |
| 96 | +<figure> |
| 97 | +<img width="1195" alt="Screenshot 2023-09-19 at 12 07 21 PM" src="https://github.com/Green-Software-Foundation/sci-guide/assets/250671/41cd04dc-9b3e-42b0-810d-4e04d5f02d5b"> |
| 98 | +<figcaption>Looking at the SCI over time</figcaption> |
| 99 | +</figure> |
| 100 | + |
| 101 | +## Why should you use automation to generate your SCI metric? |
| 102 | + |
| 103 | +In today's rapidly evolving tech landscape, the need for sustainable, energy-efficient solutions has never been more pressing. |
50 | 104 |
|
51 |
| -### Why use automation to generate the SCI metric? |
52 |
| -In today's rapidly evolving tech landscape, the need for sustainable, energy-efficient solutions has never been more pressing. The SCI provides an easily digestible metric to get a first glimpse at your application’s energy and carbon profile. We can democratize access to this vital metric using open-source tools, allowing a wider community of developers, researchers, and institutions to leverage it. |
| 105 | +The SCI provides an easily digestible metric to get a first glimpse at the energy and carbon profile of your application. |
53 | 106 |
|
54 |
| -The power of automation cannot be understated. With manual processes often proving cumbersome and error-prone, our software streamlines the process by automatically generating the SCI metric, which saves valuable time and ensures precision and consistency. |
| 107 | +By levering open-source tools this democratizes access to this vital metric, allowing a wider community of developers, researchers, and institutions to leverage it. |
55 | 108 |
|
56 |
| -Did you know you can submit your own use case to the GSF? [Here is how to get started.](https://github.com/Green-Software-Foundation/sci-guide/issues/new?assignees=atg-abhishek%2C+Henry-WattTime%2C+navveenb%2C+srini1978&labels=Case-study+submissions&template=case-study-template.md&title=Case-study+submissions) |
| 109 | +The power of automation cannot be understated. With manual processes often proving cumbersome and error-prone, our software streamlines the process by automatically generating the SCI metric. This not only saves valuable time but also ensures precision and consistency. |
0 commit comments