Green DevOps: Sustainable way of doing DevOps

Tajinder Singh
4 min readMar 20, 2023

--

This is a 3 part series where I will be focusing and writing about doing Green DevOps.An approach to do more sustainable DevOps. The series will cover the following topics:

  • Part 1: Carbon Aware DevOps: High-level overview of how you can reduce your DevOps’s carbon footprint.
  • Part 2: Running GitHub Actions pipelines with carbon-aware computing on Azure: How you can leverage Azure's carbon-aware computing ecosystem to run GitHub Action’s self-hosted runners.
  • Part 3: Carbon Aware Vs Carbon Efficient DevOps: Being carbon aware is one part of the story but is your DevOps carbon efficient?

Carbon-Aware DevOps:

What’s Carbon-Aware Computing: Carbon-aware computing involves shifting compute to times and places where the carbon intensity of the grid results in lower carbon emissions.

When I search the web, there is no specific definition of Green DevOps.I would define Green DevOps as “DevOps practices designed and implemented to have lower carbon emissions.”

When we talk about DevOps, we talk about continuous processes. Continuous integration and continuous deployment are at the core. These continuous processes and practices consume a lot of resources and impact on your operation’s carbon footprint.

Here are a few steps that you can take toward carbon-aware DevOps:

Cost Optimization By Reducing And Optimizing Runs:

Enterprises are running pipelines left, right, and center. Most of what I have seen, they have been configured to run on every push. For some pipelines, it might make sense to run on every push but not for all.

In some scenarios, it doesn't even make to run a pipeline.

Reduce pipeline runs: Let’s take an example, a developer edited documentation in a read-me file in a repository. This change will trigger a pipeline run that will build the whole application, run units, etc. That was totally not required. Have filters in place and only run pipelines where it makes sense.

Reduce the number of jobs: This scenario is very specific to GitHub Actions pipeline. Every job mentioned in GitHub Actions runs on a dedicated runner ( Linux, Windows, or Mac virtual machine ). When the job begins, GitHub automatically provisions a new VM for that job. All steps in the job execute on the VM. If you can reduce the number of jobs ( runners ), you will reduce the cost of the run along with reducing the carbon footprint.

So first step in doing carbon-aware DevOps is optimizing pipeline runs and reducing them. Not only, it will reduce your DevOps cost, it will reduce your carbon footprint. Save some dollars and Save the planet.

Use Carbon-Aware Computing For Self-Hosted Runners:

While using a public cloud can amplify the problem, it can also be a part of the solution to reducing your carbon footprint. When you create self-hosted pipeline runners on a public cloud, try to use a public cloud that’s using carbon-aware computing.

Businesses can now leverage carbon-aware computing as an innovative and viable option to reduce the carbon emissions created by their software. On Jan 10th 2023, Microsoft released a white paper on carbon-aware computing in collaboration with UBS.

Make use of this offering from Microsoft Azure to host your self-hosted runners which would reduce the DevOps pipeline run’s carbon footprint.

Use And Contribute To Open Source Initiatives:

There is a lot happening in this space and most of the initiatives are open-source. Below are a few tools that will help you get started and provide some insight into carbon-aware computing.

  • The Green Software Foundation (GSF) is a cross-industry consortium that is building a trusted ecosystem of people, standards, tooling, and best practices for Green Software.
  • Microsoft’s white paper on carbon-aware computing.
  • Software Carbon Intensity (SCI) measures the carbon impact of software systems.
  • Open-sourced software development kit carbon-aware-sdk which allows software to run when and where energy is cleaner. The combination of both open-sourced projects empowers every person and every organization on the planet to decarbonize their software.

What’s Next

In the next post, I will cover how you can leverage Azure’s carbon-aware computing ecosystem to run GitHub Action’s self-hosted runners. Stay tuned :)

About Me

My Name is Tajinder Singh, most of my friends and colleagues call me TJ. Currently, I am working at GitHub as a Solutions Engineer based in the beautiful city of Zurich, Switzerland.

Linkedin Profile: https://www.linkedin.com/in/tajinder-singh-74740115b/

Note: Opinions are my own and not the views of my employer

--

--