From 733c5ad97dbf4ee7fd47ac3111dbed33809cf7f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 11 Mar 2025 10:24:18 +0100 Subject: [PATCH] Add enforced minimal specs --- src/Appwrite/Platform/Modules/Functions/Workers/Builds.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index dee13c83ce..bf442e7c3b 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -493,8 +493,11 @@ class Builds extends Action $vars[$var->getAttribute('key')] = $var->getAttribute('value', ''); } + // Some runtimes/frameworks can't compile with less memory than this + $minMemory = $resource->getCollection() === 'sites' ? 2048 : 1024; + $cpus = $spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT; - $memory = max($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT, 1024); // We have a minimum of 1024MB here because some runtimes can't compile with less memory than this. + $memory = max($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT, $minMemory); $timeout = (int) System::getEnv('_APP_COMPUTE_BUILD_TIMEOUT', 900);