Webhook icon
Schedule icon
Script icon
Loop icon
If icon
SlackIncomingWebhook icon
Log icon
Fail icon

Charge Idle GPU Nodes Back to the Teams That Own Them

Attribute idle GPU node hours to owning teams from posted utilization, alert each team on Slack, and fail the gate when idle cost is found.

Categories
Cloud

How it works

  1. on_utilization_publish (io.kestra.plugin.core.trigger.Webhook, keyed with the GPU_COST_WEBHOOK_KEY secret) receives the GPU node inventory from your utilization exporter. monthly_idle_attribution (io.kestra.plugin.core.trigger.Schedule, cron 0 6 1 * *) is the safety net and ships disabled: true until an operator turns it on.
  2. attribute_idle (io.kestra.plugin.scripts.python.Script on python:3.12-slim) prefers the posted inventory and falls back to a bundled five node example so trial runs still produce a report. A node is charged only when its utilization sits at or below idle_utilization_threshold_pct and it has been idle for at least min_idle_hours; charged GPU-hours are multiplied by gpu_hourly_rate_usd and rolled up per owning team. The idle node list, the fleet totals, the worst team and the full team table are printed as a single ::{"outputs": ...}:: line.
  3. review_teams (io.kestra.plugin.core.flow.Loop, concurrencyLimit: 1) walks the scored team rows one at a time. flag_team (io.kestra.plugin.core.flow.If) branches on the per team charged cost, so a team carrying idle hours gets its own alert_team (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) naming its nodes, hours and dollars, while a clean team lands on log_team_clean.
  4. escalate_idle (io.kestra.plugin.core.flow.If) branches on the fleet verdict. Any charged idle node reaches alert_fleet with the fleet totals and the worst team, then fail_attribution (io.kestra.plugin.core.execution.Fail) turns the run red. A fully consumed fleet lands on log_fleet_clean.
  5. The flow level errors handler (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) reports any failure with the execution id, because a dead scorer looks exactly like a clean fleet.

What you get

  • Per node idle verdicts that require both low utilization and a minimum idle duration, so scheduling gaps never page anyone.
  • GPU-hours and USD attributed per owning team, sorted worst first, ready for chargeback.
  • One focused Slack alert per team carrying idle cost plus a fleet escalation with the totals and the worst team.
  • idle_nodes, attributed_hours, attributed_cost_usd, team_attribution and worst_team as typed outputs for dashboards and billing follow-up.
  • A disabled monthly schedule as a second net once the webhook path is trusted.

Who it's for

  • FinOps engineers who need idle GPU capacity charged back with evidence instead of a flat allocation.
  • Platform teams running shared Kubernetes GPU nodes tagged with owner teams.
  • SREs who want idle capacity surfaced as a gate in the same pipeline as the rest of the platform checks.

Why orchestrate this with Kestra

Idle GPU inventory hides in exporter dashboards that nobody opens before the bill arrives. Kestra gives the exporter a webhook to land on, a scorer whose utilization and idle duration policy lives in version control, a Loop that names every owning team with its own numbers, a branch that separates escalation from the all clear, and outputs a chargeback report or ticket can consume. A cron Lambda can emit a CSV, but it has no alert routing, no execution history and no gate.

Prerequisites

  • A worker with Docker access, the scorer runs in python:3.12-slim.
  • A utilization exporter that POSTs GPU node inventory JSON with owner tags to the webhook, or rely on the bundled example fleet for trial runs.
  • A Slack incoming webhook for the per team alerts and for failure alerts.

Secrets

  • GPU_COST_WEBHOOK_KEY: key segment guarding the utilization webhook URL, anyone holding it can trigger an attribution run.
  • SLACK_WEBHOOK_URL: Slack incoming webhook for the per team alerts and failure alerts.

Quick start

  1. Add the two secrets to your Kestra namespace.
  2. Run the flow once with the default inputs and confirm idle_node_count reads 2, idle_nodes lists gpu-node-a100-01 and gpu-node-h100-03, attributed_hours reads 1344.0, attributed_cost_usd reads about 3225.6 and worst_team reads training-infra, and that the team and escalation Slack alerts arrived.
  3. Raise idle_utilization_threshold_pct to 0.1 and re-run to watch the same inventory pass as clean while the node counters stay identical.
  4. Point your exporter at /api/v1/{tenant}/executions/webhook/{namespace}/gpu-idle-cost-attribution/{GPU_COST_WEBHOOK_KEY} and enable monthly_idle_attribution once the path is trusted.

How to extend

  • Persist the team_attribution rows to a warehouse with io.kestra.plugin.jdbc.postgresql.Queries to chart idle cost trends per team across billing periods.
  • Add a second utilization column for MIG or partitioned GPUs so partial allocations are charged only for their free slices.
  • Fan out per region with io.kestra.plugin.core.flow.ForEachItem over a subflow that scores one region of the inventory each.
  • Push the charged dollars into a showback API with io.kestra.plugin.core.http.Request right after the escalation branch passes.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.