LabSizeDefinition

pydantic model controller.config.LabSizeDefinition

Possible size of lab.

This will be used as the resource limits in Kubernetes, meaning that using more than this amount of CPU will result in throttling and more than this amount of memory may result in the lab being killed with an out-of-memory error. Requests will be less than this, adjusted by LIMIT_TO_REQUEST_RATIO.

Parameters:

data (Any)

Show JSON schema
{
   "title": "LabSizeDefinition",
   "description": "Possible size of lab.\n\nThis will be used as the resource limits in Kubernetes, meaning that using\nmore than this amount of CPU will result in throttling and more than this\namount of memory may result in the lab being killed with an out-of-memory\nerror. Requests will be less than this, adjusted by\n``LIMIT_TO_REQUEST_RATIO``.",
   "type": "object",
   "properties": {
      "size": {
         "allOf": [
            {
               "$ref": "#/$defs/LabSize"
            }
         ],
         "description": "Human-readable name for this lab size",
         "examples": [
            "small",
            "huge"
         ],
         "title": "Lab size"
      },
      "cpu": {
         "description": "Number of CPU cores",
         "examples": [
            0.5
         ],
         "title": "CPU",
         "type": "number"
      },
      "memory": {
         "description": "Amount of memory in bytes (SI suffixes allowed)",
         "examples": [
            "1536MiB"
         ],
         "title": "Memory",
         "type": "string"
      }
   },
   "$defs": {
      "LabSize": {
         "description": "Allowable names for pod sizes.\n\nTaken from `d20 creature sizes`_.",
         "enum": [
            "fine",
            "diminutive",
            "tiny",
            "small",
            "medium",
            "large",
            "huge",
            "gargantuan",
            "colossal",
            "custom"
         ],
         "title": "LabSize",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "size",
      "cpu",
      "memory"
   ]
}

Fields:
field cpu: float [Required]

Number of CPU cores

field memory: str [Required]

Amount of memory in bytes (SI suffixes allowed)

field size: LabSize [Required]

Human-readable name for this lab size

to_lab_resources()

Convert to the equivalent lab resources model.

Return type:

LabResources

property memory_bytes: int

Amount of memory in bytes.