Skip to content

feat: add vLLM setup script for modular installation#120

Open
cmagina wants to merge 3 commits intoredhat-et:mainfrom
cmagina:pr-06-vllm-setup-script
Open

feat: add vLLM setup script for modular installation#120
cmagina wants to merge 3 commits intoredhat-et:mainfrom
cmagina:pr-06-vllm-setup-script

Conversation

@cmagina
Copy link
Copy Markdown
Collaborator

@cmagina cmagina commented Feb 7, 2026

Summary

This PR is part 6 of 11 in the rework modernization effort. It adds the vLLM setup script as part of the modular framework installation architecture.

Changes:

  • ✅ Add scripts/setup_vllm.sh for vLLM installation and configuration

Features:

  • Downloads vLLM source from GitHub when not mounted as a volume
  • Installs build dependencies for vLLM compilation
  • Supports multiple installation modes via INSTALL_VLLM environment variable:
    • source: Build from source (with auto-download if not mounted)
    • release, nightly: Install wheels from PyPI
    • skip: Skip vLLM installation
  • Provides flexible configuration for different container setups

Why this change?

vLLM is an important framework supported by this repository. This dedicated setup script:

Testing:

Dependencies:

Related PRs:

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • New vLLM installer CLI with source/release/nightly modes and environment-driven options.
    • Configurable vLLM installation in development containers (install toggle and host-path mount).
    • Setup flow optionally invokes the installer when enabled.
  • Chores

    • CI triggers updated to run on installer changes.
    • Development images now include the installer and container startup validates/mounts configured host paths and forwards the install toggle.

@cmagina cmagina force-pushed the pr-06-vllm-setup-script branch from 34ea58e to 59a59ea Compare March 30, 2026 21:07
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7ab7fe37-1b97-478e-80ee-7ba5174953f0

📥 Commits

Reviewing files that changed from the base of the PR and between 3741de2 and 91aa755.

📒 Files selected for processing (1)
  • Makefile
🚧 Files skipped from review as they are similar to previous changes (1)
  • Makefile

📝 Walkthrough

Walkthrough

Adds a new vLLM installer script and integrates it into images, the Makefile, dev setup, and CI triggers so changes to scripts/devinstall_vllm.sh influence Docker builds, container runs, and optional in-container installation flows.

Changes

Cohort / File(s) Summary
CI Workflow Path Filters
.github/workflows/amd-image.yml, .github/workflows/cpu-image.yml, .github/workflows/nvidia-image.yml
Added scripts/devinstall_vllm.sh to paths for push and pull_request triggers so these workflows run when the new installer script changes.
Docker Image Installation Scripts
dockerfiles/Dockerfile.triton, dockerfiles/Dockerfile.triton-amd, dockerfiles/Dockerfile.triton-cpu
Copied scripts/devinstall_vllm.sh into images at /workspace/bin/devinstall_vllm.
Build Configuration
Makefile
Added vllm_path ?= and INSTALL_VLLM ?= skip, moved INSTALL_TRITON declaration, tightened directory-existence checks for mounts, conditionally mount vllm_path, and pass INSTALL_VLLM into container env.
Installation Scripts & Setup
scripts/devinstall_vllm.sh, scripts/devsetup.sh
Added new executable installer scripts/devinstall_vllm.sh (commands: source, release, nightly) with device/torch selection and install flows. Updated scripts/devsetup.sh to preserve VLLM env vars and conditionally invoke the installer when INSTALL_VLLM != skip.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer (repo)
  participant CI as CI / GitHub Actions
  participant Docker as Docker build
  participant Container as Dev Container (run_container)
  participant DevSetup as devsetup.sh
  participant Script as devinstall_vllm.sh
  participant Remote as vLLM (git/PyPI)

  Dev->>CI: push PR including `scripts/devinstall_vllm.sh`
  CI->>Docker: build image (COPY script -> /workspace/bin/devinstall_vllm)
  Dev->>Container: run_container (may mount `vllm_path`, set `INSTALL_VLLM`)
  Container->>DevSetup: invoke `devsetup.sh` (runs as user)
  DevSetup->>Script: call `devinstall_vllm.sh` (if `INSTALL_VLLM` != skip)
  Script->>Remote: clone or pip install vLLM (git or wheel)
  Remote-->>Script: return source or wheel artifacts
  Script-->>Container: install deps, set VLLM_TARGET_DEVICE, configure env
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a vLLM setup script for modular installation, which is reflected in the new scripts/devinstall_vllm.sh file and related integration changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@cmagina cmagina force-pushed the pr-06-vllm-setup-script branch 2 times, most recently from 0d54217 to c05ad0f Compare March 31, 2026 00:10
@cmagina cmagina requested a review from hinriksnaer March 31, 2026 13:18
@cmagina cmagina force-pushed the pr-06-vllm-setup-script branch from dba9059 to f9b8f06 Compare April 2, 2026 17:14
PIP_INSTALL_ARGS+=("--index-url" "$PIP_VLLM_EXTRA_INDEX_URL")
elif [ -n "${VLLM_COMMIT:-}" ]; then
echo "Using the build from commit $VLLM_COMMIT ..."
PIP_VLLM_EXTRA_INDEX_URL="--extra-index-url ${PIP_VLLM_INDEX_URL_BASE}/${VLLM_COMMIT}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be silently ignored in the code path

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

