Skip to content

Commit 607367c

Browse files
waleedlatif1claude
andcommitted
fix: audit the docs against source instead of one review round at a time
Eight review rounds kept finding defects because I was patching what the last round flagged and writing new prose in the process, which nothing then checked. This is a full pass over the Compose files, the sim-setup CLI, and the chart. The mirror inventory (Greptile's blocker): the bare device-plugin override changes where the chart pulls from, to `<registry>/nvidia/k8s-device-plugin`, while the inventory tells operators to mirror to `<registry>/nvcr.io/nvidia/...`. Following both instructions produced an unpopulated path. Verified by rendering the chart both ways; the header now names the override's destination. Compose: - Nine `docker compose` commands across troubleshooting, verify, and background-jobs had no `-f`. The repo ships no default compose file, so every one of them failed with "no configuration file provided". - `simstudio` declares `env_file: .env` in all three files, so the LM Studio fix does not need a hand-edited `environment:` block — and hand-editing a managed Compose file makes `sim-setup update` refuse. - `OLLAMA_URL` as a one-shot shell prefix reverts to the localhost default on the next `up -d`, pointing the container at itself. It belongs in `.env`. - `pg_dump` through `exec` without `-T` corrupts the dump; the restore beside it already used `-T`. - Live cross-process status is a Redis consequence, not a cron one. - The local Compose file was missing from three "the file that started your install" lists and from the exposed-Postgres warning. - No shipped Compose file defines a `pii` service. - The rollback said "edit .env" but appended a second SIM_VERSION line. sim-setup CLI — the table stated Compose behavior as universal: - `down` runs `helm uninstall` on Kubernetes and removes only Postgres and Redis on a source checkout; both prompt first. - `reset` archives four env files on anything but Compose, including when no install is detected. - `--no-open` was described backwards: the link always prints, the flag skips the download prompt. - `start`/`restart` print port-forward hints on Kubernetes, not equivalents. - `--dir` is a global option and scopes the lifecycle commands. - `--quick` only preselects the setup style; `add` and `desktop` have refusals worth knowing; the update hand-edit refusal is narrower than stated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015BwsJTEQRzWJaY4BRCkPZt
1 parent 1ec7621 commit 607367c

9 files changed

Lines changed: 54 additions & 35 deletions

File tree

apps/docs/content/docs/platform/enterprise/data-retention.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ PII redaction runs against a standalone [Presidio](https://microsoft.github.io/p
216216
# Helm — setting pii.enabled wires this for you. Set it by hand only for an
217217
# external Presidio, substituting your release name and namespace.
218218
PII_URL=http://<release>-pii.<namespace>.svc.cluster.local:5001
219-
# Docker Compose — the PII service name on your network
219+
# Docker Compose — no shipped file defines a PII service. Add one to the
220+
# same project, then use its service name.
220221
# PII_URL=http://pii:5001
221222
```
222223

apps/docs/content/docs/platform/self-hosting/background-jobs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ To drop a job you do not need, comment out its line in `docker/crontab` and rest
127127

128128
Create a workflow with a Schedule trigger set to every minute, deploy it, and watch the Logs view. An execution should appear within ~2 minutes. If nothing appears:
129129

130-
1. Check the scheduler's own logs — `docker compose logs cron`, or `kubectl get cronjobs -n simstudio` for a recent `LAST SCHEDULE`.
130+
1. Check the scheduler's own logs — `docker compose -f docker-compose.prod.yml logs cron`, or `kubectl get cronjobs -n simstudio` for a recent `LAST SCHEDULE`.
131131
2. Confirm the app and the scheduler share the same `CRON_SECRET`. A mismatch shows up as `401` in the scheduler log.
132132
3. A `202` means the endpoint accepted the run; it does not confirm a schedule was due, so check the Logs view.
133133

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

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ For nginx, Traefik, or a cloud load balancer — and for the GKE websocket timeo
100100

101101
## Ollama
102102

103-
`docker-compose.ollama.yml` is a **development** stack, not a drop-in swap for `docker-compose.prod.yml`. It builds `simstudio`, `realtime`, and `migrations` from the source checkout instead of pulling published images, and it ships neither a `redis` service nor a `cron` service. Without an external Redis, pub/sub falls back to a process-local emitter and CLI authentication stops working entirely, since its approval store has no fallback; the idempotency store and execution progress markers do fall back to Postgres. And with no cron service, live cross-process status and every [background job](/platform/self-hosting/background-jobs) are missing. For production with local models, keep `docker-compose.prod.yml` and point `OLLAMA_URL` at an Ollama instance, as under [External Ollama](#external-ollama) below.
103+
`docker-compose.ollama.yml` is a **development** stack, not a drop-in swap for `docker-compose.prod.yml`. It builds `simstudio`, `realtime`, and `migrations` from the source checkout instead of pulling published images, and it ships neither a `redis` service nor a `cron` service. Without an external Redis, pub/sub falls back to a process-local emitter and CLI authentication stops working entirely, since its approval store has no fallback; the idempotency store and execution progress markers do fall back to Postgres. And with no cron service, every [background job](/platform/self-hosting/background-jobs) is missing. For production with local models, keep `docker-compose.prod.yml` and point `OLLAMA_URL` at an Ollama instance, as under [External Ollama](#external-ollama) below.
104104

105105
Always pass a server profile alongside `setup`. With `--profile setup` on its own no Ollama server starts and `model-setup` waits forever.
106106

@@ -125,12 +125,18 @@ docker compose -f docker-compose.ollama.yml exec ollama-cpu ollama pull llama3.2
125125

126126
If Ollama runs on your host machine (not in Docker):
127127

128+
Set it in the `.env` next to your Compose file. A one-shot shell prefix satisfies the interpolation for that command only, so the next `up -d` silently reverts to the `http://localhost:11434` default and the container points at itself:
129+
128130
```bash
129-
# macOS/Windows
130-
OLLAMA_URL=http://host.docker.internal:11434 docker compose -f docker-compose.prod.yml up -d
131+
# .env — macOS/Windows
132+
OLLAMA_URL=http://host.docker.internal:11434
131133

132134
# Linux - use your host IP
133-
OLLAMA_URL=http://192.168.1.100:11434 docker compose -f docker-compose.prod.yml up -d
135+
# OLLAMA_URL=http://192.168.1.100:11434
136+
```
137+
138+
```bash
139+
docker compose -f docker-compose.prod.yml up -d
134140
```
135141

136142
<Callout type="warn">
@@ -156,27 +162,30 @@ Both the server root shown above and a URL ending in `/v1` are accepted. After r
156162
```bash
157163
# Pick the file that started your install.
158164
COMPOSE_FILE=docker-compose.prod.yml
165+
# COMPOSE_FILE=docker-compose.local.yml
159166
# COMPOSE_FILE=docker-compose.ollama.yml
160167
docker compose -f "$COMPOSE_FILE" up -d --force-recreate simstudio
161168
```
162169

163170
## The `sim-setup` CLI
164171

165-
`npx sim-setup` also manages an existing install created from the production or local-development Compose files. It does not detect or manage an Ollama-stack install. Run it from the directory holding your `.env` and Compose file. The table drops the `npx` prefix for brevity — keep it unless you installed the package globally.
172+
`npx sim-setup` also manages an existing install created from the production or local-development Compose files. It does not detect or manage an Ollama-stack install. Run `doctor`, `config`, and the wizard from the directory holding your `.env` and Compose file; the lifecycle commands find a running stack wherever it was started. The table drops the `npx` prefix for brevity — keep it unless you installed the package globally.
166173

167174
| Command | What it does |
168175
|---|---|
169-
| `sim-setup` | The setup wizard. `--quick` skips the prompts, `--dir <path>` picks the directory, `--mode compose\|dev\|k8s` picks the target (`dev` and `k8s` need a source checkout) |
176+
| `sim-setup` | The setup wizard. `--quick` takes the defaults and asks only the essential questions, `--mode compose\|dev\|k8s` picks the target (`dev` and `k8s` need a source checkout) |
170177
| `sim-setup status` | Show what is installed and healthy |
171-
| `sim-setup logs` | Follow logs. On a source checkout it prints where the logs are — the dev server streams in its own terminal — rather than following a stream |
172-
| `sim-setup start` / `stop` / `restart` | Bring the install up, down, or cycle it. On a source checkout this covers only the managed Postgres and Redis containers — the dev server is yours to start and stop. On Kubernetes it prints the equivalent `kubectl` commands instead of acting |
178+
| `sim-setup logs` | Follow logs. On Kubernetes it follows the app deployment only; on a source checkout it prints where the logs are — the dev server streams in its own terminal — rather than following a stream |
179+
| `sim-setup start` / `stop` / `restart` | Bring the install up, down, or cycle it. On a source checkout this covers only the managed Postgres and Redis containers — the dev server is yours to start and stop. On Kubernetes it acts on nothing: `stop` prints the `kubectl scale` equivalents, and `start` and `restart` print the port-forward commands for reaching the release |
173180
| `sim-setup update` | Pull or rebuild images and apply them. Compose installs only — it refuses on source checkouts and Kubernetes, which update through git and `helm upgrade` |
174-
| `sim-setup down` | Remove containers, keep the data |
175-
| `sim-setup reset` | Archive `.env` and wipe managed data. On Kubernetes it runs `helm uninstall`, which leaves the Postgres volumes behind — they come from a StatefulSet's `volumeClaimTemplates`, which Kubernetes never deletes. Delete those PVCs yourself to reset the data |
181+
| `sim-setup down` | After a confirmation prompt, remove containers and keep the data. On a source checkout it removes only the managed Postgres and Redis containers, keeping their volume. On Kubernetes it runs `helm uninstall` on the whole release |
182+
| `sim-setup reset` | After a confirmation prompt, archive the env files and wipe managed data. A Compose install archives the `.env` beside its Compose file; a source checkout, a Kubernetes install, and an invocation with no install detected all archive `apps/sim/.env`, `apps/realtime/.env`, `packages/db/.env`, and the root `.env`. On Kubernetes it runs `helm uninstall`, which leaves the Postgres volumes behind — they come from a StatefulSet's `volumeClaimTemplates`, which Kubernetes never deletes. Delete those PVCs yourself to reset the data |
176183
| `sim-setup config` | Show configured capabilities and integrations |
177184
| `sim-setup doctor` | Check the setup. `--fix` repairs what it can, `--json` prints machine-readable output |
178-
| `sim-setup add <feature>` | Configure one capability: `email`, `storage`, `sandbox`, `jobs`, `cache`, `knowledge`, `knowledge-embeddings`, `chat`, `llm`, or `integration <slug>` |
179-
| `sim-setup desktop` | Resolve the desktop installer for this deployment. `--url <url>` skips discovery, `--no-open` prints the link instead of opening it |
185+
| `sim-setup add <feature>` | Configure one capability: `email`, `storage`, `sandbox`, `jobs`, `cache`, `knowledge`, `knowledge-embeddings`, `chat`, `llm`, or `integration <slug>`. Writes to the `.env` beside your Compose file — recreate the app container to apply — or to `apps/sim/.env` on a source checkout. It refuses when no configuration is writable, when more than one is, and for Helm releases |
186+
| `sim-setup desktop` | Resolve the desktop installer for this deployment. `--url <url>` skips discovery, and is required when several detected configurations name different `NEXT_PUBLIC_APP_URL` origins. `--no-open` skips the "Download it now?" prompt — the link is printed either way |
187+
188+
`--dir <path>` is accepted by every command, not just the wizard. On a standalone install it also scopes the lifecycle commands to that directory's install, which is how you disambiguate when more than one exists.
180189

181190
## Commands
182191

@@ -194,6 +203,6 @@ npx sim-setup update
194203
<FAQ items={[
195204
{ question: "Do scheduled workflows work on Docker Compose?", answer: "Yes. The cron service runs the same jobs the Helm chart schedules as Kubernetes CronJobs, using the schedules in docker/crontab. It needs CRON_SECRET — without it the service prints what to set and exits, and the rest of the stack keeps running."},
196205
{ question: "Why is there a Redis container?", answer: "Redis backs pub/sub for live Chat task status and table events, plus shared caches. Pub/sub has no fallback that works across processes, so live status would not stream without it. The port is deliberately not published so it cannot collide with a local Redis."},
197-
{ question: "How do I back up and restore the database?", answer: "Back up with: docker compose -f docker-compose.prod.yml exec db pg_dump -U postgres simstudio > backup.sql. Restore with: docker compose -f docker-compose.prod.yml exec -T db psql -U postgres simstudio < backup.sql. The database data is persisted in a Docker volume named postgres_data."},
206+
{ question: "How do I back up and restore the database?", answer: "Back up with: docker compose -f docker-compose.prod.yml exec -T db pg_dump -U postgres simstudio > backup.sql. The -T matters — without it exec allocates a TTY and corrupts the redirected dump. Restore with: docker compose -f docker-compose.prod.yml exec -T db psql -U postgres simstudio < backup.sql. The database data is persisted in a Docker volume named postgres_data."},
198207
{ question: "Can I customize the PostgreSQL credentials?", answer: "Yes. The docker-compose.prod.yml uses environment variable defaults: POSTGRES_USER (default: postgres), POSTGRES_PASSWORD (default: postgres), POSTGRES_DB (default: simstudio), and POSTGRES_PORT (default: 5432). Set these in your .env file to override them." },
199208
]} />

apps/docs/content/docs/platform/self-hosting/security.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ The service bundles ~2.2 GB of spaCy models, so first start takes around three m
257257
## The shipped Compose file publishes Postgres
258258

259259
<Callout type="error">
260-
`docker-compose.prod.yml` maps the database to the host: `${POSTGRES_PORT:-5432}:5432`, with `POSTGRES_USER` and `POSTGRES_PASSWORD` both defaulting to `postgres`. A plain `docker compose up -d` against that file, on a machine with a public interface, therefore exposes an open Postgres on 5432 with credentials anyone can guess. The Ollama stack maps the database the same way, so apply the fix to whichever file started your install.
260+
`docker-compose.prod.yml` maps the database to the host: `${POSTGRES_PORT:-5432}:5432`, with `POSTGRES_USER` and `POSTGRES_PASSWORD` both defaulting to `postgres`. A plain `docker compose up -d` against that file, on a machine with a public interface, therefore exposes an open Postgres on 5432 with credentials anyone can guess. The local and Ollama stacks map the database the same way, so apply the fix to whichever file started your install.
261261

262262
The [Docker guide](/platform/self-hosting/docker#1-configure-environment) tells you to generate `POSTGRES_PASSWORD` before the first start — do that, and additionally close the port:
263263

apps/docs/content/docs/platform/self-hosting/troubleshooting.mdx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@ On a standalone Compose install, run it from the directory holding your `.env` a
1818
## Database connection failed
1919

2020
```bash
21+
# The file that started your install — no bare `docker compose` works, the
22+
# repo ships no default docker-compose.yml.
23+
COMPOSE_FILE=docker-compose.prod.yml
24+
2125
# Check database is running
22-
docker compose ps db
26+
docker compose -f "$COMPOSE_FILE" ps db
2327

2428
# Test connection
25-
docker compose exec db psql -U postgres -c "SELECT 1"
29+
docker compose -f "$COMPOSE_FILE" exec db psql -U postgres -c "SELECT 1"
2630
```
2731

2832
Verify `DATABASE_URL` format: `postgresql://user:pass@host:5432/database`
@@ -59,12 +63,12 @@ Two things this does not cover:
5963

6064
Sim identifies dynamically discovered LM Studio and vLLM models by their `vllm/` prefix. If the endpoint is unavailable and you manually enter the raw LM Studio model identifier, Sim treats that unknown identifier as an Ollama model.
6165

62-
1. Set `VLLM_BASE_URL`, and `VLLM_API_KEY` too if you enabled LM Studio's API authentication — without the key, discovery requests omit the bearer token and fail. No Compose file sets either for you — `docker-compose.ollama.yml` only sets `OLLAMA_URL` — so add them to the `simstudio` service's `environment:` block (or to `.env` and interpolate them), then recreate the service and confirm it landed:
66+
1. Set `VLLM_BASE_URL`, and `VLLM_API_KEY` too if you enabled LM Studio's API authentication — without the key, discovery requests omit the bearer token and fail. No Compose file sets either for you — `docker-compose.ollama.yml` only sets `OLLAMA_URL` — so add them to the `.env` file next to your Compose file — `simstudio` declares `env_file: .env` in every shipped file — then recreate the service and confirm it landed:
6367

64-
Use the Compose file that started your installation — `docker-compose.prod.yml` for the documented production setup, or `docker-compose.ollama.yml` if you started from the Ollama stack:
68+
Use the Compose file that started your installation — `docker-compose.prod.yml` for the documented production setup, `docker-compose.local.yml` for a source-built stack, or `docker-compose.ollama.yml` if you started from the Ollama stack:
6569

6670
```bash
67-
COMPOSE_FILE=docker-compose.prod.yml # or docker-compose.ollama.yml
71+
COMPOSE_FILE=docker-compose.prod.yml # or docker-compose.local.yml, docker-compose.ollama.yml
6872
docker compose -f "$COMPOSE_FILE" up -d --force-recreate simstudio
6973
docker compose -f "$COMPOSE_FILE" exec simstudio printenv VLLM_BASE_URL
7074
```
@@ -79,15 +83,15 @@ Sim identifies dynamically discovered LM Studio and vLLM models by their `vllm/`
7983
## WebSocket and realtime not working
8084

8185
1. Verify reverse proxy routes `/socket.io` to the realtime service (default port 3002). `NEXT_PUBLIC_SOCKET_URL` is only needed if realtime is on a separate host.
82-
2. Verify realtime service is running: `docker compose ps realtime`
86+
2. Verify realtime service is running: `docker compose -f docker-compose.prod.yml ps realtime`
8387
3. Ensure reverse proxy passes WebSocket upgrades (see [Docker guide](/platform/self-hosting/docker))
8488

8589
## 502 Bad Gateway
8690

8791
```bash
88-
# Check app is running
89-
docker compose ps simstudio
90-
docker compose logs simstudio
92+
# Check app is running — use the file that started your install
93+
docker compose -f docker-compose.prod.yml ps simstudio
94+
docker compose -f docker-compose.prod.yml logs simstudio
9195

9296
# Common causes: out of memory, database not ready
9397
```
@@ -157,7 +161,7 @@ app:
157161
1. Check browser console for errors
158162
2. Verify `NEXT_PUBLIC_APP_URL` matches your actual domain
159163
3. Clear browser cookies and local storage
160-
4. Check that all services are running: `docker compose ps`
164+
4. Check that all services are running: `docker compose -f docker-compose.prod.yml ps`
161165

162166
## Windows-specific issues
163167

@@ -209,7 +213,7 @@ Wrap it in `sh -c` with single quotes so `$CRON_SECRET` expands **inside the pod
209213

210214
## Gmail, Drive, and Outlook triggers never fire
211215

212-
These are **polling** triggers, driven by the per-minute `/api/webhooks/poll/*` jobs. Check the scheduler is running them — `docker compose logs cron`, or `kubectl get cronjobs -n simstudio` for a recent `LAST SCHEDULE`.
216+
These are **polling** triggers, driven by the per-minute `/api/webhooks/poll/*` jobs. Check the scheduler is running them — `docker compose -f docker-compose.prod.yml logs cron`, or `kubectl get cronjobs -n simstudio` for a recent `LAST SCHEDULE`.
213217

214218
Microsoft Teams chat triggers are the different case: they use a Microsoft Graph subscription capped at about three days, renewed by the twice-daily `renew-subscriptions` job. If Teams triggers work for a couple of days and then stop, that job is not running. See [Background Jobs](/platform/self-hosting/background-jobs).
215219

apps/docs/content/docs/platform/self-hosting/upgrades.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ install uses:
197197

198198
Inspect the result with `npx sim-setup logs`, which targets whichever Compose file the install uses.
199199

200-
The CLI detects only those two files. An install started from `docker-compose.ollama.yml` is invisible to it`update`, `logs`, and `status` all report no install — so upgrade that stack directly:
200+
The CLI detects only those two files. An install started from `docker-compose.ollama.yml` is invisible to it: `update`, `logs`, and `status` report no install, or — in a source checkout that also carries per-application env files — report that checkout's dev install instead. Upgrade that stack directly:
201201

202202
```bash
203203
# That file builds the app, realtime server, and migrator from source, so the
@@ -216,7 +216,7 @@ docker compose -f docker-compose.ollama.yml --profile "$PROFILE" up -d
216216
- **Kubernetes** — it does not upgrade Helm releases. Use `helm upgrade` after reading the chart and release notes.
217217
- **Source / dev** — update the checkout with git, run `bun install`, and restart `bun run dev:full`.
218218

219-
It also refuses to overwrite a managed Compose file you have edited by hand: preserve or remove your customizations first.
219+
On a standalone `docker-compose.prod.yml` install it also refuses to overwrite its managed Compose file if you have edited it by hand, comparing the file against the hash it recorded in `.sim-setup.json`: preserve or remove your customizations first.
220220
</Callout>
221221

222222
There is a short window where the app is unavailable while containers restart. Compose has no rolling-update mechanism — plan a maintenance window, or run Kubernetes if you need zero-downtime upgrades.
@@ -245,6 +245,7 @@ kubectl logs -n simstudio deploy/sim-app -c migrations --tail=200
245245
```
246246

247247
```bash
248+
# Or the file that started your install.
248249
docker compose -f docker-compose.prod.yml logs migrations
249250
```
250251

@@ -269,9 +270,9 @@ helm rollback sim -n simstudio
269270
```
270271

271272
```bash
272-
# Production Compose — edit .env so the pin persists, then restart.
273-
# Substitute the previous release tag from the releases page.
274-
echo "SIM_VERSION=<previous-release-tag>" >> .env
273+
# Production Compose — set SIM_VERSION in .env so the pin persists, replacing
274+
# any existing line rather than appending a second one. Substitute the previous
275+
# release tag from the releases page.
275276
docker compose -f docker-compose.prod.yml up -d
276277
```
277278

0 commit comments

Comments
 (0)