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
45 changes: 42 additions & 3 deletions .github/workflows/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:
name: install
needs: chart
runs-on: ${{ (vars.CI_PROVIDER == '' || vars.CI_PROVIDER == 'blacksmith') && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
timeout-minutes: 25
timeout-minutes: 55
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
Expand All @@ -192,6 +192,43 @@ jobs:
- name: Run helm test
run: helm test sim --namespace sim --timeout 5m

# Kubernetes refuses any change to a StatefulSet's volumeClaimTemplates, so
# a label that moves with the chart version there breaks every upgrade of
# the bundled Postgres while fresh installs keep passing. Install the newest
# published chart in its own namespace, then upgrade it to this checkout
# with the same values, so ci/default-values.yaml and ci/kind-overlay.yaml
# must stay valid for the previous published chart too.
- name: Upgrade from the published chart
run: |
set -euo pipefail
chart=oci://ghcr.io/simstudioai/charts/sim
# The newest published version strictly below this checkout's, so a rerun after this
# version is published still tests an upgrade rather than same to same. Helm cannot list
# OCI tags, so read them from the registry API with an anonymous pull token.
current=$(awk '/^version:/ {print $2}' helm/sim/Chart.yaml)
token=$(curl -fsS "https://ghcr.io/token?scope=repository:simstudioai/charts/sim:pull" | jq -r .token)
previous=$(curl -fsS -H "Authorization: Bearer ${token}" \
"https://ghcr.io/v2/simstudioai/charts/sim/tags/list?n=1000" \
| jq -r '.tags[]' \
| grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' \
| { cat; echo "$current"; } | sort -uV \
| awk -v current="$current" '$0 == current {print prev; exit} {prev = $0}')
if [ -z "$previous" ]; then
echo "::error::No published chart version below ${current} to upgrade from."
exit 1
fi
echo "Installing published chart ${previous}, then upgrading to this checkout (${current})"
helm install sim-upgrade "$chart" --version "$previous" \
--namespace sim-upgrade --create-namespace \
--values helm/sim/ci/default-values.yaml \
--values helm/sim/ci/kind-overlay.yaml \
--wait --timeout 10m
helm upgrade sim-upgrade helm/sim \
--namespace sim-upgrade \
--values helm/sim/ci/default-values.yaml \
--values helm/sim/ci/kind-overlay.yaml \
--wait --timeout 10m
# After the test, so it also explains a failed probe, not only a failed
# install. A failed test pod is kept (the hook deletes it only on success),
# so its log says which URL refused.
Expand All @@ -205,6 +242,8 @@ jobs:
kubectl -n sim logs deploy/sim-app --tail=80 || true
kubectl -n sim logs deploy/sim-realtime --tail=80 || true
kubectl -n sim logs sim-test-connection || true
kubectl -n sim-upgrade get pods -o wide || true
kubectl -n sim-upgrade get events --sort-by=.lastTimestamp | tail -20 || true
# Resolved once and shared, so the two publish paths cannot package the same
# immutable chart version with different appVersions -- they run in parallel,
Expand Down Expand Up @@ -296,7 +335,7 @@ jobs:

# Derives appVersion rather than checking it, so the published chart cannot
# be pinned to an older Sim than the release it ships with. The committed
# value is kept current too, but nothing depends on a human remembering.
# value is not kept current; only this step sets the one that ships.
- name: Sync chart appVersion to the release
env:
APP_VERSION: ${{ needs.release-version.outputs.version }}
Expand Down Expand Up @@ -491,7 +530,7 @@ jobs:

# Derives appVersion rather than checking it, so the published chart cannot
# be pinned to an older Sim than the release it ships with. The committed
# value is kept current too, but nothing depends on a human remembering.
# value is not kept current; only this step sets the one that ships.
- name: Sync chart appVersion to the release
if: steps.pages.outputs.exists == 'true'
env:
Expand Down
23 changes: 5 additions & 18 deletions apps/docs/content/docs/platform/self-hosting/kubernetes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,18 @@ Open [http://localhost:3000](http://localhost:3000). For public access, complete

## Public access [#key-configuration]

Configure a public app origin, realtime routing, allowed origins, and TLS together. This same-host example belongs in `public-values.yaml`; replace the ingress class with your installed controller's class:
Configure a public app origin and TLS together; realtime is served on the app host under `/socket.io` by default. This same-host example belongs in `public-values.yaml`; replace the ingress class with your installed controller's class:

```yaml
app:
image:
tag: "v0.9.72"
env:
NEXT_PUBLIC_APP_URL: "https://sim.yourdomain.com"
BETTER_AUTH_URL: "https://sim.yourdomain.com"
NEXT_PUBLIC_SOCKET_URL: "https://sim.yourdomain.com"

realtime:
image:
tag: "v0.9.72"
env:
ALLOWED_ORIGINS: "https://sim.yourdomain.com"

migrations:
image:
Expand All @@ -120,17 +116,12 @@ ingress:
nginx.ingress.kubernetes.io/force-ssl-redirect: null
app:
host: sim.yourdomain.com
realtime:
host: sim.yourdomain.com
paths:
- path: /socket.io
pathType: Prefix
tls:
enabled: true
secretName: sim-tls
```
The app and realtime consume shared app env values; `ALLOWED_ORIGINS` explicitly admits the public app origin. Matching ingress hosts lets the chart route `/socket.io` before the app's `/` path. Keep app, realtime, and migrations on the same image release.
The app and realtime consume shared app env values: `BETTER_AUTH_URL` follows `NEXT_PUBLIC_APP_URL`, and realtime always admits that origin (`realtime.env.ALLOWED_ORIGINS` is only for extra origins). With `ingress.realtime.host` empty, the chart routes `/socket.io` on the app host before the app's `/` path. Keep app, realtime, and migrations on the same image release.

Create `sim-tls` in `simstudio` from your certificate and private key, or configure your certificate manager to populate that Secret:

Expand All @@ -141,12 +132,9 @@ kubectl create secret tls sim-tls -n simstudio \

For a fresh public installation, create the namespace before creating the Secret. Configure DNS and the controller's own HTTPS redirect, upload-size, WebSocket, timeout, and streaming settings. The `null` above removes the chart's legacy nginx redirect annotation; it does not configure another controller.

For a separate realtime hostname, change all three fields together:
A separate realtime hostname is optional. Set it, and the chart points the app at it through `NEXT_PUBLIC_SOCKET_URL` (unless you set that yourself, which you must in `app.secrets.existingSecret` mode):

```yaml
app:
env:
NEXT_PUBLIC_SOCKET_URL: "https://sim-ws.yourdomain.com"
ingress:
realtime:
host: sim-ws.yourdomain.com
Expand All @@ -155,7 +143,7 @@ ingress:
pathType: Prefix
```

Keep `ALLOWED_ORIGINS` set to the app origin, and use a TLS certificate covering both hosts. App/auth URLs remain on `sim.yourdomain.com`.
Use a TLS certificate covering both hosts. App/auth URLs remain on `sim.yourdomain.com`.

Apply your complete values with `helm upgrade --install`, retaining the same secrets as installation. For inline mode, repeat the secret `--set` arguments from the install command and add `-f public-values.yaml`. For secret-store mode, use a complete values file defining that strategy.

Expand Down Expand Up @@ -238,8 +226,7 @@ Configure model provider keys, such as `OPENAI_API_KEY`, through the same select
Use a cloud example as a starting file, not a complete install configuration. Fetch it from the release corresponding to the pinned chart example:

```bash
SIM_RELEASE=v0.9.72
curl -fsSLO "https://raw.githubusercontent.com/simstudioai/sim/$SIM_RELEASE/helm/sim/examples/values-aws.yaml"
curl -fsSLO "https://raw.githubusercontent.com/simstudioai/sim/helm-chart-${CHART_VERSION}/helm/sim/examples/values-aws.yaml"
```

Choose `values-aws.yaml` for EKS, `values-azure.yaml` for AKS, or `values-gcp.yaml` for GKE. Review and replace provider-specific fields before installation:
Expand Down
13 changes: 4 additions & 9 deletions apps/docs/content/docs/platform/self-hosting/networking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,28 @@ sim.yourdomain.com/ → app:3000
sim.yourdomain.com/socket.io → realtime:3002
```

`NEXT_PUBLIC_SOCKET_URL` can be left unset — the client defaults to the page origin.
`NEXT_PUBLIC_SOCKET_URL` can be left unset — the client defaults to the page origin. This is the Helm chart's default: with `ingress.realtime.host` empty, it routes `/socket.io` on the app host.

</Tab>
<Tab value="Two hostnames">

Use separate hostnames when your ingress setup cannot split paths across backends. GKE's example values use this layout.
Optionally, use separate hostnames when your ingress setup cannot split paths across backends. GKE's example values use this layout.

```
sim.yourdomain.com → app:3000
sim-ws.yourdomain.com → realtime:3002
```

Then tell the client where realtime lives, and tell realtime which origins to accept:
Then tell the client where realtime lives:

```yaml
app:
env:
NEXT_PUBLIC_APP_URL: "https://sim.yourdomain.com"
BETTER_AUTH_URL: "https://sim.yourdomain.com"
NEXT_PUBLIC_SOCKET_URL: "https://sim-ws.yourdomain.com"

realtime:
env:
ALLOWED_ORIGINS: "https://sim.yourdomain.com"
```
`ALLOWED_ORIGINS` is the CORS allowlist realtime enforces on socket connections; it must contain the app's origin. The URL keys only need to be set once under `app.env` — the chart writes them into a Secret both Deployments consume.
With the Helm chart, setting `ingress.realtime.host` is enough: the chart sets `NEXT_PUBLIC_SOCKET_URL` to that host unless you do (set it yourself in `app.secrets.existingSecret` mode). Realtime always accepts the `NEXT_PUBLIC_APP_URL` origin; `ALLOWED_ORIGINS` is only for extra origins. The URL keys only need to be set once under `app.env` — the chart writes them into a Secret both Deployments consume.

Both hostnames need DNS records and TLS certificates.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/platform/self-hosting/scaling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ app:
cpu: 1000m
```
The `resources` block above is the chart's default — it is shown so the numbers are visible, not because it changes anything. Only `replicaCount` needs setting unless you are raising the ceiling.
The `resources` block above is the chart's default — it is shown so the numbers are visible, not because it changes anything. Only `replicaCount` needs setting unless you are raising the ceiling. More than one replica needs object storage (S3, Azure Blob, or GCS via `STORAGE_PROVIDER`), or the chart fails to render; `app.storage.allowLocalWithReplicas=true` opts out and keeps uploads on each pod, lost on restart.

The app orchestrates workflows, and local JavaScript runs in Node child workers inside its container. Those workers and in-memory file parsing share the pod's memory limit. OOMKills can terminate in-flight runs.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/platform/self-hosting/verify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Expect `simstudio`, `realtime`, `db`, `redis`, and `cron` to be running, with `m
| --- | --- |
| App does not load | Database connectivity and migration logs. On Helm, failed migrations block the app init sequence. On Compose, the app waits for successful migrations. |
| Sign-in loops or is rejected | Public app/auth origins, scheme, and trusted origins. Confirm the app and realtime use the same `BETTER_AUTH_SECRET`. |
| Socket is unavailable | WebSocket upgrades and `/socket.io` routing. For a separate realtime host, set `NEXT_PUBLIC_SOCKET_URL` and include the app origin in realtime's `ALLOWED_ORIGINS`. |
| Socket is unavailable | WebSocket upgrades and `/socket.io` routing. Realtime defaults to the app host; for a separate realtime host, `NEXT_PUBLIC_SOCKET_URL` must point at it (the Helm chart sets it from `ingress.realtime.host` unless you do). `ALLOWED_ORIGINS` is only for origins beyond `NEXT_PUBLIC_APP_URL`. |
| Edits do not propagate | Realtime connectivity and Redis on every replica; verify which pods hold the connections. |
| Workflow execution fails | Provider egress, saved credentials, and app logs. A decryption error can mean the current `ENCRYPTION_KEY` differs from the key that encrypted the credential. |
| Cloud upload fails | Bucket CORS for the Sim origin and signed headers; server permissions to complete multipart uploads. S3 completion needs `s3:ListMultipartUploadParts`. |
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/scripts/fixtures/content-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -173934,7 +173934,7 @@
{
"lang": "yaml",
"meta": null,
"sha256": "795844d38101f8147ddbc9228260ac3079e0ab89a452246656ac336c74f131ce",
"sha256": "ca65367d373ed281d6a04c4677304bffbbc0c590d97d958f02404d65476790bd",
"bytes": 701,
"line": 85
},
Expand All @@ -173948,7 +173948,7 @@
{
"lang": "yaml",
"meta": null,
"sha256": "df68603f8a69b1564ae8792b1bf46bead93f1635ad2cf6aba1b0e53e250f2276",
"sha256": "b9ce9aab8d379f8e9173ab0d3fff2feaee5253bd26c6db477e96e984e9925970",
"bytes": 176,
"line": 138
},
Expand Down Expand Up @@ -173976,7 +173976,7 @@
{
"lang": "bash",
"meta": null,
"sha256": "d829002daa160ca953fad98f7df3af21515ccbd34feb96e5fa8f4d5d6c314278",
"sha256": "c970c43eea56151320bf4b5baa8118312be6dbfcf47eff7caf2210731151e359",
"bytes": 130,
"line": 232
},
Expand Down Expand Up @@ -174233,7 +174233,7 @@
{
"lang": "yaml",
"meta": null,
"sha256": "770a221e2ed89426cca37de3d61fce8a5d99e1f0cf5db0c5fe4586473de3ed0d",
"sha256": "ad130fab18b02e1e22b7229ed4d14696a5abb404e383e9738e0b2bcf4d004d47",
"bytes": 243,
"line": 35
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ postgresql:
existingSecret:
enabled: true
name: sim-postgres-secret
passwordKey: POSTGRES_PASSWORD
```
**The chart cannot introspect your Secret.** If you forget a required key, the pod will fail at runtime with `CreateContainerConfigError: secret key "X" not found`. The required keys are: `BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, `INTERNAL_API_SECRET`, plus `CRON_SECRET` when cronjobs are enabled.
Expand Down
14 changes: 8 additions & 6 deletions helm/sim/.claude/skills/sim-helm/references/values-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ The Sim chart splits configuration across **four** layers. Understanding which l
┌───────────────────────────────────────────────────────────────────────────┐
│ Layer 2: app.envDefaults / realtime.envDefaults │
│ → Rendered as inline env: on the Deployment │
│ → SKIPPED for any key already set in app.env (or realtime.env) │
│ → SKIPPED for any key already set in app.env (or realtime.env), or │
│ mapped in externalSecrets.remoteRefs.app; none in existingSecret mode │
│ → Use for: operational tunables and safe fallback defaults │
│ → Examples: NODE_ENV=production, RATE_LIMIT_*, IVM_* │
└───────────────────────────────────────────────────────────────────────────┘
Expand All @@ -27,7 +28,9 @@ The Sim chart splits configuration across **four** layers. Understanding which l
▼
┌───────────────────────────────────────────────────────────────────────────┐
│ Layer 3: chart-computed (inline env: on the Deployment) │
│ → DATABASE_URL, SOCKET_SERVER_URL, OLLAMA_URL, PII_URL │
│ → DATABASE_URL, SOCKET_SERVER_URL, OLLAMA_URL, PII_URL │
│ → BETTER_AUTH_URL=$(NEXT_PUBLIC_APP_URL) and NEXT_PUBLIC_SOCKET_URL │
│ (separate realtime ingress host), only when you set them nowhere │
│ → Derived from postgresql.* / externalDatabase.* / service.* values │
│ → CANNOT be overridden via app.env — chart filters them out │
└───────────────────────────────────────────────────────────────────────────┘
Expand All @@ -46,7 +49,7 @@ The Sim chart splits configuration across **four** layers. Understanding which l

**ESO compatibility.** When `externalSecrets.enabled=true`, the chart-managed Secret is **not rendered** — ESO renders one instead. Anything in Layer 1 must be mapped via `remoteRefs.app.<KEY>` or it's silently missing. Layers 2–4 are unaffected by ESO.

**Override precedence.** *Non-empty* values set in `app.env` (Layer 1 overrides) win over `envDefaults` (Layer 2) — so users who already had operational tunables in `app.env` continue to work. An *empty* `app.env` value does not override: it reads as "not specified" and the Layer 2 default still applies. To remove a key, override it with `null` (see "I want to REMOVE a key the chart sets" below).
**Override precedence.** *Non-empty* values set in `app.env` (Layer 1 overrides) win over `envDefaults` (Layer 2) — so users who already had operational tunables in `app.env` continue to work. In `app.secrets.existingSecret` mode no `envDefaults` are inlined (the pre-created Secret is the source of truth) and `app.env` values are inlined instead, so overrides go in `app.env`. An *empty* `app.env` value does not override: it reads as "not specified" and the Layer 2 default still applies. To remove a key, override it with `null` (see "I want to REMOVE a key the chart sets" below).

## Where keys live — the canonical list

Expand All @@ -56,7 +59,7 @@ The exhaustive list of keys per layer lives in `helm/sim/values.yaml`. Read the
|---|---|---|
| Auth secrets | 1 (app.env) | `BETTER_AUTH_SECRET`, `ENCRYPTION_KEY`, `INTERNAL_API_SECRET`, `CRON_SECRET`, `API_ENCRYPTION_KEY` |
| Provider API keys | 1 (app.env) | `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_CLIENT_SECRET`, etc. |
| Per-environment URLs | 1 (app.env) | `NEXT_PUBLIC_APP_URL`, `BETTER_AUTH_URL`, `NEXT_PUBLIC_SOCKET_URL` |
| Per-environment URLs | 1 (app.env) | `NEXT_PUBLIC_APP_URL` (`BETTER_AUTH_URL` follows it unless set; set both in the Secret in existingSecret mode) |
| Feature flags | 1 (app.env) | `ENTERPRISE_ENABLED`, `ACCESS_CONTROL_ENABLED`, `ORGANIZATIONS_ENABLED`, `SSO_ENABLED` (server only; enterprise features have no `NEXT_PUBLIC_` twins) |
| Operational defaults | 2 (envDefaults) | `NODE_ENV=production`, `EMAIL_VERIFICATION_ENABLED=false`, `VERTEX_LOCATION=us-central1` |
| Rate limits | 2 (envDefaults) | `RATE_LIMIT_WINDOW_MS`, `RATE_LIMIT_FREE_SYNC`, etc. |
Expand Down Expand Up @@ -124,10 +127,9 @@ Caveat worth passing to operators: `null` has no effect under `helm upgrade --re
app:
env:
NEXT_PUBLIC_APP_URL: "https://sim.example.com"
BETTER_AUTH_URL: "https://sim.example.com"
```

This is the right answer for any clustered deploy. The chart's default is `http://localhost:3000` (Layer 2) — fine for kind/minikube, broken for production. The realtime Deployment also reads these via the shared Secret.
This is the right answer for any clustered deploy. `BETTER_AUTH_URL` is set to `$(NEXT_PUBLIC_APP_URL)` unless you set it (in `app.secrets.existingSecret` mode the chart sets nothing, so the Secret must hold both). The chart's default is `http://localhost:3000` (Layer 2) — fine for kind/minikube, broken for production. The realtime Deployment also reads these via the shared Secret.

### "I want to inject a value from another ConfigMap"

Expand Down
2 changes: 1 addition & 1 deletion helm/sim/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: sim
description: A Helm chart for Sim - the open-source AI workspace where teams build, deploy, and manage AI agents
type: application
version: 1.19.0
version: 1.20.0
appVersion: "v0.8.26"
kubeVersion: ">=1.25.0-0"
home: https://sim.ai
Expand Down
Loading
Loading