install_whl
;;
nightly)
PIP_VLLM_EXTRA_INDEX_URL="--extra-index-url ${PIP_VLLM_INDEX_URL_BASE}/nightly"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also wonder if this is silently ignored

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not, its used in the specified index check following this switch case

Add scripts/setup_vllm.sh to support vLLM installation and
configuration within containers. This script:

- Downloads vLLM source from GitHub when not mounted as a volume
- Installs build dependencies for vLLM compilation
- Supports installing vLLM wheels from PyPI (release, nightly)
- Provides flexible configuration via INSTALL_VLLM environment variable

The script supports multiple installation modes:
- source: Build from source (with auto-download if not mounted)
- release/nightly: Install wheels from PyPI
- skip: Skip vLLM installation

This is part of the modular script architecture introduced in PR redhat-et#115.

Signed-off-by: Craig Magina <cmagina@redhat.com>
@cmagina cmagina force-pushed the pr-06-vllm-setup-script branch from 17b4113 to ba68bfc Compare April 9, 2026 21:00
@cmagina cmagina marked this pull request as ready for review April 9, 2026 21:02
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
Makefile (1)

153-153: Split env_vars into multiline entries to keep it maintainable.

Line 153 is already densely packed and will keep growing with modular installers. A multiline form reduces churn and review risk when adding/removing flags.

♻️ Proposed refactor
-	env_vars="-e USERNAME=$(USER) -e USER_UID=`id -u $(USER)` -e USER_GID=`id -g $(USER)` -e TORCH_VERSION=$(torch_version) -e INSTALL_LLVM=$(INSTALL_LLVM) -e INSTALL_TOOLS=$(DEMO_TOOLS) -e INSTALL_JUPYTER=$(INSTALL_JUPYTER) -e NOTEBOOK_PORT=$(NOTEBOOK_PORT) -e INSTALL_HELION=$(INSTALL_HELION) -e INSTALL_TORCH=$(INSTALL_TORCH) -e INSTALL_TRITON=$(INSTALL_TRITON) -e INSTALL_VLLM=$(INSTALL_VLLM) -e USE_CCACHE=$(USE_CCACHE) -e MAX_JOBS=$(MAX_JOBS)"; \
+	env_vars="\
+		-e USERNAME=$(USER) \
+		-e USER_UID=`id -u $(USER)` \
+		-e USER_GID=`id -g $(USER)` \
+		-e TORCH_VERSION=$(torch_version) \
+		-e INSTALL_LLVM=$(INSTALL_LLVM) \
+		-e INSTALL_TOOLS=$(DEMO_TOOLS) \
+		-e INSTALL_JUPYTER=$(INSTALL_JUPYTER) \
+		-e NOTEBOOK_PORT=$(NOTEBOOK_PORT) \
+		-e INSTALL_HELION=$(INSTALL_HELION) \
+		-e INSTALL_TORCH=$(INSTALL_TORCH) \
+		-e INSTALL_TRITON=$(INSTALL_TRITON) \
+		-e INSTALL_VLLM=$(INSTALL_VLLM) \
+		-e USE_CCACHE=$(USE_CCACHE) \
+		-e MAX_JOBS=$(MAX_JOBS)"; \

