Skip to content

Commit 90fb33c

Browse files
authored
fix(self-hosting): let sim-setup update adopt a manually installed compose file, and correct the last doc gaps (#10786)
* fix(self-hosting): let sim-setup update adopt a manually installed compose file, and correct the last doc gaps * fix(docs): escape backslashes before pipes in generated self-hosting tables * fix(sim-setup): pull latest images on every k8s start, and drop a now-used export from the baseline * fix(self-hosting): fit the self-check to cold EKS Nitro starts, schedule pre-pull where sandboxes run, and keep sandboxes from consolidation * fix(self-hosting): honor renamed runtime classes, digest pins, and selector conflicts * fix(sim-setup): keep realtime and migrations on the app's pinned release, and pass image tags as strings
1 parent 458a31f commit 90fb33c

37 files changed

Lines changed: 835 additions & 143 deletions

‎apps/docs/content/docs/platform/self-hosting/docker.mdx‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The wizard writes `docker-compose.prod.yml` and a generated `.env` to `./sim`, a
2424

2525
## Manual install [#production-setup]
2626

27-
Fetch the Compose file from the [release](https://github.com/simstudioai/sim/releases) you want to run:
27+
Fetch the Compose file from the [release](https://github.com/simstudioai/sim/releases) you want to run. Use a `vX.Y.Z` release tag (e.g. the release marked Latest), not a `helm-chart-*` tag:
2828

2929
```bash
3030
mkdir sim && cd sim
@@ -78,11 +78,11 @@ curl -fsS http://localhost:3000/api/health
7878

7979
Then run [Verify your install](/platform/self-hosting/verify).
8080

81-
Without object storage, uploads go to the `sim_uploads` volume on this host. Back it up, or configure [object storage](/platform/self-hosting/object-storage).
81+
Without object storage, uploads go to the `sim_uploads` volume on this host (Docker names it `<project>_sim_uploads`, after the Compose project name). Back it up with the commands in [Upgrades](/platform/self-hosting/upgrades#upgrade-procedure), or configure [object storage](/platform/self-hosting/object-storage).
8282

8383
## Serve your domain over TLS
8484

85-
Put a TLS proxy in front of the stack. Route `/socket.io` to realtime on port 3002 and everything else to the app on port 3000, with WebSocket upgrades and response streaming enabled. [Networking](/platform/self-hosting/networking#reverse-proxy-configuration) has Caddy, Nginx, and Traefik configurations.
85+
Put a TLS proxy in front of the stack. Route `/socket.io` to realtime on port 3002 and everything else to the app on port 3000, with WebSocket upgrades and response streaming enabled. [Networking](/platform/self-hosting/networking#reverse-proxy-configuration) has Caddy and Nginx configurations.
8686

8787
When the proxy runs on the same host, publish the app and realtime on loopback only. Keep the ports, which `sim-setup` checks:
8888

@@ -142,17 +142,17 @@ To run Ollama, LM Studio, or vLLM with this stack, see [Local models](/platform/
142142

143143
## The `sim-setup` CLI
144144

145-
Run `npx sim-setup <command>`. Run the wizard, `doctor`, and `config` from the configuration directory. Lifecycle commands find running Compose stacks, source checkouts, and Helm releases, and apply every Compose file a stack was started with. A stopped stack uses `COMPOSE_FILE` from its `.env`. Compose does not record profiles, so set `COMPOSE_PROFILES` in `.env` for a stack that uses them.
145+
Run `npx sim-setup <command>`. Run the wizard, `doctor`, and `config` from the configuration directory. Lifecycle commands find running Compose stacks, source checkouts, and the `sim-dev` Helm release that `--mode k8s` creates (not other Helm releases), and apply every Compose file a stack was started with. A stopped stack uses `COMPOSE_FILE` from its `.env`. Compose does not record profiles, so set `COMPOSE_PROFILES` in `.env` for a stack that uses them.
146146

147147
| Command | Behavior |
148148
| --- | --- |
149149
| `sim-setup` | Wizard. `--quick` uses defaults; `--mode compose\|dev\|k8s` picks the target (dev and k8s need a source checkout: run `bun run sim-setup` from the repo root); `--url <origin>` sets a Compose install's public URL. |
150150
| `status` | Reports detected installations and their health. |
151-
| `logs` | Follows Compose logs or the Kubernetes app Deployment. |
151+
| `logs` | Follows Compose logs or the `sim-dev` release's app Deployment. |
152152
| `start` / `stop` / `restart` | Manages Compose services. For Kubernetes, prints the commands instead of running them. `restart` does not apply changed environment; recreate the containers. |
153-
| `update` | Pulls the images for `SIM_VERSION` (or rebuilds a source stack) and recreates the services. `--yes` skips the prompt about uploads still inside an old app container. Refuses dev and Kubernetes installs. |
154-
| `down` | Removes managed containers, or uninstalls the Helm release, after confirming. Data volumes remain. |
155-
| `reset` | Archives env files and removes managed Compose data after confirming. On Helm it uninstalls the release; PostgreSQL PVCs remain. |
153+
| `update` | Refreshes the Compose file, pulls the images for `SIM_VERSION` (or rebuilds a source stack), and recreates the services. Works for `sim-setup` and manual installs; a manually downloaded Compose file is backed up beside itself before it is replaced. `--yes` skips the prompts for that and for uploads still inside an old app container. Refuses dev and Kubernetes installs. |
154+
| `down` | Removes managed containers, or uninstalls the `sim-dev` Helm release, after confirming. Data volumes remain. |
155+
| `reset` | Archives env files and removes managed Compose data after confirming. On Kubernetes it uninstalls the `sim-dev` release; PostgreSQL PVCs remain. |
156156
| `config` | Reports configured capabilities and integrations. |
157157
| `doctor` | Checks env files and reachable services. `--fix` writes supported repairs; `--json` prints structured findings. |
158158
| `add <feature>` | Configures `email`, `storage`, `sandbox`, `jobs`, `knowledge`, `knowledge-embeddings`, `chat`, `llm`, or `integration <slug>` in a writable `.env`. Refuses Helm releases. |
@@ -166,4 +166,6 @@ Run `npx sim-setup <command>`. Run the wizard, `doctor`, and `config` from the c
166166

167167
## Back up and upgrade [#commands]
168168

169-
Back up the database, the `sim_uploads` volume, and `.env`. [Upgrades](/platform/self-hosting/upgrades) has the backup, update, and rollback commands.
169+
Back up the database, the `<project>_sim_uploads` volume, and `.env`. [Upgrades](/platform/self-hosting/upgrades) has the backup, update, and rollback commands.
170+
171+
To upgrade, set `SIM_VERSION` in `.env` and run `npx sim-setup update`, for a `sim-setup` or a manual install; it backs up a manually downloaded Compose file first, and `--yes` runs it without prompting. Without `sim-setup`, download `docker-compose.prod.yml` from the new `vX.Y.Z` tag as in [Manual install](#production-setup), set `SIM_VERSION` to that tag, and run `docker compose pull && docker compose up -d` (with `-f docker-compose.prod.yml` unless `COMPOSE_FILE` is set).

‎apps/docs/content/docs/platform/self-hosting/kubernetes.mdx‎

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ The Helm chart deploys the app, realtime, migrations (as an init container on th
1414
- An ingress controller and a TLS certificate for public access.
1515
- `metrics-server` for autoscaling, and the External Secrets Operator if you use it.
1616

17+
EKS Auto Mode has no default StorageClass, so the bundled PostgreSQL's volume stays Pending. Create one with Auto Mode's EBS provisioner (the name `gp3` is the one `values-aws.yaml` selects), or set `postgresql.persistence.storageClass` to a class you have:
18+
19+
```yaml
20+
apiVersion: storage.k8s.io/v1
21+
kind: StorageClass
22+
metadata:
23+
name: gp3
24+
annotations:
25+
storageclass.kubernetes.io/is-default-class: "true"
26+
provisioner: ebs.csi.eks.amazonaws.com
27+
volumeBindingMode: WaitForFirstConsumer
28+
parameters:
29+
type: gp3
30+
encrypted: "true"
31+
```
32+
1733
## 1. Pin the chart
1834
1935
Each chart version installs one Sim release, its `appVersion`. Resolve the newest chart once and reuse the version for every later command:
@@ -95,6 +111,7 @@ postgresql:
95111
size: 50Gi
96112
```
97113

114+
- With External Secrets, move `NEXT_PUBLIC_APP_URL` from `app.env` to `app.envDefaults` and `realtime.envDefaults`: the chart refuses an `app.env` key that `externalSecrets.remoteRefs.app` does not map. See the [External Secrets example](#secret-store-examples).
98115
- `BETTER_AUTH_URL` follows `NEXT_PUBLIC_APP_URL`, and realtime always admits that origin. In existing-Secret mode the chart derives neither: set `NEXT_PUBLIC_APP_URL` and `BETTER_AUTH_URL` in the Secret or `app.env`.
99116
- Realtime is served on the app host under `/socket.io`. For a separate realtime host, set `ingress.realtime.host`; the chart points the app at it with `NEXT_PUBLIC_SOCKET_URL` (in existing-Secret mode, set that yourself). Cover both hosts with the certificate.
100117
- The `null` removes the chart's default ingress-nginx annotation. Configure your controller's own HTTPS redirect, body size, WebSocket, timeout, and streaming settings; see [Networking](/platform/self-hosting/networking).
@@ -122,7 +139,7 @@ helm install sim oci://ghcr.io/simstudioai/charts/sim \
122139
--set postgresql.auth.password="$POSTGRES_PASSWORD"
123140
```
124141

125-
With an existing Secret or External Secrets, drop the `--set` lines. Render first with `helm template` and the same arguments to review what will be applied.
142+
With an existing Secret or External Secrets, drop the `--set` lines; with External Secrets, `NEXT_PUBLIC_APP_URL` must be in `app.envDefaults` and `realtime.envDefaults`, not `app.env` (step 5). Render first with `helm template` and the same arguments to review what will be applied.
126143

127144
For a trial without ingress, install with `app.env.NEXT_PUBLIC_APP_URL=http://localhost:3000` and `ingress.enabled=false` in place of the public values, then forward both services and open [http://localhost:3000](http://localhost:3000):
128145

@@ -140,7 +157,7 @@ kubectl get cronjobs -n simstudio
140157
curl -fsS https://sim.yourdomain.com/api/health
141158
```
142159

143-
Run `helm test sim -n simstudio --logs`, then [Verify your install](/platform/self-hosting/verify).
160+
Run `helm test sim -n simstudio --logs --timeout 10m`, then [Verify your install](/platform/self-hosting/verify).
144161

145162
## Secret store examples [#secret-store-examples]
146163

@@ -159,7 +176,7 @@ postgresql:
159176
name: sim-postgresql-secret
160177
```
161178

162-
**External Secrets Operator.** Create the store and remote keys first. Non-secret values go in `envDefaults`:
179+
**External Secrets Operator.** Create the store and remote keys first. Non-secret values go in `envDefaults`, including `NEXT_PUBLIC_APP_URL` from step 5: the chart refuses any `app.env` key not mapped in `remoteRefs.app`:
163180

164181
```yaml
165182
app:

‎apps/docs/content/docs/platform/self-hosting/reference-architectures.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ Each tab names the chart's example values file. Fetch it at your chart's `helm-c
3535
| You provision | Notes |
3636
| --- | --- |
3737
| EKS cluster | Kubernetes 1.25 or later |
38-
| EBS CSI driver and a `gp3` StorageClass | The example selects `gp3`; confirm it exists with the installed provisioner |
38+
| EBS CSI driver and a `gp3` StorageClass | The example selects `gp3`; confirm it exists with the installed provisioner. EKS Auto Mode has no default StorageClass; create one as in [Kubernetes prerequisites](/platform/self-hosting/kubernetes#prerequisites) |
3939
| AWS Load Balancer Controller | ALB ingress |
4040
| ACM certificate | ALB discovers it from the ingress hosts, or pin it with `alb.ingress.kubernetes.io/certificate-arn`. ALB cannot use a Kubernetes TLS Secret |
4141
| RDS or Aurora PostgreSQL | Reachable from the cluster subnets |
4242
| S3 buckets | One per file purpose |
4343
| ElastiCache | Optional; the bundled Redis also works |
4444

45-
**Identity.** Bind an IAM role to the ServiceAccount with IRSA. Grant it access to your buckets and to anything else you enable, such as Bedrock or SES. **Timeouts.** Raise the ALB idle timeout; see [Networking](/platform/self-hosting/networking#aws-alb-ingress). **Sandboxes.** EKS sandboxes run under Nitro Sandboxes; see [Kubernetes sandboxes](/platform/self-hosting/sandboxes#kubernetes-no-third-party).
45+
**Identity.** Bind an IAM role to the ServiceAccount with IRSA. Grant it access to your buckets and to anything else you enable, such as Bedrock or SES. **Timeouts.** Raise the ALB idle timeout; see [Networking](/platform/self-hosting/networking#aws-alb-ingress). **Sandboxes.** EKS sandboxes run under Nitro Sandboxes; see [Kubernetes sandboxes](/platform/self-hosting/sandboxes#kubernetes-no-third-party). On Auto Mode they also need the `amazon-vpc-cni` ConfigMap that turns on NetworkPolicy enforcement ([Amazon EKS Auto Mode](/platform/self-hosting/sandboxes#amazon-eks-auto-mode)).
4646

4747
#### AWS GovCloud (US)
4848

0 commit comments

Comments
 (0)