diff --git a/braintrust/examples/gke-loop-runtime/README.md b/braintrust/examples/gke-loop-runtime/README.md index 331fccd..d24d668 100644 --- a/braintrust/examples/gke-loop-runtime/README.md +++ b/braintrust/examples/gke-loop-runtime/README.md @@ -158,7 +158,11 @@ Loop Runtime defaults to one pod. Rolling updates use `maxSurge: 1` and for more capacity or pod redundancy. With `helm upgrade --reuse-values`, add `--set loopRuntime.replicas=1` to replace a retained count of two. -Each runtime pod claims at most two conversations and has a 256Mi in-memory cache budget. +The runtime defaults to 20 claimed conversations per pod, with 2 CPU and 8Gi of memory. +Set `loopRuntime.extraEnvVars` to override the claim limit, and size `loopRuntime.resources` +for your workload. The in-memory cache budget is 256Mi. +When upgrading with `--reuse-values`, explicitly set the CPU and memory requests and +limits to 2 CPU and 8Gi if the release retained the old 1 CPU and 2Gi defaults. For conversation-based runtime autoscaling, set `loopRuntime.autoscaling.enabled: true`. This uses the same GKE custom-metrics prerequisites as `api.autoscaling` and defaults diff --git a/braintrust/templates/loop-runtime-configmap.yaml b/braintrust/templates/loop-runtime-configmap.yaml index 1d1cab7..3fb36a6 100644 --- a/braintrust/templates/loop-runtime-configmap.yaml +++ b/braintrust/templates/loop-runtime-configmap.yaml @@ -39,7 +39,6 @@ data: BRAINSTORE_CACHE_DIR: /mnt/tmp/brainstore BRAINSTORE_OBJECT_STORE_CACHE_FILE_SIZE: 5Gi BRAINSTORE_OBJECT_STORE_CACHE_MEMORY_LIMIT: 256Mi - LOOP_RUNTIME_MAX_CLAIMED_CONVERSATIONS: "2" LOOP_RUNTIME_SANDBOX_CAPACITY_TARGET_UTILIZATION_PERCENT: {{ maxf 1 (float64 ($autoscaling.targetConversationUtilization | default "50")) | quote }} BRAINSTORE_CONTROL_PLANE_TELEMETRY: {{ list .Values.global.controlPlaneTelemetry "metrics" "traces" | compact | join "," | quote }} NO_COLOR: "1" diff --git a/braintrust/tests/loop-runtime-configmap_test.yaml b/braintrust/tests/loop-runtime-configmap_test.yaml index 3b0154c..8dd59b4 100644 --- a/braintrust/tests/loop-runtime-configmap_test.yaml +++ b/braintrust/tests/loop-runtime-configmap_test.yaml @@ -72,9 +72,8 @@ tests: - equal: path: data.BRAINSTORE_OBJECT_STORE_CACHE_MEMORY_LIMIT value: 256Mi - - equal: + - isNull: path: data.LOOP_RUNTIME_MAX_CLAIMED_CONVERSATIONS - value: "2" - equal: path: data.LOOP_RUNTIME_SANDBOX_CAPACITY_TARGET_UTILIZATION_PERCENT value: "50" diff --git a/braintrust/tests/loop-runtime-deployment_test.yaml b/braintrust/tests/loop-runtime-deployment_test.yaml index 9375c5a..15780ff 100644 --- a/braintrust/tests/loop-runtime-deployment_test.yaml +++ b/braintrust/tests/loop-runtime-deployment_test.yaml @@ -19,10 +19,28 @@ tests: loopRuntime.extraEnvVars: - name: BRAINTRUST_APP_URL value: https://loop-control-plane.example.com + - name: LOOP_RUNTIME_MAX_CLAIMED_CONVERSATIONS + value: "40" asserts: - equal: path: spec.replicas value: 1 + - equal: + path: spec.template.spec.containers[0].resources + value: + requests: + cpu: "2" + memory: 8Gi + ephemeral-storage: 9Gi + limits: + cpu: "2" + memory: 8Gi + ephemeral-storage: 9Gi + - contains: + path: spec.template.spec.containers[0].env + content: + name: LOOP_RUNTIME_MAX_CLAIMED_CONVERSATIONS + value: "40" - equal: path: spec.strategy value: diff --git a/braintrust/values.yaml b/braintrust/values.yaml index f1f09c3..c4cfff7 100644 --- a/braintrust/values.yaml +++ b/braintrust/values.yaml @@ -332,12 +332,12 @@ loopRuntime: googleServiceAccount: "" resources: requests: - cpu: "1" - memory: "2Gi" + cpu: "2" + memory: "8Gi" ephemeral-storage: "9Gi" limits: - cpu: "1" - memory: "2Gi" + cpu: "2" + memory: "8Gi" ephemeral-storage: "9Gi" livenessProbe: httpGet: