fix(deploy): redirect HF_HOME into the repo, same crash on a fresh install #49

Merged
alee merged 1 commits from fix/deploy-hf-home-cache into main 2026-09-07 02:53:51 +00:00
Owner

Follow-up to #48 -- this commit was pushed after #48 had already merged, so it needs its own PR.

The live incident #48 fixed (gated model default) had a second layer once that was resolved: HuggingFace's default cache (~/.cache/huggingface) falls outside ProtectHome=read-only's ReadWritePaths exception, so the service crash-looped with OSError: Read-only file system the moment local_encoder tried to actually download a model -- even with a working model id.

Redirects HF_HOME into the already-writable repo path instead of widening the sandbox to a new home-directory location, keeping the "only the repo is writable" invariant intact. Applied live already; this backports it to the tracked deploy/llm-router.service template so a fresh install doesn't hit the same crash.

Full suite: 1503 passed, 0 failures.

Follow-up to #48 -- this commit was pushed after #48 had already merged, so it needs its own PR. The live incident #48 fixed (gated model default) had a second layer once that was resolved: HuggingFace's default cache (`~/.cache/huggingface`) falls outside `ProtectHome=read-only`'s `ReadWritePaths` exception, so the service crash-looped with `OSError: Read-only file system` the moment `local_encoder` tried to actually download a model -- even with a working model id. Redirects `HF_HOME` into the already-writable repo path instead of widening the sandbox to a new home-directory location, keeping the "only the repo is writable" invariant intact. Applied live already; this backports it to the tracked `deploy/llm-router.service` template so a fresh install doesn't hit the same crash. Full suite: 1503 passed, 0 failures.
alee added 1 commit 2026-09-07 01:28:36 +00:00
The live incident this branch is already fixing (#48's gated model
default) had a second layer once that was fixed: HuggingFace's default
cache (~/.cache/huggingface) falls outside ProtectHome=read-only's
ReadWritePaths exception, so the service crash-looped with
"OSError: Read-only file system" the moment local_encoder tried to
download a model -- even with a working model id.

Redirect HF_HOME into the already-writable repo path instead of
widening the sandbox to a new home-directory location, keeping the
"only the repo is writable" invariant intact. Applied live already;
this backports it to the tracked deploy template so a fresh install
doesn't hit the same crash.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VRQXz5SYZYVWscxS1QqF6U
alee merged commit 88d1c0d95b into main 2026-09-07 02:53:51 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alee/6krrt#49