DeployView All articles
Release Engineering

The Grid Is a Release Signal Too: Timing Non-Urgent Deploys Around UK Carbon Intensity

DeployView
The Grid Is a Release Signal Too: Timing Non-Urgent Deploys Around UK Carbon Intensity

Most release pipelines have a favourite hour. It is usually somewhere after midnight, when the office is quiet, the Slack channel is empty and nobody is around to ask awkward questions. The assumption is that overnight equals low impact. On the UK grid, that assumption is only half true. The mix changes half-hour by half-hour, and the cleanest window is not always the one your cron job picked in 2019.

Carbon intensity — the grams of CO2e per kilowatt-hour of electricity — is now a forecastable signal. National Grid ESO publishes half-hourly forecasts through the Carbon Intensity API, including regional breakdowns. That gives release engineers something genuinely useful: a way to schedule the work that does not need to happen right now against the periods when the grid is cleanest. Not as a badge, not as a sustainability report footnote, but as a pipeline input.

Not everything deserves a green window

The first mistake is treating carbon-aware scheduling as a blanket policy. It is not. Customer-facing deploys, security patches and anything with an SLA hanging off it should ship when the business needs it, full stop. Shifting a payment journey release to 2am because the wind picked up in the North Sea is not clever; it is a risk trade you did not need to make.

The work that fits is the non-urgent stuff. Nightly dependency scans. Static site rebuilds. Observability backfills and data reprocessing. Non-production environment refreshes. Batch jobs that recalculate dashboards or reindex logs. Model retraining for internal tooling. The kind of work that can land anywhere in a twelve-hour window without anyone noticing, but which still adds up across a fleet of CI runners.

That is where the saving lives — not in the deploy that customers see, but in the background hum of pipelines that run whether anyone is watching or not.

Wiring the forecast into the gate

The Carbon Intensity API is straightforward. You can request current intensity, a forecast for the next 48 hours, or regional figures. The practical pattern is to poll the forecast once, cache it, and use it as a gate rather than querying it on every job.

A workable setup looks like this. Tag pipeline jobs with a carbon-flexible: true label. When a flexible job is queued, the scheduler checks the forecast for the next window and picks the lowest-intensity half-hour that still fits the job's deadline. If the forecast is unavailable, fall back to the existing schedule rather than blocking. A missing API should never be the reason a build does not run.

Set a carbon budget per job type, not a global one. A ten-minute lint job and a two-hour backfill should not share the same threshold. And keep the logic visible. If the gate makes a decision, log it. Future you will want to know why the nightly rebuild ran at 4:30am on a Tuesday.

There is tooling that helps — the Carbon Aware SDK, Kepler for Kubernetes workloads, Cloud Carbon Footprint for cloud spend — but you do not need a platform team to start. A scheduled Lambda and a queue label will get you a long way.

Proving it worked in telemetry

A carbon-aware pipeline that nobody measures is just a cron job with extra steps. You need to record the signal alongside the run.

The bare minimum is three attributes per pipeline execution: the forecast carbon intensity at start, the intensity at finish, and the region the runner ran in. From those you can calculate an estimated gCO2e for the job. Add the baseline — what the job would have emitted on its old fixed schedule — and you have a comparison that survives scrutiny.

Push those attributes into your existing observability stack. If you are using OpenTelemetry, custom span attributes are the natural home. If you are on a hosted CI provider, export the run metadata to your metrics backend and join it to your deployment events. Dashboards should show carbon per pipeline, carbon per team and the percentage of flexible jobs that actually shifted. A monthly line chart of estimated savings is nice; a per-job table that shows which workloads are consistently landing in dirty windows is more useful.

Be honest about the numbers. Estimates from intensity averages are exactly that. They are good enough for trend lines and prioritisation, not for audited carbon accounting. Say so in the dashboard subtitle.

Where it collides with UK working life

Carbon-aware scheduling runs into the same wall as every other optimisation: the business does not care about your half-hourly forecast. It cares about the change freeze before month-end, the on-call rota that already looks thin in the second week of December, and the support team who need a release out before the Tuesday morning stand-up.

There are also practical conflicts. Shifting a batch job into the early hours can collide with backup windows or database maintenance. Moving a non-production refresh into the working day can slow down developers who need a stable environment. And regional carbon intensity varies — a runner in Scotland may see a very different picture from one in the South East — so a single national threshold can be misleading.

The answer is not to force it. Treat carbon intensity as one input among several, and let teams opt in job by job. If a flexible job cannot find a clean window before its deadline, run it anyway and record why. A pipeline that misses a deadline to save a few hundred grams of CO2e is not a win.

A realistic starting point

Pick one non-urgent job. A nightly observability backfill is a good candidate — it is predictable, it has a flexible deadline and it runs often enough to generate data. Wire in the forecast, add the telemetry attributes and run it for a month. Compare the estimated emissions against the old schedule. Then decide whether to expand.

The grid is not a moral authority and it is not a release blocker. But it is a signal, and it is one your pipeline can read. For the work that does not need to ship at 2am, that is worth paying attention to.

All Articles

Related Articles

Your Checkout Has Never Met a BFPO Address

Your Checkout Has Never Met a BFPO Address

Shared IPs, Split Signals: Testing Canary Releases Against UK Mobile Reality

Shared IPs, Split Signals: Testing Canary Releases Against UK Mobile Reality

Payday, Half-Term and the 3pm Kick-Off: The UK Dates Missing From Your Deploy Plan

Payday, Half-Term and the 3pm Kick-Off: The UK Dates Missing From Your Deploy Plan