LabResources#

pydantic model controller.models.v1.lab.LabResources#

Resource requests and limits for a lab.

Parameters:

data (Any) –

Show JSON schema
{
   "title": "LabResources",
   "description": "Resource requests and limits for a lab.",
   "type": "object",
   "properties": {
      "limits": {
         "allOf": [
            {
               "$ref": "#/$defs/ResourceQuantity"
            }
         ],
         "description": "If the user's pod exceeds this CPU limit, it will be throttled. If it exceeds this memory limit, it will usually be killed with an out-of-memory error.",
         "title": "Maximum allowed resources"
      },
      "requests": {
         "allOf": [
            {
               "$ref": "#/$defs/ResourceQuantity"
            }
         ],
         "description": "Guaranteed minimum resources available to the user's lab. If these resources are not available, the cluster will autoscale or the lab spawn will fail.",
         "title": "Minimum requested resources"
      }
   },
   "$defs": {
      "ResourceQuantity": {
         "description": "A Kubernetes resource request or limit.",
         "properties": {
            "cpu": {
               "description": "Number of CPU cores",
               "examples": [
                  1.5
               ],
               "title": "CPU",
               "type": "number"
            },
            "memory": {
               "description": "Amount of memory in bytes. Also accepts strings with SI suffixes, which will be converted to bytes. Be sure to use the suffix with ``i`` to indicate powers of two (1024 rather than 1000) if that is desired.",
               "examples": [
                  1073741824,
                  "1Gi"
               ],
               "title": "Memory",
               "type": "integer"
            }
         },
         "required": [
            "cpu",
            "memory"
         ],
         "title": "ResourceQuantity",
         "type": "object"
      }
   },
   "required": [
      "limits",
      "requests"
   ]
}

Fields:
field limits: ResourceQuantity [Required]#

If the user’s pod exceeds this CPU limit, it will be throttled. If it exceeds this memory limit, it will usually be killed with an out-of-memory error.

field requests: ResourceQuantity [Required]#

Guaranteed minimum resources available to the user’s lab. If these resources are not available, the cluster will autoscale or the lab spawn will fail.

to_kubernetes()#

Convert to the Kubernetes object representation. :rtype: V1ResourceRequirements