Skip to content

fix(models): redirect LoRA sidecar XDG_DATA_HOME to a writable volume#842

Merged
albcui merged 2 commits into
mainfrom
albcui/nvbug/fix-lora-sidecar-xdg-home
Jul 22, 2026
Merged

fix(models): redirect LoRA sidecar XDG_DATA_HOME to a writable volume#842
albcui merged 2 commits into
mainfrom
albcui/nvbug/fix-lora-sidecar-xdg-home

Conversation

@albcui

@albcui albcui commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #798, which redirected only $XDG_STATE_HOME. The adapters sidecar's nemo services run also resolves its local data dir via $XDG_DATA_HOME (default ~/.local/share/nemo). This leads to the same class of permission issue surfaced previously.

Point both XDG homes at a single writable scratch base (/scratch/.local). State lands under .../nmp/ and data under .../nemo/, so one base holds both without collision, and it stays outside the /scratch/loras subtree the adapters controller GCs. Covered by the deployments_plugin compiler unit test.

Summary by CodeRabbit

  • Bug Fixes
    • Improved writable storage configuration for adapters sidecars on LoRA scratch mounts.
    • Sidecar directory handling now aligns both XDG_STATE_HOME and XDG_DATA_HOME to the same writable scratch-backed base location, reducing permission-related issues.
  • Tests
    • Updated LoRA sidecar Kubernetes assertions to reflect the new XDG environment variable behavior.

Follow-up to #798, which redirected only $XDG_STATE_HOME. The adapters
sidecar's `nemo services run` also resolves its local data dir (SQLite DB,
encryption key) via nmp_user_data_dir(), which honors $XDG_DATA_HOME
(default ~/.local/share/nemo) -- a distinct XDG home from $XDG_STATE_HOME
(default ~/.local/state). The pod runs the sidecar as the vLLM uid (2000),
which does not own the nmp-api image's baked $HOME (/home/nvs, uid 1000),
so startup still crash-looped with `PermissionError: [Errno 13] Permission
denied: '/home/nvs/.local'` when mkdir'ing ~/.local/share/nemo.

Point both XDG homes at a single writable scratch base (/scratch/.local),
named for the ~/.local these homes normally live under. State lands under
.../nmp/ and data under .../nemo/, so one base holds both without collision,
and it stays outside the /scratch/loras subtree the adapters controller GCs.
Covered by the deployments_plugin compiler unit test.

Signed-off-by: Albert Cui <albcui@nvidia.com>
@github-actions github-actions Bot added the fix label Jul 22, 2026
@albcui
albcui marked this pull request as ready for review July 22, 2026 15:06
@albcui
albcui requested review from a team as code owners July 22, 2026 15:06
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: be72289e-f79f-499f-8f91-65594be5a09f

📥 Commits

Reviewing files that changed from the base of the PR and between fba0224 and 0d18d21.

📒 Files selected for processing (1)
  • services/core/models/src/nmp/core/models/controllers/backends/deployments_plugin/compiler.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • services/core/models/src/nmp/core/models/controllers/backends/deployments_plugin/compiler.py

📝 Walkthrough

Walkthrough

Changes

LoRA sidecar XDG configuration

Layer / File(s) Summary
Route XDG directories to writable scratch
services/core/models/src/nmp/core/models/controllers/backends/deployments_plugin/compiler.py, services/core/models/tests/unit/controllers/backends/deployments_plugin/test_compiler.py
The sidecar sets both XDG_STATE_HOME and XDG_DATA_HOME to /scratch/.local, with tests covering the updated paths.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the LoRA sidecar XDG writable-volume redirect, though it only names XDG_DATA_HOME.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch albcui/nvbug/fix-lora-sidecar-xdg-home

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 27114/34832 77.8% 62.1%
Integration Tests 15890/33443 47.5% 19.9%

Signed-off-by: Albert Cui <albcui@nvidia.com>
@albcui
albcui enabled auto-merge July 22, 2026 15:31
@albcui
albcui added this pull request to the merge queue Jul 22, 2026
Merged via the queue into main with commit 5a9b00d Jul 22, 2026
60 checks passed
@albcui
albcui deleted the albcui/nvbug/fix-lora-sidecar-xdg-home branch July 22, 2026 15:58
soluwalana pushed a commit that referenced this pull request Jul 22, 2026
…#842)

* fix(models): redirect LoRA sidecar XDG_DATA_HOME to a writable volume

Follow-up to #798, which redirected only $XDG_STATE_HOME. The adapters
sidecar's `nemo services run` also resolves its local data dir (SQLite DB,
encryption key) via nmp_user_data_dir(), which honors $XDG_DATA_HOME
(default ~/.local/share/nemo) -- a distinct XDG home from $XDG_STATE_HOME
(default ~/.local/state). The pod runs the sidecar as the vLLM uid (2000),
which does not own the nmp-api image's baked $HOME (/home/nvs, uid 1000),
so startup still crash-looped with `PermissionError: [Errno 13] Permission
denied: '/home/nvs/.local'` when mkdir'ing ~/.local/share/nemo.

Point both XDG homes at a single writable scratch base (/scratch/.local),
named for the ~/.local these homes normally live under. State lands under
.../nmp/ and data under .../nemo/, so one base holds both without collision,
and it stays outside the /scratch/loras subtree the adapters controller GCs.
Covered by the deployments_plugin compiler unit test.

Signed-off-by: Albert Cui <albcui@nvidia.com>

* Make comments less verbose

Signed-off-by: Albert Cui <albcui@nvidia.com>

---------

Signed-off-by: Albert Cui <albcui@nvidia.com>
Signed-off-by: Sam Oluwalana <soluwalana@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants