Skip to content

Commit b2ebbc1

Browse files
dtrifirosumitd2
authored andcommitted
[CI/Build] setuptools-scm fixes (vllm-project#8900)
Signed-off-by: Sumit Dubey <sumit.dubey2@ibm.com>
1 parent 8afcf71 commit b2ebbc1

File tree

7 files changed

+47
-41
lines changed

7 files changed

+47
-41
lines changed

.buildkite/release-pipeline.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ steps:
33
agents:
44
queue: cpu_queue
55
commands:
6-
- "DOCKER_BUILDKIT=1 docker build --build-arg max_jobs=16 --build-arg buildkite_commit=$BUILDKITE_COMMIT --build-arg USE_SCCACHE=1 --build-arg CUDA_VERSION=12.1.0 --tag vllm-ci:build-image --target build --progress plain ."
6+
- "DOCKER_BUILDKIT=1 docker build --build-arg max_jobs=16 --build-arg USE_SCCACHE=1 --build-arg CUDA_VERSION=12.1.0 --tag vllm-ci:build-image --target build --progress plain ."
77
- "mkdir artifacts"
88
- "docker run --rm -v $(pwd)/artifacts:/artifacts_host vllm-ci:build-image bash -c 'cp -r dist /artifacts_host && chmod -R a+rw /artifacts_host'"
99
# rename the files to change linux -> manylinux1
@@ -22,7 +22,7 @@ steps:
2222
agents:
2323
queue: cpu_queue
2424
commands:
25-
- "DOCKER_BUILDKIT=1 docker build --build-arg max_jobs=16 --build-arg buildkite_commit=$BUILDKITE_COMMIT --build-arg USE_SCCACHE=1 --build-arg CUDA_VERSION=11.8.0 --tag vllm-ci:build-image --target build --progress plain ."
25+
- "DOCKER_BUILDKIT=1 docker build --build-arg max_jobs=16 --build-arg USE_SCCACHE=1 --build-arg CUDA_VERSION=11.8.0 --tag vllm-ci:build-image --target build --progress plain ."
2626
- "mkdir artifacts"
2727
- "docker run --rm -v $(pwd)/artifacts:/artifacts_host vllm-ci:build-image bash -c 'cp -r dist /artifacts_host && chmod -R a+rw /artifacts_host'"
2828
# rename the files to change linux -> manylinux1

.dockerignore

+29-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,33 @@
22
/.venv
33
/build
44
dist
5-
Dockerfile*
65
vllm/*.so
6+
7+
# Byte-compiled / optimized / DLL files
8+
__pycache__/
9+
*.py[cod]
10+
*$py.class
11+
12+
.mypy_cache
13+
14+
# Distribution / packaging
15+
.Python
16+
/build/
17+
cmake-build-*/
18+
CMakeUserPresets.json
19+
develop-eggs/
20+
/dist/
21+
downloads/
22+
eggs/
23+
.eggs/
24+
lib/
25+
lib64/
26+
parts/
27+
sdist/
28+
var/
29+
wheels/
30+
share/python-wheels/
31+
*.egg-info/
32+
.installed.cfg
33+
*.egg
34+
MANIFEST

.github/workflows/scripts/build.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ PATH=${cuda_home}/bin:$PATH
88
LD_LIBRARY_PATH=${cuda_home}/lib64:$LD_LIBRARY_PATH
99

1010
# Install requirements
11-
$python_executable -m pip install wheel packaging 'setuptools-scm>=8'
12-
$python_executable -m pip install -r requirements-cuda.txt
11+
$python_executable -m pip install -r requirements-build.txt -r requirements-cuda.txt
1312

1413
# Limit the number of parallel jobs to avoid OOM
1514
export MAX_JOBS=1

Dockerfile

+1-9
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
7171
python3 -m pip install -r requirements-build.txt
7272

7373
# files and directories related to build wheels
74-
COPY csrc csrc
75-
COPY setup.py setup.py
76-
COPY cmake cmake
77-
COPY CMakeLists.txt CMakeLists.txt
78-
COPY README.md README.md
79-
COPY requirements-common.txt requirements-common.txt
80-
COPY requirements-cuda.txt requirements-cuda.txt
81-
COPY pyproject.toml pyproject.toml
82-
COPY vllm vllm
74+
COPY . .
8375

8476
# max jobs used by Ninja to build extensions
8577
ARG max_jobs=2

Dockerfile.openvino

+1-10
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,7 @@ RUN apt-get update -y && \
99
ffmpeg libsm6 libxext6 libgl1
1010
WORKDIR /workspace
1111

12-
# copy requirements
13-
COPY requirements-build.txt /workspace/vllm/
14-
COPY requirements-common.txt /workspace/vllm/
15-
COPY requirements-openvino.txt /workspace/vllm/
16-
17-
COPY vllm/ /workspace/vllm/vllm
18-
COPY csrc/core /workspace/vllm/csrc/core
19-
COPY cmake/utils.cmake /workspace/vllm/cmake/
20-
COPY CMakeLists.txt /workspace/vllm/
21-
COPY setup.py /workspace/vllm/
12+
COPY . .
2213

2314
# install build requirements
2415
RUN PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu" python3 -m pip install -r /workspace/vllm/requirements-build.txt

collect_env.py

+10-17
Original file line numberDiff line numberDiff line change
@@ -267,23 +267,16 @@ def get_neuron_sdk_version(run_lambda):
267267

268268

269269
def get_vllm_version():
270-
version = ""
271-
try:
272-
import vllm
273-
version = vllm.__version__
274-
except Exception:
275-
pass
276-
commit = ""
277-
try:
278-
import vllm
279-
commit = vllm.__commit__
280-
except Exception:
281-
pass
282-
if version != "" and commit != "":
283-
return f"{version}@{commit}"
284-
if version == "" and commit == "":
285-
return "N/A"
286-
return version or commit
270+
from vllm import __version__, __version_tuple__
271+
272+
if __version__ == "dev":
273+
return "N/A (dev)"
274+
275+
if len(__version_tuple__) == 4: # dev build
276+
git_sha = __version_tuple__[-1][1:] # type: ignore
277+
return f"{__version__} (git sha: {git_sha}"
278+
279+
return __version__
287280

288281
def summarize_vllm_build_flags():
289282
# This could be a static method if the flags are constant, or dynamic if you need to check environment variables, etc.

pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ requires = [
1212
]
1313
build-backend = "setuptools.build_meta"
1414

15+
[tool.setuptools_scm]
16+
# version_file = "vllm/_version.py" # currently handled by `setup.py:get_version()`
17+
1518
[tool.ruff]
1619
# Allow lines to be as long as 80.
1720
line-length = 80

0 commit comments

Comments
 (0)