From 79c51cba1f88178685023e95c988820c4859ca58 Mon Sep 17 00:00:00 2001 From: Paul Nicolas Date: Thu, 9 Jan 2025 15:58:52 +0100 Subject: [PATCH 1/2] feat(payments): add settings for max workflow task pollers --- docs/09-Configuration reference/01-Settings.md | 3 ++- internal/resources/payments/deployments.go | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/09-Configuration reference/01-Settings.md b/docs/09-Configuration reference/01-Settings.md index 88a21c4c..9009ae8c 100644 --- a/docs/09-Configuration reference/01-Settings.md +++ b/docs/09-Configuration reference/01-Settings.md @@ -28,13 +28,14 @@ While we have some basic types (string, number, bool ...), we also have some com | ledger.experimental-features | Bool | true | Enable experimental features | | ledger.experimental-numscript-interpreter | Bool | true | Enable new numscript interpreter | | payments.encryption-key | string | | Payments data encryption key | +| payments.worker.temporal-max-concurrent-workflow-task-pollers | Int | | Payments worker max concurrent workflow task pollers configuration | | deployments.``.init-containers.``.resource-requirements | Map | cpu=X, mem=X | | | deployments.``.containers.``.resource-requirements | Map | cpu=X, mem=X | | | deployments.``.init-containers.``.run-as | Map | user=X, group=X | | | deployments.``.containers.``.run-as | Map | user=X, group=X | | | deployments.``.replicas | string | 2 | | | caddy.image | string | | Caddy image | - + | jobs.``.init-containers.``.run-as | Map | user=X, group=X | Configure the security context for init containers in jobs by specifying the user and group IDs to run as | +| jobs.``.init-containers.``.run-as | Map | user=X, group=X | Configure the security context for init containers in jobs by specifying the user and group IDs to run as | | jobs.``.containers.``.run-as | Map | user=X, group=X | Configure the security context for containers in jobs by specifying the user and group IDs to run as | | registries.``.endpoint | string | | Specify a custom endpoint for a specific docker repository | | registries.``.images.``.rewrite | string | formancehq/example | Allow to rewrite the image path | diff --git a/internal/resources/payments/deployments.go b/internal/resources/payments/deployments.go index 425c9bc6..aee68adc 100644 --- a/internal/resources/payments/deployments.go +++ b/internal/resources/payments/deployments.go @@ -80,6 +80,15 @@ func temporalEnvVars(ctx core.Context, stack *v1beta1.Stack, payments *v1beta1.P ) } + temporalMaxConcurrentWorkflowTaskPollers, err := settings.GetIntOrDefault(ctx, stack.Name, 4, "payments", "worker", "temporal-max-concurrent-workflow-task-pollers") + if err != nil { + return nil, err + } + + env = append(env, + core.Env("TEMPORAL_MAX_CONCURRENT_WORKFLOW_TASK_POLLERS", fmt.Sprintf("%d", temporalMaxConcurrentWorkflowTaskPollers)), + ) + return env, nil } From 1a2c75a35c96dbbf6780c3ee567b5a52820aba7c Mon Sep 17 00:00:00 2001 From: Paul Nicolas Date: Thu, 9 Jan 2025 16:37:01 +0100 Subject: [PATCH 2/2] feat(payments): add max activity max pollers setting --- docs/09-Configuration reference/01-Settings.md | 1 + internal/resources/payments/deployments.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/docs/09-Configuration reference/01-Settings.md b/docs/09-Configuration reference/01-Settings.md index 9009ae8c..f1b732b2 100644 --- a/docs/09-Configuration reference/01-Settings.md +++ b/docs/09-Configuration reference/01-Settings.md @@ -29,6 +29,7 @@ While we have some basic types (string, number, bool ...), we also have some com | ledger.experimental-numscript-interpreter | Bool | true | Enable new numscript interpreter | | payments.encryption-key | string | | Payments data encryption key | | payments.worker.temporal-max-concurrent-workflow-task-pollers | Int | | Payments worker max concurrent workflow task pollers configuration | +| payments.worker.temporal-max-concurrent-activity-task-pollers | Int | | Payments worker max concurrent activity task pollers configuration | | deployments.``.init-containers.``.resource-requirements | Map | cpu=X, mem=X | | | deployments.``.containers.``.resource-requirements | Map | cpu=X, mem=X | | | deployments.``.init-containers.``.run-as | Map | user=X, group=X | | diff --git a/internal/resources/payments/deployments.go b/internal/resources/payments/deployments.go index aee68adc..d9604a76 100644 --- a/internal/resources/payments/deployments.go +++ b/internal/resources/payments/deployments.go @@ -85,8 +85,14 @@ func temporalEnvVars(ctx core.Context, stack *v1beta1.Stack, payments *v1beta1.P return nil, err } + temporalMaxConcurrentActivityTaskPollers, err := settings.GetIntOrDefault(ctx, stack.Name, 4, "payments", "worker", "temporal-max-concurrent-activity-task-pollers") + if err != nil { + return nil, err + } + env = append(env, core.Env("TEMPORAL_MAX_CONCURRENT_WORKFLOW_TASK_POLLERS", fmt.Sprintf("%d", temporalMaxConcurrentWorkflowTaskPollers)), + core.Env("TEMPORAL_MAX_CONCURRENT_ACTIVITY_TASK_POLLERS", fmt.Sprintf("%d", temporalMaxConcurrentActivityTaskPollers)), ) return env, nil