mirror of
https://github.com/opencontainers/runtime-spec.git
synced 2026-02-05 18:45:18 +01:00
It's backed by memory.oom_control, so this commit moves it in with
the rest of the memory-controller config.
Looking at the history, the initial request landing a setting for this
in the Docker/OCI ecosystem seems to be [1], which added
Cgroup.OomKillDisable. That commit was carried from libcontainer into
runC [2] where it is now Resources.OomKillDisable [3]. From runC it
was carried into this repo (with some renaming) in [4]. Subsequent
early doc updates landed in [5,6]. In none of those can I find
discussion about why the setting is not already under memory. I
expect the reason is that the runC structures are flat, so "under
memory" is not a thing there. But in this spec, resources has
per-controller sub-properties. The fact that disableOOMKiller
belonged to the memory controller may have been overlooked in [4] and
never revisited until now.
[1]: https://github.com/docker/libcontainer/pull/417
Subject: cgroups: add support for oom control
[2]: 295c70865d
Subject: cgroups: add support for oom control
[3]: https://github.com/opencontainers/runc/blob/v1.0.0-rc3/libcontainer/configs/cgroup_unix.go#L113-L114
[4]: https://github.com/opencontainers/runtime-spec/pull/51
Subject: Add Go types for specification
[5]: https://github.com/opencontainers/runtime-spec/pull/137
Subject: Adding cgroups path to the Spec.
[6]: https://github.com/opencontainers/runtime-spec/pull/199
Subject: runtime: config: linux: add cgroups informations
Signed-off-by: W. Trevor King <wking@tremily.us>
272 lines
13 KiB
JSON
272 lines
13 KiB
JSON
{
|
|
"linux": {
|
|
"description": "Linux platform-specific configurations",
|
|
"id": "https://opencontainers.org/schema/bundle/linux",
|
|
"type": "object",
|
|
"properties": {
|
|
"devices": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/devices",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "defs-linux.json#/definitions/Device"
|
|
}
|
|
},
|
|
"uidMappings": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/uidMappings",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "defs.json#/definitions/IDMapping"
|
|
}
|
|
},
|
|
"gidMappings": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/gidMappings",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "defs.json#/definitions/IDMapping"
|
|
}
|
|
},
|
|
"namespaces": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/namespaces",
|
|
"type": "array",
|
|
"items": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "defs-linux.json#/definitions/NamespaceReference"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"resources": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources",
|
|
"type": "object",
|
|
"properties": {
|
|
"devices": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/devices",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "defs-linux.json#/definitions/DeviceCgroup"
|
|
}
|
|
},
|
|
"pids": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/pids",
|
|
"type": "object",
|
|
"properties": {
|
|
"limit": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/pids/limit",
|
|
"$ref": "defs.json#/definitions/int64"
|
|
}
|
|
},
|
|
"required": [
|
|
"limit"
|
|
]
|
|
},
|
|
"blockIO": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO",
|
|
"type": "object",
|
|
"properties": {
|
|
"weight": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/weight",
|
|
"$ref": "defs-linux.json#/definitions/weight"
|
|
},
|
|
"leafWeight": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/leafWeight",
|
|
"$ref": "defs-linux.json#/definitions/weight"
|
|
},
|
|
"throttleReadBpsDevice": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/throttleReadBpsDevice",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "defs-linux.json#/definitions/blockIODeviceThrottle"
|
|
}
|
|
},
|
|
"throttleWriteBpsDevice": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/throttleWriteBpsDevice",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "defs-linux.json#/definitions/blockIODeviceThrottle"
|
|
}
|
|
},
|
|
"throttleReadIopsDevice": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/throttleReadIopsDevice",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "defs-linux.json#/definitions/blockIODeviceThrottle"
|
|
}
|
|
},
|
|
"throttleWriteIopsDevice": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/throttleWriteIopsDevice",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "defs-linux.json#/definitions/blockIODeviceThrottle"
|
|
}
|
|
},
|
|
"weightDevice": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/weightDevice",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "defs-linux.json#/definitions/blockIODeviceWeight"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"cpu": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu",
|
|
"type": "object",
|
|
"properties": {
|
|
"cpus": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/cpus",
|
|
"type": "string"
|
|
},
|
|
"mems": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/mems",
|
|
"type": "string"
|
|
},
|
|
"period": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/period",
|
|
"$ref": "defs.json#/definitions/uint64"
|
|
},
|
|
"quota": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/quota",
|
|
"$ref": "defs.json#/definitions/int64"
|
|
},
|
|
"realtimePeriod": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/realtimePeriod",
|
|
"$ref": "defs.json#/definitions/uint64"
|
|
},
|
|
"realtimeRuntime": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/realtimeRuntime",
|
|
"$ref": "defs.json#/definitions/int64"
|
|
},
|
|
"shares": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/shares",
|
|
"$ref": "defs.json#/definitions/uint64"
|
|
}
|
|
}
|
|
},
|
|
"hugepageLimits": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/hugepageLimits",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"pageSize": {
|
|
"type": "string"
|
|
},
|
|
"limit": {
|
|
"$ref": "defs.json#/definitions/uint64"
|
|
}
|
|
},
|
|
"required": [
|
|
"pageSize",
|
|
"limit"
|
|
]
|
|
}
|
|
},
|
|
"memory": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory",
|
|
"type": "object",
|
|
"properties": {
|
|
"kernel": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/kernel",
|
|
"$ref": "defs.json#/definitions/int64"
|
|
},
|
|
"kernelTCP": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/kernelTCP",
|
|
"$ref": "defs.json#/definitions/int64"
|
|
},
|
|
"limit": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/limit",
|
|
"$ref": "defs.json#/definitions/int64"
|
|
},
|
|
"reservation": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/reservation",
|
|
"$ref": "defs.json#/definitions/int64"
|
|
},
|
|
"swap": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/swap",
|
|
"$ref": "defs.json#/definitions/int64"
|
|
},
|
|
"swappiness": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/swappiness",
|
|
"$ref": "defs.json#/definitions/uint64"
|
|
},
|
|
"disableOOMKiller": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/disableOOMKiller",
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"network": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/network",
|
|
"type": "object",
|
|
"properties": {
|
|
"classID": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/network/classId",
|
|
"$ref": "defs.json#/definitions/uint32"
|
|
},
|
|
"priorities": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/resources/network/priorities",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "defs-linux.json#/definitions/NetworkInterfacePriority"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"cgroupsPath": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/cgroupsPath",
|
|
"type": "string"
|
|
},
|
|
"rootfsPropagation": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/rootfsPropagation",
|
|
"$ref": "defs-linux.json#/definitions/RootfsPropagation"
|
|
},
|
|
"seccomp": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/seccomp",
|
|
"type": "object",
|
|
"properties": {
|
|
"defaultAction": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/seccomp/defaultAction",
|
|
"type": "string"
|
|
},
|
|
"architectures": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/seccomp/architectures",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "defs-linux.json#/definitions/SeccompArch"
|
|
}
|
|
},
|
|
"syscalls": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/seccomp/syscalls",
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "defs-linux.json#/definitions/Syscall"
|
|
}
|
|
}
|
|
},
|
|
"required": [
|
|
"defaultAction"
|
|
]
|
|
},
|
|
"sysctl": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/sysctl",
|
|
"$ref": "defs.json#/definitions/mapStringString"
|
|
},
|
|
"maskedPaths": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/maskedPaths",
|
|
"$ref": "defs.json#/definitions/ArrayOfStrings"
|
|
},
|
|
"readonlyPaths": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/readonlyPaths",
|
|
"$ref": "defs.json#/definitions/ArrayOfStrings"
|
|
},
|
|
"mountLabel": {
|
|
"id": "https://opencontainers.org/schema/bundle/linux/mountLabel",
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|