feat(ops): add imgproxy native runtime tooling and record 103 deployment
Memind CI / Test, build, and release guards (pull_request) Failing after 18s

Bundle vendored imgproxy with Mach-O dylibs for 103 launchd, fix install to exec the binary directly with launchctl enable, and document the live native release in the runtime topology.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-31 05:38:14 +08:00
parent 08ea5e05a9
commit 78e5a6c026
8 changed files with 734 additions and 0 deletions
+77
View File
@@ -166,3 +166,80 @@ ssh john@58.38.22.103 'curl -fsS http://127.0.0.1:8082/health'
ssh john@58.38.22.103 'for p in $(seq 18006 18014); do curl -kfsS https://127.0.0.1:$p/status; echo; done'
ssh john@58.38.22.103 'grep ^TKMIND_API_TARGETS= /Users/john/Project/Memind/.env'
```
## imgproxy
103 imgproxy runs as a **native vendor runtime** (no brew on 103; Docker `memind-imgproxy` retired).
| Item | Value |
|------|-------|
| Runtime base | `/Users/john/Project/imgproxy-runtime` |
| Current release (2026-07-31) | `20260731-052342-imgproxy-native` (**native launchd**, imgproxy 4.0.7) |
| Legacy Docker release | `20260715-3819ccd5` (retired) |
| Vendor binary | `releases/<id>/vendor/imgproxy-runtime/bin/imgproxy` (+ bundled dylibs) |
| LaunchAgent | `cn.tkmind.imgproxy` → direct binary exec → `127.0.0.1:20082` |
| Compat proxy | `cn.tkmind.imgproxy-compat``10.10.0.2:20081` |
| Public entry | `https://img.tkmind.cn` |
| Signing config | Portal `.env``IMGPROXY_SIGNING_KEY` / `IMGPROXY_SIGNING_SALT` |
| Storage root | `MINDSPACE_STORAGE_ROOT=/Users/john/MindSpace/data/mindspace` |
Build locally, release to 103:
```bash
npm run build:imgproxy-runtime-native
bash scripts/release-imgproxy-native-prod.sh --dry-run # from release/* on synced main
bash scripts/release-imgproxy-native-prod.sh --yes
```
Install on 103 reads Portal `.env` for signing keys and storage root; launchd plist **must exec the vendored binary directly** (not `/bin/bash` wrapper). If bootstrap fails with `error 5`, run `launchctl enable gui/$(id -u)/cn.tkmind.imgproxy` before re-bootstrap.
Verify:
```bash
ssh john@58.38.22.103 'curl -fsS http://127.0.0.1:20082/health'
ssh john@58.38.22.103 'curl -fsS http://10.10.0.2:20081/health'
curl -fsS https://img.tkmind.cn/health
```
Legacy Docker release remains in `scripts/release-imgproxy-runtime-prod.sh` for rollback only.
Do **not** point launchd at `/Users/john/Project/Memind/vendor/...` without a Portal runtime that actually ships that path; imgproxy is an independent runtime under `imgproxy-runtime/`.
## image_make
`image_make` is an independent service. Portal runtime does **not** bundle it.
| Item | Value |
|------|-------|
| Local source | `/Users/john/Project/image_make` |
| 103 runtime base | `/Users/john/Project/image_make` |
| Current release (2026-07-30) | `20260730-220317-native-ceaff399a073` (**native launchd**) |
| Legacy Docker release | `20260720-standalone-rc1` (retired) |
| Listen | `127.0.0.1:18083` |
| LaunchAgent | `cn.tkmind.image-make` |
| Persistent env | `shared/.env` |
| Persistent data | `shared/data/artifacts` |
| Build (local) | `bash scripts/build-image-make-runtime-native.sh` |
| Release (103) | `bash scripts/release-image-make-runtime-prod.sh --yes` |
| Source fingerprint | `release-metadata.env``IMAGE_MAKE_SOURCE_TREE_SHA256` |
103 runs **darwin/arm64 native** (uv venv in release tar). Docker/Colima is no longer required for image_make.
**ComfyUI is a separate runtime** (not bundled into image_make tar):
| Item | Value |
|------|-------|
| Local build tree | `/Users/john/Project/image_make/.runtime/ComfyUI` + `comfyui-venv` |
| 103 runtime base | `/Users/john/Project/comfyui-runtime` |
| Current release (2026-07-30) | `20260730-222051-native-e87e7a81bb76` (**native launchd**) |
| Publish entry | `bash scripts/release-comfyui-runtime-prod.sh --yes` (from local Mac) |
| LaunchAgent | `cn.tkmind.comfyui``127.0.0.1:8188` |
| Fingerprint | `config/comfyui/runtime.lock` + SD1.5 SHA256 |
103 must **not** run `install_comfyui_runtime.sh` or download models directly; the local machine stages
`/Users/john/Project/comfyui-runtime/releases/<id>/` with production paths, tars it, and scp installs it.
Enable `comfyui` in Portal `h5_image_make_admin_config` only after ComfyUI is running.
Current production: default `aliyun_bailian`, `comfyui` enabled as failover backup.
Memind integration: HTTP client only (`image-make-client.mjs`); config via `IMAGE_MAKE_BASE_URL` + token. Docs: [image-make-integration.md](./image-make-integration.md).