As per coding guidelines "-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` at line 153, The env_vars shell variable is a long single-line
string that's hard to maintain; modify the Makefile so the env_vars assignment
(symbol: env_vars) is written as a multiline, concatenated string with one -e
flag per line (using shell continuation backslashes or Makefile
line-continuation) so each environment entry like USERNAME=$(USER), USER_UID=`id
-u $(USER)`, TORCH_VERSION=$(torch_version), INSTALL_LLVM=$(INSTALL_LLVM), etc.,
is on its own line; ensure the final variable expansion and trailing
semicolon/continuation are preserved and that any backticks or subshells (e.g.,
`id -u $(USER)`) remain intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Makefile`:
- Around line 112-114: Check that vllm_path exists before adding the mount: in
the Makefile block that references vllm_path and updates volume_arg (using
SELINUXFLAG), add an existence test (e.g., [ -e "$(vllm_path)" ] or [ -d
"$(vllm_path)" ]) when vllm_path is non-empty; if the path does not exist, print
a clear error message and exit non‑zero so the build fails fast instead of
appending a bad -v mount. Ensure you update only the branch that handles
vllm_path and keep volume_arg assembly unchanged when the path is valid.

In `@scripts/devinstall_vllm.sh`:
- Around line 77-87: The INSTALL_TORCH handling in scripts/devinstall_vllm.sh
incorrectly treats "skip" as a version and calls devinstall_torch, which fails;
update the conditional around the branch that currently checks [
"${INSTALL_TORCH:-}" != "source" ] / [ -n "${INSTALL_TORCH:-}" ] to also ensure
INSTALL_TORCH != "skip" (i.e., add && [ "${INSTALL_TORCH}" != "skip" ]), so that
when INSTALL_TORCH=skip the script does not call devinstall_torch; adjust the
branches around the INSTALL_TORCH checks (the block invoking devinstall_torch
and the echo messages) accordingly to skip installation when INSTALL_TORCH is
"skip".
- Around line 156-159: The pip_install_args array is being appended with a
single string combining option and value when VLLM_COMMIT is set, which produces
a malformed single argument when later expanded; update the append for
pip_install_args so it adds two separate array elements—the option token
(--extra-index-url) and the URL value constructed from pip_vllm_index_url_base
and VLLM_COMMIT—mirroring the correct pattern used in the other branch, so that
expanding "${pip_install_args[@]}" yields two separate arguments for pip/uv.
- Around line 127-133: The script currently expands VLLM_TARGET_DEVICE
unconditionally which triggers nounset errors under set -u; change the code to
avoid expanding an unset variable by either providing a safe default or
exporting only when set: use parameter expansion like export
VLLM_TARGET_DEVICE="${VLLM_TARGET_DEVICE:-}" (or a sensible default such as
"cpu") or wrap the tee block in an if [ -n "${VLLM_TARGET_DEVICE:-}" ]; then ...
fi so the VLLM_TARGET_DEVICE variable is not referenced when undefined.
- Around line 95-96: The pip install calls currently pass the uv-specific flag
"--prerelease=allow" to the generic pip fallback; update the pip_install logic
so it uses the proper flag depending on the installer: when invoking the 'uv'
wrapper (uv pip install) pass "--prerelease=allow", but when falling back to the
system 'pip' command use "--pre" instead. Modify the code paths that call
pip_install (referenced as pip_install in the script and the uv invocation path)
at the locations noted (the branches that install requirements/cuda.txt and the
other three occurrences) to conditionally set the flag based on whether uv is
available or not, ensuring uv gets "--prerelease=allow" and pip gets "--pre".

---

Nitpick comments:
In `@Makefile`:
- Line 153: The env_vars shell variable is a long single-line string that's hard
to maintain; modify the Makefile so the env_vars assignment (symbol: env_vars)
is written as a multiline, concatenated string with one -e flag per line (using
shell continuation backslashes or Makefile line-continuation) so each
environment entry like USERNAME=$(USER), USER_UID=`id -u $(USER)`,
TORCH_VERSION=$(torch_version), INSTALL_LLVM=$(INSTALL_LLVM), etc., is on its
own line; ensure the final variable expansion and trailing
semicolon/continuation are preserved and that any backticks or subshells (e.g.,
`id -u $(USER)`) remain intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 04571f60-4249-47e7-a1e3-f83f7fa713dd

📥 Commits

Reviewing files that changed from the base of the PR and between ff597f0 and ba68bfc.

📒 Files selected for processing (9)
  • .github/workflows/amd-image.yml
  • .github/workflows/cpu-image.yml
  • .github/workflows/nvidia-image.yml
  • Makefile
  • dockerfiles/Dockerfile.triton
  • dockerfiles/Dockerfile.triton-amd
  • dockerfiles/Dockerfile.triton-cpu
  • scripts/devinstall_vllm.sh
  • scripts/devsetup.sh

Signed-off-by: Craig Magina <cmagina@redhat.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
Makefile (1)

112-114: ⚠️ Potential issue | 🟠 Major

Fail fast when vllm_path is set but invalid.

Line 112 currently ignores a non-empty but nonexistent vllm_path, which hides misconfiguration and makes source-mode behavior hard to debug.

🔧 Proposed fix
-	if [ -n "$(vllm_path)" ] && [ -d "$(vllm_path)" ]; then \
-		volume_arg+=" -v $(vllm_path):/workspace/vllm$(SELINUXFLAG)"; \
-	fi; \
+	if [ -n "$(vllm_path)" ] && [ -d "$(vllm_path)" ]; then \
+		volume_arg+=" -v $(vllm_path):/workspace/vllm$(SELINUXFLAG)"; \
+	elif [ -n "$(vllm_path)" ]; then \
+		echo "!! ERROR: vllm_path does not exist: $(vllm_path)" >&2; \
+		exit 1; \
+	fi; \

As per coding guidelines "-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` around lines 112 - 114, The Makefile currently ignores a non-empty
but nonexistent vllm_path, hiding misconfiguration; update the conditional
around vllm_path/volume_arg so that if [ -n "$(vllm_path)" ] && [ -d
"$(vllm_path)" ] then append to volume_arg as before, but add an explicit branch
that if [ -n "$(vllm_path)" ] && [ ! -d "$(vllm_path)" ] then print a clear
error message referencing vllm_path and exit 1 (so the build fails fast); keep
SELINUXFLAG usage unchanged when appending.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@Makefile`:
- Around line 112-114: The Makefile currently ignores a non-empty but
nonexistent vllm_path, hiding misconfiguration; update the conditional around
vllm_path/volume_arg so that if [ -n "$(vllm_path)" ] && [ -d "$(vllm_path)" ]
then append to volume_arg as before, but add an explicit branch that if [ -n
"$(vllm_path)" ] && [ ! -d "$(vllm_path)" ] then print a clear error message
referencing vllm_path and exit 1 (so the build fails fast); keep SELINUXFLAG
usage unchanged when appending.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 765caee7-156b-490b-b59f-e0382249ccbd

📥 Commits

Reviewing files that changed from the base of the PR and between ba68bfc and 3741de2.

📒 Files selected for processing (2)
  • Makefile
  • scripts/devinstall_vllm.sh

Signed-off-by: Craig Magina <cmagina@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants