From 8c9433a39f77cfca85caeebca537b2ff2deb240d Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Mon, 4 May 2026 23:20:13 +0300 Subject: [PATCH] nix: add maxJobMemoryMb and maxConcurrentWorkflows to spindle module Signed-off-by: Anirudh Oppiliappan --- nix/modules/spindle.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nix/modules/spindle.nix b/nix/modules/spindle.nix index 696c2d66..651cf12b 100644 --- a/nix/modules/spindle.nix +++ b/nix/modules/spindle.nix @@ -75,6 +75,12 @@ in description = "Maximum number of jobs queue up"; }; + maxConcurrentWorkflows = mkOption { + type = types.int; + default = 8; + description = "Maximum number of workflow containers running simultaneously (controls total memory usage)"; + }; + secrets = { provider = mkOption { type = types.str; @@ -110,6 +116,12 @@ in description = "Timeout for each step of a pipeline"; }; + maxJobMemoryMb = mkOption { + type = types.int; + default = 6144; + description = "Memory limit per workflow container in MiB (default 6 GiB)"; + }; + logBucket = mkOption { type = types.str; default = "tangled-logs"; @@ -155,11 +167,13 @@ in "SPINDLE_SERVER_OWNER=${cfg.server.owner}" "SPINDLE_SERVER_MAX_JOB_COUNT=${toString cfg.server.maxJobCount}" "SPINDLE_SERVER_QUEUE_SIZE=${toString cfg.server.queueSize}" + "SPINDLE_SERVER_MAX_CONCURRENT_WORKFLOWS=${toString cfg.server.maxConcurrentWorkflows}" "SPINDLE_SERVER_SECRETS_PROVIDER=${cfg.server.secrets.provider}" "SPINDLE_SERVER_SECRETS_OPENBAO_PROXY_ADDR=${cfg.server.secrets.openbao.proxyAddr}" "SPINDLE_SERVER_SECRETS_OPENBAO_MOUNT=${cfg.server.secrets.openbao.mount}" "SPINDLE_NIXERY_PIPELINES_NIXERY=${cfg.pipelines.nixery}" "SPINDLE_NIXERY_PIPELINES_WORKFLOW_TIMEOUT=${cfg.pipelines.workflowTimeout}" + "SPINDLE_NIXERY_PIPELINES_MAX_JOB_MEMORY_MB=${toString cfg.pipelines.maxJobMemoryMb}" "SPINDLE_S3_LOG_BUCKET=${cfg.pipelines.logBucket}" ]; ExecStart = "${cfg.package}/bin/spindle"; -- 2.51.2