{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://zaroz.cloud/contract/units/v1/resources.schema.json",
  "title": "/zaroz/resources.json",
  "description": "The size of this unit, for the process to size itself by. The same numbers are in the environment variables ZAROZ_CPU_MILLICORES, ZAROZ_MEMORY_BUDGET_MIB and ZAROZ_MEMORY_LIMIT_MIB. Size heaps and caches from memory_budget_mib, not from memory_limit_mib. Consumers must ignore unknown fields.",
  "type": "object",
  "required": ["schema_version", "cpu_millicores", "memory_budget_mib", "memory_limit_mib"],
  "properties": {
    "schema_version": { "const": 1 },
    "cpu_millicores": { "type": "integer", "minimum": 0, "description": "The CPU the unit may use, in thousandths of a core (2000 is two cores, 250 is a quarter of one). The unit's own size when it has one, the plan's otherwise." },
    "memory_budget_mib": { "type": "integer", "minimum": 0, "description": "The memory the unit is held to, in MiB: its own size when it has one, the plan's otherwise. A unit that stays above it for a sustained period is stopped." },
    "memory_limit_mib": { "type": "integer", "minimum": 0, "description": "The container's hard memory limit, in MiB: the budget plus short-term headroom. A process that reaches it is killed (out of memory)." }
  }
}
