host: blog persisted in durable SX store + materialised view, 158/158
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 16s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 16s
Blog posts now live in the durable SX store (persist/durable-backend, on-disk under $SX_PERSIST_DIR — already built: sx_persist_store.ml + lib/persist/ durable.sx). Publishing appends insert ops to the slug's content stream; posts survive restarts (verified: seq/log stable across container restart, re-seed idempotent). Read path: http-listen handlers can't drive per-request perform/IO (sx_call doesn't resolve the CEK IO suspension the way the main loop does), so posts are materialised from the store into an in-memory view at boot (host/blog-load-all! + host/blog-seed!) and request handlers read the view — perform-free. Store is source of truth; view is a boot-rebuilt cache. Deploy: docker-compose.dev-sx-host.yml mounts /root/sx-host-persist (chowned to appuser 10001) at /data/persist; SX_PERSIST_DIR set. blog.rose-ash.com/welcome/ live. Per-request-IO kernel fix tracked in the plan as the next task. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,8 @@ services:
|
||||
HOST_PORT: "8000"
|
||||
# Bind all interfaces so Caddy (on externalnet) can reach it.
|
||||
SX_HTTP_HOST: "0.0.0.0"
|
||||
# Durable persist store root — on a named volume so data survives restarts.
|
||||
SX_PERSIST_DIR: /data/persist
|
||||
OCAMLRUNPARAM: "b"
|
||||
volumes:
|
||||
# SX source (hot-reload on container restart)
|
||||
@@ -27,6 +29,10 @@ services:
|
||||
- ./lib:/app/lib:ro
|
||||
# OCaml server binary — this worktree's build (has the SX_HTTP_HOST bind fix)
|
||||
- ./hosts/ocaml/_build/default/bin/sx_server.exe:/app/bin/sx_server:ro
|
||||
# Durable persist store (the SX op-log/kv on disk) — survives restarts.
|
||||
# Host dir, chowned to the image's appuser (uid 10001) so the non-root
|
||||
# server can write: sudo mkdir -p /root/sx-host-persist && sudo chown 10001:10001 /root/sx-host-persist
|
||||
- /root/sx-host-persist:/data/persist
|
||||
networks:
|
||||
- externalnet
|
||||
- default
|
||||
|
||||
Reference in New Issue
Block a user