docs(ops): record 103 goosed native migration and add migrate tooling
Memind CI / Test, build, and release guards (pull_request) Has been cancelled
Memind CI / Test, build, and release guards (pull_request) Has been cancelled
Document the completed Docker-to-native goosed pool cutover on 103, add the production migrate script with backup/rollback paths, and extend local native pool soak/metrics helpers used as migration gates. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Local and 103 runtime topology
|
||||
|
||||
> Last confirmed: 2026-07-26 20:18 CST.
|
||||
> Last confirmed: 2026-07-30 20:20 CST (goosed native migration).
|
||||
>
|
||||
> This is the current topology source of truth for local Memind and 103 production. Prefer this document over older migration notes. Older architecture documents may contain historical paths from before the MindSpace split.
|
||||
|
||||
@@ -75,48 +75,62 @@ or whose `gitSha` does not match the runtime artifact manifest.
|
||||
|
||||
## goosed
|
||||
|
||||
103 goosed runs in Colima/Docker, not as native launchd processes.
|
||||
103 goosed runs as **native launchd** processes (2026-07-30 migrated). Docker/Colima pool is stopped; `goosed-prod-1` is kept as emergency standby.
|
||||
|
||||
> 迁移记录与回滚:[goosed-native-103-migration-plan.md](./goosed-native-103-migration-plan.md)(**已执行 2026-07-30**)。脚本:`scripts/goosed-native-103-migrate.sh`。
|
||||
|
||||
| Item | Value |
|
||||
|------|-------|
|
||||
| Docker context | `colima` |
|
||||
| Compose directory | `/Users/john/Project/goosed-prod` |
|
||||
| Compose env | `/Users/john/Project/goosed-prod/.env` |
|
||||
| Image pattern | `tkmind/goosed:prod-${GOOSED_TAG}` |
|
||||
| Session store | PostgreSQL `memind_sessions` through `GOOSE_SESSION_DB_URL` |
|
||||
| Session PostgreSQL | **Host** `postgresql@17` on `127.0.0.1:5432` (`/opt/homebrew/var/postgresql@17`) |
|
||||
| Runtime type | Native launchd (`GOOSED_RUNTIME=native`) |
|
||||
| Root | `/Users/john/Project/tkmind_go-native` |
|
||||
| Binary | `tkmind_go-native/goosed` → `releases/goosed-*` |
|
||||
| Launchd labels | `cn.tkmind.goosed-native-18006` … `18014` |
|
||||
| Run script | `run-goosed-native.sh <port>` + `.env.<port>` |
|
||||
| Session store | PostgreSQL `memind_sessions` via `GOOSE_SESSION_DB_URL` → `127.0.0.1:5432` |
|
||||
| FD monitor | `cn.tkmind.goosed-monitor` → `scripts/monitor-goosed-fds.mjs` |
|
||||
| Docker standby | `goosed-prod-1` stopped, `restart=no`(紧急回滚 18006) |
|
||||
| DeepSeek no-think | `cn.tkmind.memind-deepseek-no-think` → `:18036`(native 必需,`MEMIND_DEEPSEEK_PROXY_ENTRYPOINT=1`) |
|
||||
|
||||
**Critical:** Colima goosed reaches the session DB via `host.docker.internal:5432`. If host PostgreSQL is stopped, H5 `/agent/start` hangs ~60s then fails with `pool timed out`, and the UI stays on「正在创建新对话…」. Recovery:
|
||||
**Critical:** Native goosed uses host PostgreSQL on `127.0.0.1:5432`. If PostgreSQL stops, H5 `/agent/start` hangs ~60s. Recovery:
|
||||
|
||||
```bash
|
||||
ssh john@58.38.22.103 'bash /Users/john/Project/goosed-prod/scripts/ensure-goose-session-postgres.sh'
|
||||
ssh john@58.38.22.103 'bash /Users/john/Project/Memind/scripts/ensure-goose-session-postgres.sh'
|
||||
ssh john@58.38.22.103 '/opt/homebrew/opt/postgresql@17/bin/pg_isready -h 127.0.0.1 -p 5432'
|
||||
```
|
||||
|
||||
`cn.tkmind.goosed-monitor`(103)运行 `goosed-prod/scripts/monitor-goosed-containers.mjs`,本地 native goosed 监控用 `scripts/monitor-goosed-fds.mjs`;两者都会在巡检时调用 `ensure-goose-session-postgres.sh`。
|
||||
Port layout (native listens directly on host port):
|
||||
|
||||
Container layout (host port → container `18006`):
|
||||
|
||||
| Container | Host port | Container port |
|
||||
|-----------|-----------|----------------|
|
||||
| `goosed-prod-1` | `18006` | `18006` |
|
||||
| `goosed-prod-2` | `18007` | `18006` |
|
||||
| `goosed-prod-3` | `18008` | `18006` |
|
||||
| `goosed-prod-4` | `18009` | `18006` |
|
||||
| `goosed-prod-5` | `18010` | `18006` |
|
||||
| `goosed-prod-6` | `18011` | `18006` |
|
||||
| `goosed-prod-7` | `18012` | `18006` |
|
||||
| `goosed-prod-8` | `18013` | `18006` |
|
||||
| `goosed-prod-9` | `18014` | `18006` |
|
||||
| Port | Launchd label |
|
||||
|------|---------------|
|
||||
| `18006` | `cn.tkmind.goosed-native-18006` |
|
||||
| `18007` | `cn.tkmind.goosed-native-18007` |
|
||||
| … | … |
|
||||
| `18014` | `cn.tkmind.goosed-native-18014` |
|
||||
|
||||
All nine host ports must return `ok` from `/status`, and must appear in Portal `.env` `TKMIND_API_TARGETS`.
|
||||
|
||||
### Legacy Docker pool (standby only)
|
||||
|
||||
| Item | Value |
|
||||
|------|-------|
|
||||
| Compose directory | `/Users/john/Project/goosed-prod` |
|
||||
| Image pattern | `tkmind/goosed:prod-${GOOSED_TAG}` |
|
||||
| Containers | `goosed-prod-1..9` — **stopped**, `docker update --restart=no` |
|
||||
|
||||
Do **not** leave `cn.tkmind.goosed-monitor` on `monitor-goosed-containers.mjs` with `GOOSED_RESTART_UNHEALTHY=1`; it will restart Docker and fight native ports.
|
||||
|
||||
```bash
|
||||
# Emergency: single Docker instance on 18006 only
|
||||
launchctl bootout gui/$(id -u)/cn.tkmind.goosed-native-18006
|
||||
docker update --restart=unless-stopped goosed-prod-1 && docker start goosed-prod-1
|
||||
```
|
||||
|
||||
## PostgreSQL rule
|
||||
|
||||
Both local native goosed and 103 Colima goosed persist sessions in PostgreSQL:
|
||||
Both local native goosed and 103 native goosed persist sessions in PostgreSQL:
|
||||
|
||||
- local native goosed: PostgreSQL database `goose_sessions_dev`
|
||||
- 103 Colima goosed: PostgreSQL database `memind_sessions`
|
||||
- 103 native goosed: PostgreSQL database `memind_sessions`
|
||||
|
||||
Do not assume a local SQLite session store when debugging current Memind/goosed behavior.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user