Skip to content
Draft
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
8 changes: 8 additions & 0 deletions braintrust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ You may have to adjust your helm values.yaml overrides if you have adjusted any

Also if you have custom readiness checks, please unset these customizations and use our new default readiness checks. There is a bug in the dataplane where the endpoint we were using for readiness checks, would never recover if it failed.

### Version 6

This version introduces opt-in no-PG mode, allowing Brainstore to store objects directly without PostgreSQL. The new `skipPgForBrainstoreObjects` value defaults to `""` (disabled), so upgrading to v6 makes no behavioral change unless you explicitly set it.

> **⚠️ WARNING: This is a one-way operation.** Once an object type has been migrated off PostgreSQL, it cannot be un-migrated without downtime.

See [UPGRADE.md](UPGRADE.md#v600---no-pg-brainstore-objects) for prerequisites and full migration instructions.

## Example Values Files

Example values files for different cloud providers and configurations are located in the `examples/` folder.
46 changes: 46 additions & 0 deletions braintrust/UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,52 @@

This document outlines breaking changes and required configuration updates for major releases.

## v6.0.0 - No-PG Brainstore Objects

This release introduces the ability to store Brainstore objects (such as project logs) directly in Brainstore, bypassing PostgreSQL entirely. This is an **opt-in** feature — upgrading to v6 makes no behavioral change unless you explicitly set `skipPgForBrainstoreObjects`.

> **⚠️ WARNING: This is a one-way operation.** Once an object type has been migrated off PostgreSQL, it cannot be un-migrated without downtime. Do not enable this unless you are ready to commit.

### Requirements to migrate

Before enabling no-pg mode, you must:

1. **Upgrade your data plane to version 1.1.32 or higher.**

2. **Verify all Brainstore configuration checks pass** on your organization's Data Plane settings page:

![Brainstore prerequisites](images/no-pg-prereqs.png)

The following checks are expected to be incomplete at this stage and can be ignored:
- `Brainstore direct writes` — this will pass once the migration below is complete
- `Response cache URI` and `Code Bundle URI` — these are part of a separate Topics configuration

### Enabling no-pg mode

Set the `skipPgForBrainstoreObjects` value in your `values.yaml`:

```yaml
# Skip PostgreSQL for all object types (recommended for new deployments)
skipPgForBrainstoreObjects: "all"

# OR: skip for specific objects only
skipPgForBrainstoreObjects: "include:project_logs:5ad850f0-3a1a-4980-b889-d21d4116b5d7,project_logs:45b3aed2-3dde-4f0d-a22c-9af69ee8508e"

# OR: skip for all objects except specific ones
skipPgForBrainstoreObjects: "exclude:project_logs:5ad850f0-3a1a-4980-b889-d21d4116b5d7"
```

When set, the following environment variables are automatically configured:

- **API**: `BRAINSTORE_WAL_USE_EFFICIENT_FORMAT=true`, `SKIP_PG_FOR_BRAINSTORE_OBJECTS=<value>`
- **Brainstore** (reader, writer, fastreader): `BRAINSTORE_ASYNC_SCORING_OBJECTS=<value>`, `BRAINSTORE_LOG_AUTOMATIONS_OBJECTS=<value>`

### No rollback

Unlike previous major version upgrades, there is **no rollback path** for this change. Once objects are migrated off PostgreSQL, reverting requires downtime and manual intervention. Reach out to the Braintrust team on Slack before enabling this if you have concerns.

---

## v2.0.0 - Brainstore Reader/Writer Split

This release introduces a significant architectural change that splits the Brainstore service into separate reader and writer services for improved scalability and performance.
Expand Down
Binary file added braintrust/images/no-pg-prereqs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion braintrust/templates/api-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,9 @@ data:
BRAINSTORE_INSERT_ROW_REFS: "true"
# Logs v2 table. Requires pg_partman extension (default enabled in our TF modules)
INSERT_LOGS2: "true"
ALLOW_INVALID_BASE64: {{ .Values.api.allowInvalidBase64 | default "false" | quote }}
ALLOW_INVALID_BASE64: {{ .Values.api.allowInvalidBase64 | default "false" | quote }}
NODE_MEMORY_PERCENT: {{ .Values.api.nodeMemoryPercent | default "80" | quote }}
{{- if .Values.skipPgForBrainstoreObjects }}
BRAINSTORE_WAL_USE_EFFICIENT_FORMAT: "true"
SKIP_PG_FOR_BRAINSTORE_OBJECTS: {{ .Values.skipPgForBrainstoreObjects | quote }}
{{- end }}
4 changes: 4 additions & 0 deletions braintrust/templates/brainstore-fastreader-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ data:
{{- end }}
BRAINSTORE_CONTROL_PLANE_TELEMETRY: {{ .Values.global.controlPlaneTelemetry | quote }}
NO_COLOR: "1"
{{- if .Values.skipPgForBrainstoreObjects }}
BRAINSTORE_ASYNC_SCORING_OBJECTS: {{ .Values.skipPgForBrainstoreObjects | quote }}
BRAINSTORE_LOG_AUTOMATIONS_OBJECTS: {{ .Values.skipPgForBrainstoreObjects | quote }}
{{- end }}
6 changes: 5 additions & 1 deletion braintrust/templates/brainstore-reader-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ data:
{{- end }}
{{- end }}
BRAINSTORE_CONTROL_PLANE_TELEMETRY: {{ .Values.global.controlPlaneTelemetry | quote }}
NO_COLOR: "1"
NO_COLOR: "1"
{{- if .Values.skipPgForBrainstoreObjects }}
BRAINSTORE_ASYNC_SCORING_OBJECTS: {{ .Values.skipPgForBrainstoreObjects | quote }}
BRAINSTORE_LOG_AUTOMATIONS_OBJECTS: {{ .Values.skipPgForBrainstoreObjects | quote }}
{{- end }}
6 changes: 5 additions & 1 deletion braintrust/templates/brainstore-writer-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ data:
{{- end }}
{{- end }}
BRAINSTORE_CONTROL_PLANE_TELEMETRY: {{ .Values.global.controlPlaneTelemetry | quote }}
NO_COLOR: "1"
NO_COLOR: "1"
{{- if .Values.skipPgForBrainstoreObjects }}
BRAINSTORE_ASYNC_SCORING_OBJECTS: {{ .Values.skipPgForBrainstoreObjects | quote }}
BRAINSTORE_LOG_AUTOMATIONS_OBJECTS: {{ .Values.skipPgForBrainstoreObjects | quote }}
{{- end }}
53 changes: 53 additions & 0 deletions braintrust/tests/api-configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,56 @@ tests:
- equal:
path: data.BRAINSTORE_BACKFILL_DISABLE_NONHISTORICAL
value: "true"

- it: should not include no-pg vars when skipPgForBrainstoreObjects is not set
values:
- __fixtures__/base-values.yaml
release:
namespace: "braintrust"
asserts:
- isNull:
path: data.BRAINSTORE_WAL_USE_EFFICIENT_FORMAT
- isNull:
path: data.SKIP_PG_FOR_BRAINSTORE_OBJECTS

- it: should include no-pg vars when skipPgForBrainstoreObjects is "all"
values:
- __fixtures__/base-values.yaml
set:
skipPgForBrainstoreObjects: "all"
release:
namespace: "braintrust"
asserts:
- equal:
path: data.BRAINSTORE_WAL_USE_EFFICIENT_FORMAT
value: "true"
- equal:
path: data.SKIP_PG_FOR_BRAINSTORE_OBJECTS
value: "all"

- it: should pass through include-style skipPgForBrainstoreObjects value
values:
- __fixtures__/base-values.yaml
set:
skipPgForBrainstoreObjects: "include:project_logs:abc123"
release:
namespace: "braintrust"
asserts:
- equal:
path: data.BRAINSTORE_WAL_USE_EFFICIENT_FORMAT
value: "true"
- equal:
path: data.SKIP_PG_FOR_BRAINSTORE_OBJECTS
value: "include:project_logs:abc123"

- it: should pass through exclude-style skipPgForBrainstoreObjects value
values:
- __fixtures__/base-values.yaml
set:
skipPgForBrainstoreObjects: "exclude:project_logs:abc123"
release:
namespace: "braintrust"
asserts:
- equal:
path: data.SKIP_PG_FOR_BRAINSTORE_OBJECTS
value: "exclude:project_logs:abc123"
56 changes: 56 additions & 0 deletions braintrust/tests/brainstore-fastreader-configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,59 @@ tests:
- equal:
path: metadata.annotations["custom-annotation"]
value: value

- it: should not include no-pg vars when skipPgForBrainstoreObjects is not set
values:
- __fixtures__/base-values.yaml
release:
namespace: "braintrust"
asserts:
- isNull:
path: data.BRAINSTORE_ASYNC_SCORING_OBJECTS
- isNull:
path: data.BRAINSTORE_LOG_AUTOMATIONS_OBJECTS

- it: should include no-pg vars when skipPgForBrainstoreObjects is "all"
values:
- __fixtures__/base-values.yaml
set:
skipPgForBrainstoreObjects: "all"
release:
namespace: "braintrust"
asserts:
- equal:
path: data.BRAINSTORE_ASYNC_SCORING_OBJECTS
value: "all"
- equal:
path: data.BRAINSTORE_LOG_AUTOMATIONS_OBJECTS
value: "all"

- it: should pass through include-style skipPgForBrainstoreObjects value
values:
- __fixtures__/base-values.yaml
set:
skipPgForBrainstoreObjects: "include:project_logs:abc123"
release:
namespace: "braintrust"
asserts:
- equal:
path: data.BRAINSTORE_ASYNC_SCORING_OBJECTS
value: "include:project_logs:abc123"
- equal:
path: data.BRAINSTORE_LOG_AUTOMATIONS_OBJECTS
value: "include:project_logs:abc123"

- it: should pass through exclude-style skipPgForBrainstoreObjects value
values:
- __fixtures__/base-values.yaml
set:
skipPgForBrainstoreObjects: "exclude:project_logs:abc123"
release:
namespace: "braintrust"
asserts:
- equal:
path: data.BRAINSTORE_ASYNC_SCORING_OBJECTS
value: "exclude:project_logs:abc123"
- equal:
path: data.BRAINSTORE_LOG_AUTOMATIONS_OBJECTS
value: "exclude:project_logs:abc123"
56 changes: 56 additions & 0 deletions braintrust/tests/brainstore-reader-configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,59 @@ tests:
- equal:
path: metadata.annotations["custom-annotation"]
value: value

- it: should not include no-pg vars when skipPgForBrainstoreObjects is not set
values:
- __fixtures__/base-values.yaml
release:
namespace: "braintrust"
asserts:
- isNull:
path: data.BRAINSTORE_ASYNC_SCORING_OBJECTS
- isNull:
path: data.BRAINSTORE_LOG_AUTOMATIONS_OBJECTS

- it: should include no-pg vars when skipPgForBrainstoreObjects is "all"
values:
- __fixtures__/base-values.yaml
set:
skipPgForBrainstoreObjects: "all"
release:
namespace: "braintrust"
asserts:
- equal:
path: data.BRAINSTORE_ASYNC_SCORING_OBJECTS
value: "all"
- equal:
path: data.BRAINSTORE_LOG_AUTOMATIONS_OBJECTS
value: "all"

- it: should pass through include-style skipPgForBrainstoreObjects value
values:
- __fixtures__/base-values.yaml
set:
skipPgForBrainstoreObjects: "include:project_logs:abc123"
release:
namespace: "braintrust"
asserts:
- equal:
path: data.BRAINSTORE_ASYNC_SCORING_OBJECTS
value: "include:project_logs:abc123"
- equal:
path: data.BRAINSTORE_LOG_AUTOMATIONS_OBJECTS
value: "include:project_logs:abc123"

- it: should pass through exclude-style skipPgForBrainstoreObjects value
values:
- __fixtures__/base-values.yaml
set:
skipPgForBrainstoreObjects: "exclude:project_logs:abc123"
release:
namespace: "braintrust"
asserts:
- equal:
path: data.BRAINSTORE_ASYNC_SCORING_OBJECTS
value: "exclude:project_logs:abc123"
- equal:
path: data.BRAINSTORE_LOG_AUTOMATIONS_OBJECTS
value: "exclude:project_logs:abc123"
56 changes: 56 additions & 0 deletions braintrust/tests/brainstore-writer-configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,59 @@ tests:
- equal:
path: metadata.annotations["custom-annotation"]
value: value

- it: should not include no-pg vars when skipPgForBrainstoreObjects is not set
values:
- __fixtures__/base-values.yaml
release:
namespace: "braintrust"
asserts:
- isNull:
path: data.BRAINSTORE_ASYNC_SCORING_OBJECTS
- isNull:
path: data.BRAINSTORE_LOG_AUTOMATIONS_OBJECTS

- it: should include no-pg vars when skipPgForBrainstoreObjects is "all"
values:
- __fixtures__/base-values.yaml
set:
skipPgForBrainstoreObjects: "all"
release:
namespace: "braintrust"
asserts:
- equal:
path: data.BRAINSTORE_ASYNC_SCORING_OBJECTS
value: "all"
- equal:
path: data.BRAINSTORE_LOG_AUTOMATIONS_OBJECTS
value: "all"

- it: should pass through include-style skipPgForBrainstoreObjects value
values:
- __fixtures__/base-values.yaml
set:
skipPgForBrainstoreObjects: "include:project_logs:abc123"
release:
namespace: "braintrust"
asserts:
- equal:
path: data.BRAINSTORE_ASYNC_SCORING_OBJECTS
value: "include:project_logs:abc123"
- equal:
path: data.BRAINSTORE_LOG_AUTOMATIONS_OBJECTS
value: "include:project_logs:abc123"

- it: should pass through exclude-style skipPgForBrainstoreObjects value
values:
- __fixtures__/base-values.yaml
set:
skipPgForBrainstoreObjects: "exclude:project_logs:abc123"
release:
namespace: "braintrust"
asserts:
- equal:
path: data.BRAINSTORE_ASYNC_SCORING_OBJECTS
value: "exclude:project_logs:abc123"
- equal:
path: data.BRAINSTORE_LOG_AUTOMATIONS_OBJECTS
value: "exclude:project_logs:abc123"
12 changes: 12 additions & 0 deletions braintrust/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,18 @@ azureKeyVaultDriver:
keyVaultSecretType: "secret"
kubernetesSecretKey: "AZURE_STORAGE_CONNECTION_STRING"

# No-PG mode: controls which object types bypass PostgreSQL and use Brainstore directly.
# WARNING: This is a one-way operation. Once migrated off Postgres, objects cannot be
# un-migrated without downtime.
# Options:
# - "" (default): disabled, PostgreSQL used as normal
# - "all": skip PostgreSQL for all object types
# - "include:<type>:<uuid>,...": skip for specific objects only
# e.g. "include:project_logs:5ad850f0-...,project_logs:45b3aed2-..."
# - "exclude:<type>:<uuid>,...": skip for all objects except specific ones
# e.g. "exclude:project_logs:5ad850f0-..."
skipPgForBrainstoreObjects: ""

# Istio VirtualService configuration (optional)
# Enable this to create an Istio VirtualService for the API
virtualService:
Expand Down
Loading