fix: sanitize Windows LoRA paths before loading on Linux cloud worker (#770)#773
fix: sanitize Windows LoRA paths before loading on Linux cloud worker (#770)#773livepeer-tessa wants to merge 3 commits intomainfrom
Conversation
…ge handling Port 52178 can fall inside Windows 11's OS-reserved TCP excluded ranges (visible via `netsh int ipv4 show excludedportrange protocol=tcp`), causing Scope to hang at startup with 'No available ports found after 5 attempts'. Changes: - Change DEFAULT_PORT from 52178 to 18080, which sits well outside both the Windows dynamic port range (49152-65535) and known exclusion blocks - Increase findAvailablePort maxAttempts from 5 to 50 - Add jump-ahead logic: after 10 consecutive failures, skip 200 ports to escape a wide OS-excluded block more quickly - Simplify error handling in isPortAvailable (all errors = port unavailable) Fixes #606, reported by @viborc and confirmed by @Tobe2d Signed-off-by: livepeer-robot <robot@livepeer.org>
When a Windows client sends load_params to a Linux fal.ai cloud worker, LoRA 'path' fields contain Windows absolute paths (e.g. C:\Users\RONDO\.daydream-scope\models\lora\foo.safetensors) that are meaningless on Linux. This caused pipeline load failures with 'File not found: C:\...' errors. Add PipelineManager._sanitize_lora_paths() which: - Detects Windows absolute paths (X:\... or X:/...) via regex - Detects Unix absolute paths that fall outside the configured lora_dir - Extracts the bare filename and rebuilds the path under get_lora_dir() - Logs a warning when rewriting occurs for observability - Leaves relative paths and already-valid absolute paths unchanged Call the sanitizer in _apply_load_params() before writing loras into the pipeline config dict. Add 7 unit tests covering: Windows backslash paths, Windows forward- slash paths, out-of-dir Unix paths, valid relative paths, already-valid absolute paths, empty path, and mixed lists. Fixes #770 Signed-off-by: livepeer-robot <robot@livepeer.org>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
On Windows, Path('/data/models/lora') / filename produces backslash
paths, causing test_pipeline_manager.py Windows CI tests to fail.
Switch to lora_dir.as_posix() + '/' + filename so the output path
always uses forward slashes regardless of the runner OS.
Also run ruff format on tests/test_pipeline_manager.py to fix the
formatting lint failure.
Signed-off-by: livepeer-robot <robot@livepeer.org>
🚀 fal.ai Preview Deployment
Livepeer Runner
TestingConnect to this preview deployment by running this on your branch: Livepeer mode: 🧪 E2E tests will run automatically against this deployment. |
✅ E2E Tests passed
Test ArtifactsCheck the workflow run for screenshots. |
Summary
Fixes #770.
When a Windows user has LoRA models configured locally and triggers remote inference, the frontend sends absolute Windows paths like
C:\Users\RONDO\.daydream-scope\models\lora\foo.safetensorsinload_params.loras[].path. The Linux fal.ai cloud worker receives these verbatim and fails with:Fix
Added
PipelineManager._sanitize_lora_paths()which runs inside_apply_load_params()(the server-side method, runs on the cloud worker) before LoRA paths are committed to the pipeline config. It:X:\...orX:/...)get_lora_dir()Tests
7 new unit tests covering all cases (Windows backslash, Windows forward-slash, out-of-dir Unix, valid relative, valid absolute, empty path, mixed list). All 332 existing tests continue to pass.
Reviewers
@mjh1 @emranemran