我们通过选择代码运行的位置,将持续集成(CI)排放减少了多达90%。

4 分•作者: drydenwilliams•超过 1 年前•原帖
我们一直在尝试在多云环境中运行CI/CD作业,涵盖AWS、Azure和GCP,但有一个特别之处:每个作业都会被路由到当时碳排放最低的区域(同时考虑延迟、性能和服务提供商偏好等因素)。 不同云区域之间的碳排放差异令人惊讶。有些区域使用水电、核能或风能,而其他区域仍然依赖煤炭或天然气。通过根据碳强度选择代码运行的位置,我们在每个作业的排放量上看到了高达90%的减少,而无需改变应用逻辑或基础设施。此外,成本也降低了25%。 例如: 我们一直在跟踪GitHub Actions和Azure(当区域未指定时)运行作业的平均电网强度,发现其平均约为285克二氧化碳每千瓦时(gCO₂/kWh)。相比之下,当我们设定一个100 gCO₂/kWh的硬性上限时,我们的作业平均仅为48 gCO₂/kWh,有些甚至低至24 gCO₂/kWh。 看到区域调度能带来如此大的差异令人震惊,尤其是在CI/CD这样的场景中,延迟通常不是主要问题。 这让我们思考: - 开发者是否应该关注这一点,还是平台应该将其抽象化? - 在性能、碳排放和成本之间,正确的权衡是什么? 如果这里有其他人正在探索碳意识基础设施、云可持续性或多云调度,我们开发了一个名为CarbonRunner的工具来自动化这个过程。它实时获取电网强度数据,并应用加权逻辑为每个作业选择最佳区域,跨不同提供商进行调度。我们非常希望听到你们的见解或想法。
查看原文
We’ve been experimenting with running CI&#x2F;CD jobs multi-cloud, across AWS, Azure, and GCP — but with a twist: each job gets routed to the lowest-carbon region available at the time (among other weightings like latency, performance, and provider preferences).<p>There’s a surprising amount of variability between cloud regions. Some run on hydro, nuclear, or wind — others are still coal- or gas-heavy. By choosing where code runs based on carbon intensity, we’ve seen up to 90% reduction in emissions per job, without changing app logic or infrastructure. Also 25% cheaper too.<p>For example:<p>We’ve been tracking the average grid intensity of jobs run by GitHub Actions and Azure (when region is unspecified), and we’ve seen an average of ~285 gCO₂&#x2F;kWh.By contrast, when we set a hard limit of 100 gCO₂&#x2F;kWh max, our jobs averaged just 48 gCO₂&#x2F;kWh — with some running as low as 24 gCO₂&#x2F;kWh.<p>It’s been eye-opening to see how much of a difference regional scheduling can make — especially for something like CI&#x2F;CD, where latency is often a lesser concern.<p>It’s made us wonder:<p>- Should developers be thinking about this, or should platforms abstract it away? - Where’s the right tradeoff between performance, carbon, and cost?<p>If anyone else here is exploring carbon-aware infra, cloud sustainability, or multi-cloud scheduling<p>We built this into tool called CarbonRunner that automates this process. It pulls live grid intensity data and applies weighted logic to select the best region for each job across providers — would love to hear what you&#x27;re seeing or thinking about.