Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion braintrust/examples/gke-loop-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion braintrust/templates/loop-runtime-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the cap gone a pod takes up to 20 conversations on 1 CPU and 2Gi, and autoscaling is off by default. AWS runs the same default on a 2 vCPU, 8 GiB task and also scales on CPU and memory. Has a pod at this size been run near 20 conversations, or should the default resources go up with it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't run a pod near 20 conversations. I changed the GKE default requests and limits to 2 CPU / 8Gi, matching the AWS task sizing you called out, and documented the explicit resource settings needed when --reuse-values retains 1 CPU / 2Gi. The chart tests cover rendered resources, not load behavior.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

examples/gke-loop-runtime/README.md line 161 still says each runtime pod claims at most two conversations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the example README to state the runtime's 20-conversation default, the new pod resources, and how to override the limit.

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"
Expand Down
3 changes: 1 addition & 2 deletions braintrust/tests/loop-runtime-configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
18 changes: 18 additions & 0 deletions braintrust/tests/loop-runtime-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions braintrust/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading