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
75 changes: 75 additions & 0 deletions .github/workflows/test-helm-chart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Test Helm Chart

on:
pull_request:
push:
branches:
- main

jobs:
unittest:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Helm
uses: azure/setup-helm@v4
with:
version: 'latest'

- name: Install helm-unittest
run: |
helm plugin install https://github.com/quintush/helm-unittest --verify=false

- name: Run unit tests
run: |
helm unittest braintrust

lint-test:
name: Lint and Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Helm
uses: azure/setup-helm@v4
with:
version: 'latest'

- name: Lint chart
run: helm lint braintrust --strict

test-values:
name: Test with Values Files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Helm
uses: azure/setup-helm@v4
with:
version: 'latest'

- name: Test chart rendering with Azure values
run: |
helm template test-release braintrust --values braintrust/ci/values-azure.yaml > /dev/null
echo "✅ Chart rendered successfully with braintrust/ci/values-azure.yaml"

- name: Test chart rendering with Google values
run: |
helm template test-release braintrust --values braintrust/ci/values-google.yaml > /dev/null
echo "✅ Chart rendered successfully with braintrust/ci/values-google.yaml"

- name: Test chart rendering with AWS values
run: |
helm template test-release braintrust --values braintrust/ci/values-aws.yaml > /dev/null
echo "✅ Chart rendered successfully with braintrust/ci/values-aws.yaml"

- name: Test chart rendering with Minimal values
run: |
helm template test-release braintrust --values braintrust/ci/values-minimal.yaml > /dev/null
echo "✅ Chart rendered successfully with braintrust/ci/values-minimal.yaml"
9 changes: 9 additions & 0 deletions .helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Patterns to ignore when building packages.
.git
.github
.gitignore
README.md
LICENSE
docs/
*.md
!braintrust/README.md
8 changes: 8 additions & 0 deletions braintrust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ For Standard mode clusters, create node pools with local SSDs, then deploy:
- Local SSDs are automatically available via emptyDir volumes
- Pod anti-affinity ensures readers and writers don't share nodes (each pod gets dedicated node access)

## Testing

This Helm chart includes comprehensive automated unit tests.

```bash
# Run all tests
./test.sh
```

## Breaking Changes

Expand Down
103 changes: 103 additions & 0 deletions braintrust/ci/values-aws.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Test values for AWS deployment
global:
orgName: "test-org"
createNamespace: false
namespace: "braintrust"
labels: {}
namespaceAnnotations: {}
controlPlaneTelemetry: "status,metrics,usage"

cloud: "aws"

objectStorage:
aws:
brainstoreBucket: "test-brainstore-bucket"
responseBucket: "test-response-bucket"
codeBundleBucket: "test-code-bundle-bucket"

api:
name: "braintrust-api"
replicas: 1
image:
repository: "public.ecr.aws/braintrust/standalone-api"
tag: "v1.1.28"
pullPolicy: "IfNotPresent"
service:
type: ClusterIP
port: 8000
serviceAccount:
name: "braintrust-api"
awsRoleArn: "arn:aws:iam::123456789012:role/test-role"
resources:
requests:
cpu: "2"
memory: "4Gi"
limits:
cpu: "4"
memory: "8Gi"
allowCodeFunctionExecution: true
backfillDisableHistorical: false
backfillDisableNonhistorical: false
allowInvalidBase64: false
nodeMemoryPercent: "80"
extraEnvVars: []
nodeSelector: {}
tolerations: []
affinity: {}

