mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-09-20 18:20:23 +00:00
feat: add oom_score_adj to all AIO containers
Assign oom_score_adj per priority tier so the OOM killer targets less critical containers first; parse it from containers.json and apply on create. Signed-off-by: Simon L. <szaimen@e.mail.de> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
03bf5fe241
commit
c2616be933
@@ -214,6 +214,11 @@
|
||||
"pattern": "^/[a-z/_0-9-:]+$"
|
||||
}
|
||||
},
|
||||
"oom_score_adj": {
|
||||
"type": "integer",
|
||||
"minimum": -500,
|
||||
"maximum": 500
|
||||
},
|
||||
"volumes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
||||
+38
-19
@@ -82,7 +82,8 @@
|
||||
],
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": -100
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-database",
|
||||
@@ -139,7 +140,8 @@
|
||||
],
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": -300
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-nextcloud",
|
||||
@@ -284,7 +286,8 @@
|
||||
],
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": -100
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-notify-push",
|
||||
@@ -325,7 +328,8 @@
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": 100
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-redis",
|
||||
@@ -368,7 +372,8 @@
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": -300
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-collabora",
|
||||
@@ -418,7 +423,8 @@
|
||||
],
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": 300
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-talk",
|
||||
@@ -488,7 +494,8 @@
|
||||
],
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": 300
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-talk-recording",
|
||||
@@ -542,7 +549,8 @@
|
||||
],
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": 300
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-borgbackup",
|
||||
@@ -613,7 +621,8 @@
|
||||
"tmpfs": [
|
||||
"/tmp",
|
||||
"/nextcloud_aio_volumes"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": -300
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-watchtower",
|
||||
@@ -636,7 +645,8 @@
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": -300
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-domaincheck",
|
||||
@@ -669,7 +679,8 @@
|
||||
],
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": 300
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-clamav",
|
||||
@@ -714,7 +725,8 @@
|
||||
],
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": 300
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-onlyoffice",
|
||||
@@ -758,7 +770,8 @@
|
||||
],
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": 300
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-eurooffice",
|
||||
@@ -807,7 +820,8 @@
|
||||
],
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": 300
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-imaginary",
|
||||
@@ -849,7 +863,8 @@
|
||||
],
|
||||
"secrets": [
|
||||
"IMAGINARY_SECRET"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": 300
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-fulltextsearch",
|
||||
@@ -903,7 +918,8 @@
|
||||
],
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": 300
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-docker-socket-proxy",
|
||||
@@ -930,7 +946,8 @@
|
||||
],
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": 100
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-harp",
|
||||
@@ -982,7 +999,8 @@
|
||||
],
|
||||
"profiles": [
|
||||
"harp"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": 100
|
||||
},
|
||||
{
|
||||
"container_name": "nextcloud-aio-whiteboard",
|
||||
@@ -1028,7 +1046,8 @@
|
||||
"read_only": true,
|
||||
"cap_drop": [
|
||||
"NET_RAW"
|
||||
]
|
||||
],
|
||||
"oom_score_adj": 300
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ readonly class Container {
|
||||
public AioVariables $aioVariables,
|
||||
public string $documentation,
|
||||
public bool $hideFromList,
|
||||
public int $oomScoreAdj,
|
||||
private DockerActionManager $dockerActionManager
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -360,6 +360,11 @@ readonly class ContainerDefinitionFetcher {
|
||||
|
||||
$hideFromList = $entry['hide_from_list'] ?? false;
|
||||
|
||||
$oomScoreAdj = 500;
|
||||
if (isset($entry['oom_score_adj'])) {
|
||||
$oomScoreAdj = $entry['oom_score_adj'];
|
||||
}
|
||||
|
||||
$containers[] = new Container(
|
||||
$entry['container_name'],
|
||||
$displayName,
|
||||
@@ -387,6 +392,7 @@ readonly class ContainerDefinitionFetcher {
|
||||
$aioVariables,
|
||||
$documentation,
|
||||
$hideFromList,
|
||||
$oomScoreAdj,
|
||||
$this->container->get(DockerActionManager::class)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -414,6 +414,10 @@ readonly class DockerActionManager {
|
||||
$requestBody['StopTimeout'] = $maxShutDownTime;
|
||||
}
|
||||
|
||||
if ($container->oomScoreAdj !== 0) {
|
||||
$requestBody['HostConfig']['OomScoreAdj'] = $container->oomScoreAdj;
|
||||
}
|
||||
|
||||
$capAdds = $container->capAdd;
|
||||
if (count($capAdds) > 0) {
|
||||
$requestBody['HostConfig']['CapAdd'] = $capAdds;
|
||||
|
||||
Reference in New Issue
Block a user