ExAtlas.Orchestrator.Reaper (ExAtlas v0.5.0)

Copy Markdown View Source

Periodic reconciliation GenServer.

On each tick, the Reaper:

  1. Asks each tracked provider for its list of live resources.
  2. Compares against the ComputeServer processes in the Registry.
  3. Flags any resource that exists at the provider but has no local tracker (symptom of a node restart after a crash) and calls ExAtlas.terminate/2 to reclaim the runaway spend.

Configuration:

config :ex_atlas, :orchestrator,
  reap_interval_ms: 60_000,
  reap_providers: [:runpod],
  reap_name_prefix: "atlas-"

The :reap_name_prefix is a safety switch — the Reaper only terminates resources whose :name starts with the configured prefix, so it never touches pods spawned by other tools on the same RunPod account. Set it to "" to disable the safeguard.

Summary

Functions

Returns a specification to start this module under a supervisor.

Run a single reap cycle. Useful in tests.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

reap_now(prefix \\ "atlas-", providers \\ [:runpod])

Run a single reap cycle. Useful in tests.

start_link(opts \\ [])