Green Software and Carbon Hack 2022
Tags: events
Published: 2023-02-27 11:19:12

---
title: Green Software and Carbon Hack 2022
published: true
date: 2023-02-23 11:53:20 UTC
tags: Events
canonical_url: https://apiumhub.com/tech-blog-barcelona/green-software-carbon-hack/
---

In November 2022, the Green Software Foundation organized its first hackathon, “Carbon Hack 2022,” with the aim of supporting software projects whose objective is to reduce carbon emissions. I participated in this hackathon with the Carbon Optimised Process Scheduler project along with my colleagues Kamlesh Kshirsagar and Mayur Andulkar, in which we developed an API to optimize job scheduling in order to reduce carbon emissions, and we won the “Most Insightful” project prize.

In this article, I will summarize the key concepts of “green software,” and explain how software engineers can help reduce carbon emissions. I will also talk about the Green Software Foundation hackathon, Carbon Hack, and its winners.

## What is “green software”?

According to this [research](https://www.mdpi.com/2071-1050/10/9/3027)by Malmodin and Lundén (2018), the global ICT sector is responsible for 1.4% of carbon emissions and 4% of electricity use. In another [article](https://www.sciencedirect.com/science/article/pii/S2666389921001884), it is estimated that the ICT sector’s emissions in 2020 were between 1.8% and 2.8% of global greenhouse gas emissions. Even though these estimates carry some uncertainty, they give a reasonable idea of the impact of the ICT sector.

[Green Software Foundation](https://greensoftware.foundation/) defines “green software” as a new field that combines climate science, hardware, software, electricity markets, and data center design to create carbon-efficient software that emits the least amount of carbon possible. Green software focuses on three crucial areas to do this: hardware efficiency, carbon awareness, and energy efficiency.

Green software practitioners should be aware of these six key points:

1. Carbon Efficiency: Emit the least amount of carbon
2. Energy Efficiency: Use the least amount of energy
3. Carbon Awareness: Aim to utilize “cleaner” sources of electricity when possible
4. Hardware Efficiency: Use the least amount of embodied carbon
5. Measurement: You can’t get better at something that you don’t measure
6. Climate Commitments: Understand the mechanism of carbon reduction

## What can we do as software engineers?

Fighting global warming and climate change involves all of us, and since we can do it by changing our code, we might start by reading [Ismael Velasco](https://ismaelvelasco.dev/)’s advice, an expert in this field. These principles are extracted from his [presentation](https://dev.to/leamsi9/green-software-and-hardware-obsolescence-16kl-temp-slug-280835) at the [Code For All Summit 2022](https://codeforall.org/):

1. Green By Default

- We should move our applications to a greener cloud provider or zone. 

This [article](https://phil.tech/2020/tech-climate/) collects three main cloud providers. **Google Cloud** has matched 100% of its electricity consumption with renewable energy purchases since 2017 and has recently committed to fully decarbonize its electricity supply by 2030. **Azure** has been 100% carbon-neutral since 2012, meaning they remove as much carbon each year as they emit, either by removing carbon or reducing carbon emissions. **AWS** purchases and retires environmental attributes like renewable energy credits and Guarantees of Origin to cover the non-renewable energy used in specific regions. Also, only a handful of their data centers have achieved carbon neutrality through offsets.

- Make sure the availability zone where your app is hosted is green

This can be checked on the website of the [Green Web Foundation](https://www.thegreenwebfoundation.org/).

- Transfers of data should be optional, minimal, and sent just once

Prevent pointless data transfers. Delete useless information (videos, special fonts, unused javascript, and CSS). Optimize media and minify assets. 

- Reduce page loads and data consumption with service workers’ focused caching solutions

- Make use of a content delivery network (CDN)

- You can handle all requests from servers that are currently using renewable energy thanks to Cloudfront 

- Reduce the number of HTTP requests and data exchanges in your API designs

- Track your app’s environmental impact

Start out quickly and simply, then gradually increase complexity.

2. Green Mode Design

- Users have the option to reduce functionality for less energy using the Green Mode design. Sound-only videos, Transcript-only audio 
- Cache-only web app
- Zero ads/trackers
- Images optional: click-to-view, Grayscale images

Green Mode is a way of designing software that prioritizes the extension of the device life and digital inclusion over graceful degradation. To achieve this, it suggests designing for maximum backward compatibility with operating systems and web APIs, as well as offering minimal versions of CSS.

3. Green Partnerships

We should ponder three questions_:_

- What knowledge are we lacking?
- What missing networks are there?
- What can we provide to partners?

## What is the Green Software Foundation? 

Accenture, GitHub, Microsoft, and ThoughtWorks [launched](https://blogs.microsoft.com/blog/2021/05/25/accenture-github-microsoft-and-thoughtworks-launch-the-green-software-foundation-with-the-linux-foundation-to-put-sustainability-at-the-core-of-software-engineering/) the Green Software Foundation with the Linux Foundation to put software engineering’s focus on sustainability. The [Green Software Foundation](https://greensoftware.foundation/) is a non-profit organization created under the Linux Foundation with the goal of creating a reliable ecosystem of individuals, standards, tools, and “green software best practices”. It [focuses](https://greensoftware.foundation/articles/what-is-green-software) on lowering the carbon emissions that software is responsible for and reducing the adverse effects of software on the environment. Moreover, it was established for those who work in the software industry and has the aim to provide them with information on what they may do to reduce the software emissions that their work in the software industry is responsible for.

## Carbon Hack 2022

[Carbon Hack 2022](https://greensoftware.foundation/articles/carbonhack22-a-big-leap-in-carbon-aware-computing) took place for the first time between October 13th and November 10th, 2022, and was supported by the GSF member organizations Accenture, Avanade, Intel, Thoughtworks, Globant, Goldman Sachs, UBS, BCG, and VMware. The aim of Carbon Hack was to create carbon-aware software projects using The GSF Carbon Aware SDK which has two parts, a Hosted API and a client library available for 40 languages. The hackathon had 395 participants and 51 qualified projects from all over the world.

Carbon-aware software refers to when an application is executed at different times or in regions where electricity is generated from greener sources – like wind and solar – as this can reduce its carbon footprint. When the electricity is clean, carbon-aware software works harder; when the electricity is dirty, it works less. By including carbon-aware features in an application, we can partially offset our carbon footprint and lower greenhouse gas emissions.

### Carbon Hack 2022 Winners

The total prize pool of $100,000 USD was divided between the first three winners and 4 category winners:

- First place – [**Lowcarb**](https://www.youtube.com/watch?v=N4z8XqcgZ7A&ab_channel=GreenSoftwareFoundation)

Lowcarb is a plugin that enables carbon-aware scheduling of training jobs on geographically distributed clients for the well-known federated learning framework [Flower](https://flower.dev/). The results of this plugin displayed 13% lower carbon emissions without any negative impacts.

- Second place – [**Carbon-Aware DNN Training with Zeus**](https://www.youtube.com/watch?v=iOy8Yg9C2z8&ab_channel=GreenSoftwareFoundation)

This energy optimization framework adjusts the power limit of the GPU and can be integrated into any DNN training job. The use case for Zeus showed a 24% reduction in carbon emissions and only a 3% decrease in learning time.

- Third place – [Circa](https://www.youtube.com/watch?v=U1T4_wA2KR8&ab_channel=GreenSoftwareFoundation)

Circa is a lightweight library – written in C – that can be installed from a release using a procedure of configuring and making install instructions. It chooses the most effective time to run a program within a predetermined window of time and also contains a simple scripting command that waits for the energy with the lowest carbon density over a specified period of time.

- Most Innovative – [Sustainable UI](https://www.youtube.com/watch?v=aKOKBu7stPI&ab_channel=GreenSoftwareFoundation)

A library that provides a set of base primitives for building carbon-aware UIs to any React application; in the future, the developers would like to offer versions for other popular frameworks as well. The developers predicted that Facebook’s monthly emissions would be reduced by 1,800 metric tons of gross CO2 emissions if they were to use SUI Headless by reducing a tenth of a gram of CO2e every visit while gradually degrading its user interface. This is comparable to the fuel used by 24 tanker trucks or the annual energy consumption of 350 houses.

- Most Polished – [GreenCourier](https://www.youtube.com/watch?v=wpjrnWCcQI8&ab_channel=GreenSoftwareFoundation) 

Scheduling plugin implemented for Kubernetes. To deploy carbon-aware scheduling across geographically connected Kubernetes clusters, the authors developed a scheduling policy based on marginal carbon emission statistics obtained from the Carbon-aware SDK.

- Most Insightful – [Carbon Optimised Process Scheduler](https://www.youtube.com/watch?v=pF-g7VJ1h94&ab_channel=GreenSoftwareFoundation)

Disclosure: This was my Carbon Hack team! In order to reduce carbon emissions, we developed an API service with a UI application that optimizes job scheduling. The problem was modeled using mixed-integer linear programming and solved using Open Source Solver.

If it were possible to optimize hundreds of high-energy industrial processes, carbon emissions could be reduced by up to 2 million tons per year.

An example scenario from the IT sector demonstrates how moving work by just three hours can reduce CO2 emissions by almost 18.5%. This results in a savings of roughly 300 thousand tons of CO2 per year when applied to a million IT processes.

- Most Actionable – [HEDGE.earth](https://www.youtube.com/watch?v=rXqkTkR0kyI&ab_channel=GreenSoftwareFoundation)

83% of the carbon emissions on the web come from API requests. This team developed a reverse proxy – an application that sits in front of back-end applications and forwards client requests to those apps – to maximize the amount of clean energy needed to complete API requests (also accessible in [NPM](https://github.com/rollthecloudinc/emissionless/pkgs/npm/hedge)).

Take a look at all the projects from Carbon Hack 2022 [here.](https://www.youtube.com/watch?v=rXqkTkR0kyI&list=PLPDOrOxOHQcOgfBDBWFo2-FF4L2cZsznX&ab_channel=GreenSoftwareFoundation)

## Conclusion

The collective effort and cross-disciplinary cooperation across industries and within engineering are really important to achieve global climate goals, and we can start with these two courses that the [Linux Foundation](https://trainingportal.linuxfoundation.org/learn/course/green-software-for-practitioners-lfc131/introduction/welcome-to-lfc131) and [Microsoft](https://learn.microsoft.com/en-us/training/modules/sustainable-software-engineering-overview/1-introduction) offer regarding green software and sustainable software engineering. Also, we can begin debating with our colleagues how to lower the carbon emissions produced by our applications. In addition, we could follow the people on their social media accounts who have knowledge on this topic; I would recommend the articles of [Ismael Velasco](https://ismaelvelasco.dev/) to start.

Regarding this [article](https://www.zartis.com/what-is-green-software-and-business-benefits/), if we achieve to write our codes greener, our software projects will be more robust, reliable, faster, and brand resilient. Sustainable software applications will not only help to reduce our carbon footprint with our applications but will also help to sustain our applications with fewer dependencies, better performance, low-resource usage, cost savings, and energy-efficient features. 

If you are interested in participating in these kinds of initiatives or in attending tech events, you can keep an eye on [Apiumhub’s calendar](https://apiumhub.com/event-calendar/). New events are added every week.