From ff78afadc09c861c84fbcf144e7718145c4437c8 Mon Sep 17 00:00:00 2001 From: Akash kaothalkar Date: Fri, 15 May 2026 17:28:20 +0530 Subject: [PATCH 1/4] feat: Update vLLM v0.21.0 build script for UBI 9.5 --- v/vllm/build_info.json | 7 +- v/vllm/vllm_v0.21.0_ubi_9.5.sh | 277 +++++++++++++++++++++++++++++++++ 2 files changed, 282 insertions(+), 2 deletions(-) create mode 100644 v/vllm/vllm_v0.21.0_ubi_9.5.sh diff --git a/v/vllm/build_info.json b/v/vllm/build_info.json index 4cb67cd044..f5961d6d3c 100644 --- a/v/vllm/build_info.json +++ b/v/vllm/build_info.json @@ -2,7 +2,7 @@ "maintainer": "akash-kaothalkar", "package_name": "vllm", "github_url": "https://github.com/vllm-project/vllm", - "version": "v0.18.1", + "version": "v0.21.0", "wheel_build": true, "default_branch": "main", "build_script": "vllm_v0.18.1_ubi_9.5.sh", @@ -27,8 +27,11 @@ }, "v0.18.1": { "build_script": "vllm_v0.18.1_ubi_9.5.sh" + }, + "v0.21.0": { + "build_script": "vllm_v0.21.0_ubi_9.5.sh" }, "*": { - "build_script": "vllm_v0.18.1_ubi_9.5.sh" + "build_script": "vllm_v0.21.0_ubi_9.5.sh" } } \ No newline at end of file diff --git a/v/vllm/vllm_v0.21.0_ubi_9.5.sh b/v/vllm/vllm_v0.21.0_ubi_9.5.sh new file mode 100644 index 0000000000..de36058b43 --- /dev/null +++ b/v/vllm/vllm_v0.21.0_ubi_9.5.sh @@ -0,0 +1,277 @@ +#!/bin/bash -e + +# ----------------------------------------------------------------------------- +# +# Package : vllm +# Version : v0.21.0 +# Source repo : https://github.com/vllm-project/vllm +# Tested on : UBI:9.5 +# Language : Python +# Ci-Check : True +# Script License: Apache License 2.0 +# Maintainer : Akash Kaothalkar +# +# +# Disclaimer: This script has been tested in root mode on given +# ========== platform using the mentioned version of the package. +# It may not work as expected with newer versions of the +# package and/or distribution. In such case, please +# contact "Maintainer" of this script. +# ----------------------------------------------------------------------------- + +set -eo pipefail + +PACKAGE_NAME=vllm +PACKAGE_VERSION=${1:-v0.21.0} +PACKAGE_URL=https://github.com/vllm-project/vllm.git +CURRENT_DIR=$(pwd) +PACKAGE_DIR=vllm + +echo "===================================================================" +echo " vLLM FULL BUILD START (UBI 9.5 / POWER / v0.21.0)" +echo "===================================================================" + +# ----------------------------------------------------------------------------- +# System dependencies +# ----------------------------------------------------------------------------- + +echo "-------------------- Installing OS dependencies -------------------" + +yum install -y yum-utils +yum config-manager --set-enabled ubi-9-codeready-builder-rpms + +yum install -y \ + git make cmake gcc-toolset-13 \ + python3.12 python3.12-devel python3.12-pip \ + unzip zip wget patch bzip2 \ + openssl-devel sqlite-devel \ + freetype-devel gmp-devel libjpeg-turbo-devel \ + cargo libcurl-devel \ + autoconf automake libtool pkgconfig \ + openblas-devel \ + glibc-headers kernel-headers glibc-devel libstdc++-devel \ + llvm-devel \ + --allowerasing + +yum install -y gcc-toolset-13-libatomic-devel + +# ----------------------------------------------------------------------------- +# Enable GCC toolset +# ----------------------------------------------------------------------------- + +echo "-------------------- Enabling GCC toolset --------------------------" + +source /opt/rh/gcc-toolset-13/enable + +export LD_LIBRARY_PATH=/opt/rh/gcc-toolset-13/root/usr/lib64:${LD_LIBRARY_PATH} +export LIBRARY_PATH=/opt/rh/gcc-toolset-13/root/usr/lib64:/usr/lib64:${LIBRARY_PATH} +export CMAKE_PREFIX_PATH=/opt/rh/gcc-toolset-13/root/usr:${CMAKE_PREFIX_PATH} + +export CC=gcc +export CXX=g++ + +gcc --version +g++ --version + + +echo "-------------------- Building patchelf from source -----------------" + +cd ${CURRENT_DIR} + +wget https://github.com/NixOS/patchelf/releases/download/0.18.0/patchelf-0.18.0.tar.gz +tar --no-same-owner -xzf patchelf-0.18.0.tar.gz +cd patchelf-0.18.0 + +./configure --prefix=/usr +make -j$(nproc) +make install + +patchelf --version + +cd ${CURRENT_DIR} + +# ----------------------------------------------------------------------------- +# Build numactl from source +# ----------------------------------------------------------------------------- + +echo "-------------------- Building numactl from source ------------------" + +cd ${CURRENT_DIR} + +git clone https://github.com/numactl/numactl +cd numactl +git checkout v2.0.19 + +./autogen.sh +./configure --prefix=/usr --libdir=/usr/lib64 +make -j$(nproc) +make install + +# Register numactl libraries +echo "/usr/local/lib" > /etc/ld.so.conf.d/numactl.conf +ldconfig + +export CPLUS_INCLUDE_PATH=/usr/local/include:${CPLUS_INCLUDE_PATH} +export LIBRARY_PATH=/usr/local/lib:${LIBRARY_PATH} +export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} +export CMAKE_PREFIX_PATH=/usr/local:${CMAKE_PREFIX_PATH} + +cd ${CURRENT_DIR} + +# ----------------------------------------------------------------------------- +# Build Protobuf from source +# NOTE: UBI 9.5 does not have protobuf-devel in repositories, so we build from source +# ----------------------------------------------------------------------------- + +echo "-------------------- Building Protobuf 3.20.3 from source -----------" + +wget https://github.com/protocolbuffers/protobuf/releases/download/v3.20.3/protobuf-cpp-3.20.3.tar.gz +tar --no-same-owner -xzf protobuf-cpp-3.20.3.tar.gz +cd protobuf-3.20.3 + +./configure --prefix=/usr --libdir=/usr/lib64 +make -j$(nproc) +make install +ldconfig + +export Protobuf_INCLUDE_DIR=/usr/include +export Protobuf_LIBRARIES=/usr/lib64/libprotobuf.so +export Protobuf_PROTOC_EXECUTABLE=/usr/bin/protoc +export CMAKE_PREFIX_PATH=/usr:${CMAKE_PREFIX_PATH} + +cd ${CURRENT_DIR} + +# ----------------------------------------------------------------------------- +# Python tooling +# ----------------------------------------------------------------------------- + +echo "-------------------- Upgrading Python tooling ---------------------" + +python3.12 -m pip install --upgrade pip setuptools wheel +python3.12 -m pip install \ + "setuptools==68.0.0" \ + wheel \ + ninja \ + setuptools_scm \ + packaging \ + cmake \ + cython \ + maturin \ + setuptools_rust \ + cffi \ + scikit-build-core \ + auditwheel + +# ----------------------------------------------------------------------------- +# Python dependencies +# ----------------------------------------------------------------------------- + +echo "-------------------- Installing Python dependencies ----------------" + +IBM_WHEELS="https://wheels.developerfirst.ibm.com/ppc64le/linux/+simple/" + +# Pre-install apache-tvm-ffi before other packages that depend on it +python3.12 -m pip install apache-tvm-ffi + +python3.12 -m pip install \ + --only-binary numpy,scipy,sentencepiece \ + --trusted-host wheels.developerfirst.ibm.com \ + --extra-index-url ${IBM_WHEELS} \ + numpy scipy protobuf sentencepiece tqdm requests \ + sympy networkx Jinja2 + +# ----------------------------------------------------------------------------- +# Build vLLM +# ----------------------------------------------------------------------------- + +echo "-------------------- Building vLLM ---------------------------------" + +rm -rf vllm + +git clone ${PACKAGE_URL} +cd ${PACKAGE_DIR} +git checkout ${PACKAGE_VERSION} + +# Remove numba from requirements +if [ -f "requirements/cpu.txt" ]; then + sed -i '/^numba/d' requirements/cpu.txt +fi + +if [ -f "pyproject.toml" ]; then + sed -i '/numba/d' pyproject.toml +fi + +python3.12 -m pip install --no-build-isolation \ + --only-binary numpy,scipy,sentencepiece,msgspec,cbor2 \ + --trusted-host wheels.developerfirst.ibm.com \ + --extra-index-url ${IBM_WHEELS} \ + -r requirements/cpu.txt + +python3.12 -m pip install llguidance xgrammar + +export VLLM_TARGET_DEVICE=cpu +export MAX_JOBS=$(nproc) + +# Build wheel into staging directory (pre-repair) +python3.12 setup.py bdist_wheel --dist-dir="${CURRENT_DIR}/pre_repair" + +cd ${CURRENT_DIR} + + +echo "-------------------- Repairing wheel with auditwheel ---------------" + +PRE_REPAIR_WHEEL=$(ls ${CURRENT_DIR}/pre_repair/vllm-*.whl) + +TORCH_LIB_PATH=$(python3.12 -c "import torch; import os; print(os.path.dirname(torch.__file__))")/lib +echo "Torch lib path: ${TORCH_LIB_PATH}" +export LD_LIBRARY_PATH=${TORCH_LIB_PATH}:${LD_LIBRARY_PATH} + +echo "Pre-repair wheel: ${PRE_REPAIR_WHEEL}" +echo "Inspecting external dependencies before repair..." +auditwheel show ${PRE_REPAIR_WHEEL} + +auditwheel repair ${PRE_REPAIR_WHEEL} \ + --plat manylinux_2_34_ppc64le \ + --exclude libc10.so \ + --exclude libtorch.so \ + --exclude libtorch_cpu.so \ + --exclude libtorch_python.so \ + --wheel-dir "${CURRENT_DIR}" + +REPAIRED_WHEEL=$(ls ${CURRENT_DIR}/vllm-*.whl) +echo "Repaired wheel: ${REPAIRED_WHEEL}" + +echo "Verifying bundled libraries in repaired wheel..." +auditwheel show ${REPAIRED_WHEEL} + +echo "===================================================================" +echo " vLLM WHEEL BUILT SUCCESSFULLY (v0.21.0)" +echo "===================================================================" + +# ----------------------------------------------------------------------------- +# Test - install repaired wheel in a clean venv +# ----------------------------------------------------------------------------- + +echo "-------------------- Testing repaired wheel in clean venv ----------" + +python3.12 -m venv /tmp/vllm_test_env +source /tmp/vllm_test_env/bin/activate + +python3.12 -m pip install --upgrade pip + +# Install exactly as a user would - single command, let pip resolve all deps +python3.12 -m pip install --no-cache-dir -v --prefer-binary \ + --extra-index-url ${IBM_WHEELS} \ + ${REPAIRED_WHEEL} + +echo "Running basic offline inference example..." + +export VLLM_CPU_KVCACHE_SPACE=4 + +if ! python3.12 ${CURRENT_DIR}/${PACKAGE_DIR}/examples/basic/offline_inference/basic.py; then + echo "INSTALL SUCCESS BUT TEST FAILED" + exit 2 +else + echo "INSTALL AND TEST SUCCESS" + exit 0 +fi \ No newline at end of file From d593ac22efe79ed04df5638c435a1ebe16a8bbdb Mon Sep 17 00:00:00 2001 From: Akash kaothalkar Date: Fri, 15 May 2026 17:28:20 +0530 Subject: [PATCH 2/4] chore: fix header --- v/vllm/vllm_v0.21.0_ubi_9.5.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/v/vllm/vllm_v0.21.0_ubi_9.5.sh b/v/vllm/vllm_v0.21.0_ubi_9.5.sh index de36058b43..f4596e2654 100644 --- a/v/vllm/vllm_v0.21.0_ubi_9.5.sh +++ b/v/vllm/vllm_v0.21.0_ubi_9.5.sh @@ -1,23 +1,22 @@ #!/bin/bash -e -# ----------------------------------------------------------------------------- -# -# Package : vllm -# Version : v0.21.0 -# Source repo : https://github.com/vllm-project/vllm -# Tested on : UBI:9.5 -# Language : Python -# Ci-Check : True +# Required format: +# Package : vllm +# Version : v0.21.0 +# Source repo : https://github.com/vllm-project/vllm +# Tested on : UBI:9.5 +# Language : Python +# Ci-Check : True # Script License: Apache License 2.0 -# Maintainer : Akash Kaothalkar -# +# Maintainer : Akash Kaothalkar # # Disclaimer: This script has been tested in root mode on given # ========== platform using the mentioned version of the package. # It may not work as expected with newer versions of the # package and/or distribution. In such case, please # contact "Maintainer" of this script. -# ----------------------------------------------------------------------------- +# +# ---------------------------------------------------------------------------- set -eo pipefail From a0f534ef51ad91b53195ebb26fe604b0e6dce283 Mon Sep 17 00:00:00 2001 From: Akash kaothalkar Date: Fri, 15 May 2026 21:12:49 +0530 Subject: [PATCH 3/4] remove auditwheel Signed-off-by: Akash kaothalkar --- v/vllm/vllm_v0.21.0_ubi_9.5.sh | 68 ++++------------------------------ 1 file changed, 7 insertions(+), 61 deletions(-) diff --git a/v/vllm/vllm_v0.21.0_ubi_9.5.sh b/v/vllm/vllm_v0.21.0_ubi_9.5.sh index f4596e2654..a8d4e73ea4 100644 --- a/v/vllm/vllm_v0.21.0_ubi_9.5.sh +++ b/v/vllm/vllm_v0.21.0_ubi_9.5.sh @@ -73,21 +73,6 @@ gcc --version g++ --version -echo "-------------------- Building patchelf from source -----------------" - -cd ${CURRENT_DIR} - -wget https://github.com/NixOS/patchelf/releases/download/0.18.0/patchelf-0.18.0.tar.gz -tar --no-same-owner -xzf patchelf-0.18.0.tar.gz -cd patchelf-0.18.0 - -./configure --prefix=/usr -make -j$(nproc) -make install - -patchelf --version - -cd ${CURRENT_DIR} # ----------------------------------------------------------------------------- # Build numactl from source @@ -158,8 +143,7 @@ python3.12 -m pip install \ maturin \ setuptools_rust \ cffi \ - scikit-build-core \ - auditwheel + scikit-build-core # ----------------------------------------------------------------------------- # Python dependencies @@ -211,63 +195,25 @@ python3.12 -m pip install llguidance xgrammar export VLLM_TARGET_DEVICE=cpu export MAX_JOBS=$(nproc) -# Build wheel into staging directory (pre-repair) -python3.12 setup.py bdist_wheel --dist-dir="${CURRENT_DIR}/pre_repair" +export SETUPTOOLS_SCM_PRETEND_VERSION=${PACKAGE_VERSION#v} +python3.12 setup.py install +python3.12 setup.py bdist_wheel --dist-dir="${CURRENT_DIR}" cd ${CURRENT_DIR} - -echo "-------------------- Repairing wheel with auditwheel ---------------" - -PRE_REPAIR_WHEEL=$(ls ${CURRENT_DIR}/pre_repair/vllm-*.whl) - -TORCH_LIB_PATH=$(python3.12 -c "import torch; import os; print(os.path.dirname(torch.__file__))")/lib -echo "Torch lib path: ${TORCH_LIB_PATH}" -export LD_LIBRARY_PATH=${TORCH_LIB_PATH}:${LD_LIBRARY_PATH} - -echo "Pre-repair wheel: ${PRE_REPAIR_WHEEL}" -echo "Inspecting external dependencies before repair..." -auditwheel show ${PRE_REPAIR_WHEEL} - -auditwheel repair ${PRE_REPAIR_WHEEL} \ - --plat manylinux_2_34_ppc64le \ - --exclude libc10.so \ - --exclude libtorch.so \ - --exclude libtorch_cpu.so \ - --exclude libtorch_python.so \ - --wheel-dir "${CURRENT_DIR}" - -REPAIRED_WHEEL=$(ls ${CURRENT_DIR}/vllm-*.whl) -echo "Repaired wheel: ${REPAIRED_WHEEL}" - -echo "Verifying bundled libraries in repaired wheel..." -auditwheel show ${REPAIRED_WHEEL} - echo "===================================================================" echo " vLLM WHEEL BUILT SUCCESSFULLY (v0.21.0)" echo "===================================================================" # ----------------------------------------------------------------------------- -# Test - install repaired wheel in a clean venv +# Test - Run tests with installed vLLM # ----------------------------------------------------------------------------- -echo "-------------------- Testing repaired wheel in clean venv ----------" - -python3.12 -m venv /tmp/vllm_test_env -source /tmp/vllm_test_env/bin/activate - -python3.12 -m pip install --upgrade pip - -# Install exactly as a user would - single command, let pip resolve all deps -python3.12 -m pip install --no-cache-dir -v --prefer-binary \ - --extra-index-url ${IBM_WHEELS} \ - ${REPAIRED_WHEEL} - -echo "Running basic offline inference example..." +echo "-------------------- Testing installed vLLM ------------------------" export VLLM_CPU_KVCACHE_SPACE=4 -if ! python3.12 ${CURRENT_DIR}/${PACKAGE_DIR}/examples/basic/offline_inference/basic.py; then +if ! python3.12 ${PACKAGE_DIR}/examples/basic/offline_inference/basic.py; then echo "INSTALL SUCCESS BUT TEST FAILED" exit 2 else From 6e0660b1d04e8ec8688aa33e5224c9210c98c55e Mon Sep 17 00:00:00 2001 From: Akash kaothalkar Date: Sun, 17 May 2026 12:05:46 +0530 Subject: [PATCH 4/4] Add pillow 11.2.1 Signed-off-by: Akash kaothalkar --- v/vllm/vllm_v0.21.0_ubi_9.5.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/v/vllm/vllm_v0.21.0_ubi_9.5.sh b/v/vllm/vllm_v0.21.0_ubi_9.5.sh index a8d4e73ea4..621717db46 100644 --- a/v/vllm/vllm_v0.21.0_ubi_9.5.sh +++ b/v/vllm/vllm_v0.21.0_ubi_9.5.sh @@ -156,6 +156,12 @@ IBM_WHEELS="https://wheels.developerfirst.ibm.com/ppc64le/linux/+simple/" # Pre-install apache-tvm-ffi before other packages that depend on it python3.12 -m pip install apache-tvm-ffi +# Pre-install pillow with specific version to avoid build issues +python3.12 -m pip install \ + --trusted-host wheels.developerfirst.ibm.com \ + --extra-index-url ${IBM_WHEELS} \ + pillow==11.2.1 + python3.12 -m pip install \ --only-binary numpy,scipy,sentencepiece \ --trusted-host wheels.developerfirst.ibm.com \