mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-29 23:10:08 +00:00
feat: set default cpuShares to 1024 in ContainerDefinitionFetcher
Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/d051ae44-c6c5-476d-9217-425945116a19 Co-authored-by: szaimen <42591237+szaimen@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
42b0d661c8
commit
b697863f5f
@@ -28,6 +28,7 @@ readonly class Container {
|
||||
/** @var string[] */
|
||||
public array $capAdd,
|
||||
public int $shmSize,
|
||||
public int $cpuShares,
|
||||
public bool $apparmorUnconfined,
|
||||
/** @var string[] */
|
||||
public array $backupVolumes,
|
||||
|
||||
@@ -303,6 +303,11 @@ readonly class ContainerDefinitionFetcher {
|
||||
$shmSize = $entry['shm_size'];
|
||||
}
|
||||
|
||||
$cpuShares = 1024;
|
||||
if (isset($entry['cpu_shares'])) {
|
||||
$cpuShares = $entry['cpu_shares'];
|
||||
}
|
||||
|
||||
$apparmorUnconfined = false;
|
||||
if (isset($entry['apparmor_unconfined'])) {
|
||||
$apparmorUnconfined = $entry['apparmor_unconfined'];
|
||||
@@ -361,6 +366,7 @@ readonly class ContainerDefinitionFetcher {
|
||||
$enableNvidiaGpu,
|
||||
$capAdd,
|
||||
$shmSize,
|
||||
$cpuShares,
|
||||
$apparmorUnconfined,
|
||||
$backupVolumes,
|
||||
$nextcloudExecCommands,
|
||||
|
||||
@@ -374,6 +374,11 @@ readonly class DockerActionManager {
|
||||
$requestBody['HostConfig']['ShmSize'] = $shmSize;
|
||||
}
|
||||
|
||||
$cpuShares = $container->cpuShares;
|
||||
if ($cpuShares > 0) {
|
||||
$requestBody['HostConfig']['CpuShares'] = $cpuShares;
|
||||
}
|
||||
|
||||
$tmpfs = [];
|
||||
foreach ($container->tmpfs as $tmp) {
|
||||
$mode = "";
|
||||
|
||||
Reference in New Issue
Block a user