diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000000..b20efcc3d625 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,17 @@ +{ + "name": "vLLM", + "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bookworm", + "features": { + "ghcr.io/devcontainers-extra/features/uv:1.0.2": {}, + "ghcr.io/devcontainers/features/rust:1.6.0": {}, + "ghcr.io/devcontainers/features/github-cli:1.1.3": {} + }, + "remoteUser": "vscode", + "mounts": [ + "source=vllm-devcontainer-cache,target=/home/vscode/.cache,type=volume" + ], + "containerEnv": { + "UV_LINK_MODE": "copy" + }, + "postCreateCommand": "uv pip install --system -r requirements/lint.txt && VLLM_USE_PRECOMPILED=1 uv pip install --system -e . --torch-backend=auto && pre-commit install" +} diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 000000000000..6375c68c2c6b --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "enabledManagers": ["devcontainer"], + "dependencyDashboard": true, + "labels": ["dependencies"], + "schedule": ["before 6am on monday"], + "packageRules": [ + { + "matchManagers": ["devcontainer"], + "matchDepTypes": ["image"], + "matchPackageNames": ["mcr.microsoft.com/devcontainers/python"], + "groupName": "devcontainer base image" + }, + { + "matchManagers": ["devcontainer"], + "matchDepTypes": ["feature"], + "matchPackageNames": [ + "ghcr.io/devcontainers-extra/features/uv", + "ghcr.io/devcontainers/features/rust", + "ghcr.io/devcontainers/features/github-cli" + ], + "groupName": "devcontainer features" + } + ] +} diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml new file mode 100644 index 000000000000..8fb9959a683b --- /dev/null +++ b/.github/workflows/devcontainer.yml @@ -0,0 +1,39 @@ +name: Dev container + +on: + pull_request: + paths: + - ".devcontainer/**" + - "requirements/lint.txt" + - ".github/workflows/devcontainer.yml" + push: + branches: [main] + paths: + - ".devcontainer/**" + - "requirements/lint.txt" + - ".github/workflows/devcontainer.yml" + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + build: + runs-on: ubuntu-24.04 + timeout-minutes: 45 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: devcontainers/ci@513af61f4de4f75d37e4438f184ba4358f0fc1ca # v0.3.1900000450 + with: + push: never + runCmd: | + set -euo pipefail + uv --version + python --version | grep -F "Python 3.12" + python -c "import vllm" + pre-commit --version + test -f .git/hooks/pre-commit diff --git a/docs/contributing/README.md b/docs/contributing/README.md index c97b5bd6c17a..0f8e96a76fbc 100644 --- a/docs/contributing/README.md +++ b/docs/contributing/README.md @@ -37,6 +37,24 @@ Then, configure your Python virtual environment. --8<-- "docs/getting_started/installation/python_env_setup.inc.md" +!!! tip "Dev container" + [![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/vllm-project/vllm) + [![Dev container build](https://github.com/vllm-project/vllm/actions/workflows/devcontainer.yml/badge.svg?branch=main)](https://github.com/vllm-project/vllm/actions/workflows/devcontainer.yml) + + A CPU-only VS Code dev container is available for editing and linting without a GPU. + Open the Command Palette and run **Dev Containers: Reopen in Container**. The badge + above clones `vllm-project/vllm` into a container volume; to work on a fork, clone + it locally and use **Reopen in Container** instead. + + On first creation it installs `uv`, creates a uv-managed Python 3.12 venv at `.venv` + inside a Docker volume (separate from any host `.venv`), and installs + `requirements/lint.txt`. On every start it also runs `pre-commit install`. + + **Limitations:** no GPU support; not for CUDA/C++ builds or GPU tests; Pylance will + report unresolved imports for packages not installed in the container (e.g. `torch`). + If you also commit from the host, run `pre-commit install` again on the host after + using the container — the container rewrites `.git/hooks` with container-internal paths. + If you are only developing vLLM's Python code, install vLLM using: ```bash