feat(installer): node-local storage prototype (RFC-0003 Option C, flag-gated)#368
feat(installer): node-local storage prototype (RFC-0003 Option C, flag-gated)#368saadqbal wants to merge 2 commits into
Conversation
…g-gated) TB_STORAGE_MODE=node-local (default: hostpath, unchanged) switches the local k3d install to store datasets on k3s's built-in local-path provisioner INSIDE the node instead of bind-mounting ~/.tracebloc. Data then dies with `cluster delete`, is not a browsable host folder, and needs no chmod 777 — the RFC-0003 goal for the local install. - common.sh: TB_STORAGE_MODE flag + validation; C1 forces AGENTS=0 (single-node) since local-path is RWO/WaitForFirstConsumer and the shared data PVC is mounted by jobs-manager-spawned Jobs. - cluster.sh: node-local drops the -v ~/.tracebloc:/tracebloc@all bind-mount, KEEPS k3s local-storage (removes --disable=local-storage), and skips the world-writable host-dir pre-create. - install-client-helm.sh: node-local emits storageClass.create=false + name=local-path, hostPath.enabled=false; skips _ensure_release_dirs. - cluster.bats: cover both modes. Default (hostpath) path is byte-for-byte unchanged; existing installs on --reuse-values do not migrate. Refs #367, backend#1151, tracebloc/cli#366. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Verified on a real Mac (k3d v5.8.3, k3s v1.31.5, docker desktop)Ran this against a throwaway single-node cluster built with the exact args node-local emits (no Chart rendering (
Live storage mechanics:
So the RFC-0003 goal is proven at the substrate level: data sandboxed in the node, survives restart, destroyed on delete, never a browsable host folder. Still needs a credentialed run (can't do without client creds): a full |
…local
install_client_helm() calls _ensure_tracebloc_dirs independently of
create_cluster; the first gate missed it, so node-local installs still
created empty world-writable ~/.tracebloc/{data,logs,mysql} dirs. Now
node-local only ensures the base dir exists (for values.yaml + the install
log) and skips the 777 data subdirs. Verified on a real tb-nodelocal
install. Refs #367.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Full validation on a real credentialed install (
|
Draft / prototype — do not merge. Flag-gated behind
TB_STORAGE_MODE, defaulthostpath(today's behavior, byte-for-byte unchanged). Opens the RFC-0003 Option C (node-local) path for testing on a real machine.Implements the storage half of client#367. Design: backend#1151. RFC: tracebloc/cli#366.
Goal (Asad + Lukas)
Deleting the cluster must destroy dataset data, and data must not sit as a browsable folder in
~/.tracebloc— it should live inside the cluster's sandbox.What
TB_STORAGE_MODE=node-localdoeslocal-pathprovisioner inside the k3d node → data dies withcluster delete, is not a host folder, needs nochmod 777.-v ${HOST_DATA_DIR}:/tracebloc@allbind-mount and keeps k3slocal-storage(the installer disables it in hostpath mode because the chart ships its ownmanualStorageClass).storageClass.create=false+name=local-path,hostPath.enabled=false(reuses the chart's existing dynamic-PVC path — same one EKS/AKS use). The mysql privileged chown init-container auto-drops whenhostPath.enabled=false.AGENTS=0(single-node).local-pathis RWO + WaitForFirstConsumer and provisions on one node, but the shareddataPVC is mounted by jobs-manager-spawned Jobs that could otherwise land on a second node with no volume.Not in scope / notes
hostpathpath unchanged; existing installs upgrade via--reuse-valuesand do not silently migrate (they move to node-local only on a clean delete + reinstall — matches "delete means gone", no data-copy tool needed).chmod 777removal is not a separate PR: on the hostpath model it's load-bearing (host-user writes into/data/shared+ kubelet doesn't apply fsGroup to hostPath volumes), so it can't be dropped standalone safely. node-local removes the host dirs entirely, so 777 is gone by construction here.HOST_DATASET_DIR(network-mount datasets, backend#743) is left on the hostpath path for now; combining it with node-local is a follow-up.Tested here
bats scripts/tests/cluster.bats— 29/29 (incl. 2 new: node-local omits mount + keeps local-storage; hostpath keeps both).bats scripts/tests/common.bats— pass.shellcheck— no new findings.HOST_DATASET_DIRcase → valid YAML.Needs real-machine verification (can't run k3d in review env) — checklist from client#367
helm templatewith node-local values → no hostPath PV, PVCs bindlocal-path, no mysql init-container.TB_STORAGE_MODE=node-localinstall → ingest a dataset → confirm nothing under~/.tracebloc, pod mounts fine.k3d cluster stop && start→ data survives.tracebloc delete(and a rawk3d cluster delete) → data gone.