Skip to content

feat(venv): add secure per-launch find-links support - #5387

Open
m199369309 wants to merge 2 commits into
xorbitsai:mainfrom
m199369309:feat/venv-launch-find-links
Open

feat(venv): add secure per-launch find-links support#5387
m199369309 wants to merge 2 commits into
xorbitsai:mainfrom
m199369309:feat/venv-launch-find-links

Conversation

@m199369309

Copy link
Copy Markdown
Collaborator

Summary

  • add a typed virtual_env_find_links launch parameter across REST, Supervisor, Worker, sync/async clients, and CLI
  • validate request-level paths on each target Worker before invoking uv
  • restrict paths to administrator-configured roots via XINFERENCE_VIRTUAL_ENV_FIND_LINKS_ALLOWED_ROOTS (default: ${XINFERENCE_HOME}/wheels)
  • canonicalize paths, reject URLs/relative paths/files/symlink escapes, check readability, and deduplicate while preserving order
  • preserve configured model/pip find-links and append validated per-launch directories
  • document CLI and Python usage plus distributed-deployment and trust requirements

Dependency

Depends on #5386 so direct FlashInfer post-install commands honor the same configured find-links sources as the main virtualenv installation.

This PR is intentionally stacked on #5386. The shared commit will disappear from this PR after #5386 is merged.

Security

Validation happens on each selected Worker because the Supervisor cannot safely validate Worker-local filesystems. Allowed roots must be controlled by administrators and must not be writable by untrusted users, since installing wheels executes package code.

Set XINFERENCE_VIRTUAL_ENV_FIND_LINKS_ALLOWED_ROOTS to an empty value to disable request-level local paths.

Tests

  • pytest -q xinference/core/tests/test_virtual_env_manager.py xinference/core/tests/test_worker.py xinference/core/tests/test_launch_strategy.py xinference/core/tests/test_model_replica_scale.py (163 passed)
  • pre-commit run --files <modified files>
  • CLI help smoke test for --virtual-env-find-link

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

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