brainstore:
serviceAccount:
name: "brainstore"
awsRoleArn: "arn:aws:iam::123456789012:role/test-role"
annotations: {}
image:
repository: "public.ecr.aws/braintrust/brainstore"
tag: "v1.1.28"
pullPolicy: "IfNotPresent"
locksBackend: "redis"
reader:
name: "brainstore-reader"
replicas: 1
service:
type: ClusterIP
port: 4000
resources:
requests:
cpu: "4"
memory: "8Gi"
limits:
cpu: "8"
memory: "16Gi"
cacheDir: "/mnt/tmp/brainstore"
objectStoreCacheMemoryLimit: "1Gi"
objectStoreCacheFileSize: "50Gi"
verbose: true
volume:
size: "100Gi"
extraEnvVars: []
nodeSelector: {}
tolerations: []
affinity: {}
writer:
name: "brainstore-writer"
replicas: 1
service:
type: ClusterIP
port: 4000
resources:
requests:
cpu: "8"
memory: "16Gi"
limits:
cpu: "16"
memory: "32Gi"
cacheDir: "/mnt/tmp/brainstore"
objectStoreCacheMemoryLimit: "1Gi"
objectStoreCacheFileSize: "50Gi"
verbose: true
volume:
size: "200Gi"
extraEnvVars: []
nodeSelector: {}
tolerations: []
affinity: {}
127 changes: 127 additions & 0 deletions braintrust/ci/values-azure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Test values for Azure deployment
global:
orgName: "test-org"
createNamespace: false
namespace: "braintrust"
labels: {}
namespaceAnnotations: {}
controlPlaneTelemetry: "status,metrics,usage"

cloud: "azure"

azure:
tenantId: "test-tenant-id"
enableAzureContainerStorageDriver: true
enableAzureKeyVaultDriver: true
keyVaultCSIclientID: "test-client-id"
keyVaultName: "test-keyvault"

objectStorage:
azure:
storageAccountName: "teststorageaccount"
brainstoreContainer: "brainstore"
responseContainer: "responses"
codeBundleContainer: "code-bundles"

api:
name: "braintrust-api"
replicas: 1
image:
repository: "public.ecr.aws/braintrust/standalone-api"
tag: "v1.1.28"
pullPolicy: "IfNotPresent"
service:
type: ClusterIP
port: 8000
serviceAccount:
name: "braintrust-api"
resources:
requests:
cpu: "2"
memory: "4Gi"
limits:
cpu: "4"
memory: "8Gi"
allowCodeFunctionExecution: true
backfillDisableHistorical: false
backfillDisableNonhistorical: false
allowInvalidBase64: false
nodeMemoryPercent: "80"
extraEnvVars: []
nodeSelector: {}
tolerations: []
affinity: {}

brainstore:
serviceAccount:
name: "brainstore"
annotations: {}
image:
repository: "public.ecr.aws/braintrust/brainstore"
tag: "v1.1.28"
pullPolicy: "IfNotPresent"
locksBackend: "redis"
reader:
name: "brainstore-reader"
replicas: 1
service:
type: ClusterIP
port: 4000
resources:
requests:
cpu: "4"
memory: "8Gi"
limits:
cpu: "8"
memory: "16Gi"
cacheDir: "/mnt/tmp/brainstore"
objectStoreCacheMemoryLimit: "1Gi"
objectStoreCacheFileSize: "50Gi"
verbose: true
volume:
size: "100Gi"
extraEnvVars: []
nodeSelector: {}
tolerations: []
affinity: {}
writer:
name: "brainstore-writer"
replicas: 1
service:
type: ClusterIP
port: 4000
resources:
requests:
cpu: "8"
memory: "16Gi"
limits:
cpu: "16"
memory: "32Gi"
cacheDir: "/mnt/tmp/brainstore"
objectStoreCacheMemoryLimit: "1Gi"
objectStoreCacheFileSize: "50Gi"
verbose: true
volume:
size: "200Gi"
extraEnvVars: []
nodeSelector: {}
tolerations: []
affinity: {}

azureKeyVaultDriver:
secrets:
- keyVaultSecretName: "redis-connection-string"
keyVaultSecretType: "secret"
kubernetesSecretKey: "REDIS_URL"
- keyVaultSecretName: "postgres-connection-string"
kubernetesSecretKey: "PG_URL"
keyVaultSecretType: "secret"
- keyVaultSecretName: "brainstore-license-key"
keyVaultSecretType: "secret"
kubernetesSecretKey: "BRAINSTORE_LICENSE_KEY"
- keyVaultSecretName: "function-secret-key"
keyVaultSecretType: "secret"
kubernetesSecretKey: "FUNCTION_SECRET_KEY"
- keyVaultSecretName: "azure-storage-connection-string"
keyVaultSecretType: "secret"
kubernetesSecretKey: "AZURE_STORAGE_CONNECTION_STRING"
Loading