lastlight-core 0.21.6 → 0.21.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deploy/entrypoint.sh +15 -1
- package/package.json +1 -1
package/deploy/entrypoint.sh
CHANGED
|
@@ -45,7 +45,21 @@ done
|
|
|
45
45
|
# agent-sessions/ is where agentic-pi's event shim writes JSONL envelopes
|
|
46
46
|
# the dashboard reads (path is set by LASTLIGHT_SESSIONS_DIR).
|
|
47
47
|
mkdir -p "$STATE_DIR"/{logs,sandboxes,secrets,agent-sessions}
|
|
48
|
-
|
|
48
|
+
# Claim ownership of the volume — but ONLY when it isn't already ours. A blind
|
|
49
|
+
# `chown -R` over $STATE_DIR ran on EVERY boot and, on a busy instance, walked
|
|
50
|
+
# >1.5M files (sandboxes/ holds cloned repos incl. node_modules): ~3 minutes of
|
|
51
|
+
# IOPS on a GCP persistent disk, blocking the harness the whole time — the bulk
|
|
52
|
+
# of deploy downtime — despite every file already being uid 10001 (the harness
|
|
53
|
+
# AND the sandbox `agent` user share that uid, so nothing here is foreign-owned).
|
|
54
|
+
# Gate on the top dir's owner: a fresh/first-boot volume is root-owned → do the
|
|
55
|
+
# one-time recursive claim; steady state is already `lastlight` → skip instantly.
|
|
56
|
+
# The newly-created subdirs above are chowned unconditionally (cheap, and they
|
|
57
|
+
# may be new even on an already-claimed volume).
|
|
58
|
+
chown lastlight:lastlight "$STATE_DIR"/{logs,sandboxes,secrets,agent-sessions}
|
|
59
|
+
if [ "$(stat -c %U "$STATE_DIR" 2>/dev/null)" != "lastlight" ]; then
|
|
60
|
+
echo "Claiming $STATE_DIR ownership (first boot / uid change) — one-time…"
|
|
61
|
+
chown -R lastlight:lastlight "$STATE_DIR"
|
|
62
|
+
fi
|
|
49
63
|
|
|
50
64
|
# Copy PEM to the data volume so sandbox containers can access it via shared
|
|
51
65
|
# volume (LASTLIGHT_SANDBOX=docker fallback path only — gondolin doesn't go
|