mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-09 07:18:02 +00:00
Make 'enableNvidiaGpu' an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
5fc4951ba0
commit
5bdcfd67eb
3 changed files with 6 additions and 12 deletions
|
|
@ -923,16 +923,10 @@ class ConfigurationManager
|
|||
get => booleanize($this->GetEnvironmentalVariableOrConfig('NEXTCLOUD_ENABLE_DRI_DEVICE', 'nextcloud_enable_dri_device', ''));
|
||||
set { $this->set('nextcloud_enable_dri_device', $value); }
|
||||
}
|
||||
|
||||
private function GetEnabledNvidiaGpu() : string {
|
||||
$envVariableName = 'NEXTCLOUD_ENABLE_NVIDIA_GPU';
|
||||
$configName = 'enable_nvidia_gpu';
|
||||
$defaultValue = '';
|
||||
return $this->GetEnvironmentalVariableOrConfig($envVariableName, $configName, $defaultValue);
|
||||
}
|
||||
|
||||
public function isNvidiaGpuEnabled() : bool {
|
||||
return $this->GetEnabledNvidiaGpu() === 'true';
|
||||
|
||||
public bool $enableNvidiaGpu {
|
||||
get => booleanize($this->GetEnvironmentalVariableOrConfig('NEXTCLOUD_ENABLE_NVIDIA_GPU', 'enable_nvidia_gpu', ''));
|
||||
set { $this->set('enable_nvidia_gpu', $value); }
|
||||
}
|
||||
|
||||
private function GetKeepDisabledApps() : string {
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ readonly class DockerActionManager {
|
|||
$requestBody['HostConfig']['Devices'] = $devices;
|
||||
}
|
||||
|
||||
if ($container->enableNvidiaGpu && $this->configurationManager->isNvidiaGpuEnabled()) {
|
||||
if ($container->enableNvidiaGpu && $this->configurationManager->enableNvidiaGpu) {
|
||||
$requestBody['HostConfig']['Runtime'] = 'nvidia';
|
||||
$requestBody['HostConfig']['DeviceRequests'] = [
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue