Skip to content

Commit a2c71c5

Browse files
authored
[CI/Build] remove .github from .dockerignore, add dirty repo check (vllm-project#9375)
1 parent 81ede99 commit a2c71c5

12 files changed

+54
-17
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 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 GIT_REPO_CHECK=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 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 GIT_REPO_CHECK=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

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/.github/
21
/.venv
32
/build
43
dist

.github/workflows/scripts/build.sh

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -eux
23

34
python_executable=python$1
45
cuda_home=/usr/local/cuda-$2
@@ -15,5 +16,8 @@ export MAX_JOBS=1
1516
# Make sure release wheels are built for the following architectures
1617
export TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6 8.9 9.0+PTX"
1718
export VLLM_FA_CMAKE_GPU_ARCHES="80-real;90-real"
19+
20+
bash tools/check_repo.sh
21+
1822
# Build
1923
$python_executable setup.py bdist_wheel --dist-dir=dist

Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ COPY requirements-build.txt requirements-build.txt
7070
RUN --mount=type=cache,target=/root/.cache/pip \
7171
python3 -m pip install -r requirements-build.txt
7272

73-
# files and directories related to build wheels
7473
COPY . .
74+
ARG GIT_REPO_CHECK=0
75+
RUN --mount=type=bind,source=.git,target=.git \
76+
if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
7577

7678
# max jobs used by Ninja to build extensions
7779
ARG max_jobs=2

Dockerfile.cpu

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ RUN --mount=type=cache,target=/root/.cache/pip \
4242
--mount=type=bind,src=requirements-cpu.txt,target=requirements-cpu.txt \
4343
pip install -v -r requirements-cpu.txt
4444

45-
COPY ./ ./
45+
COPY . .
46+
ARG GIT_REPO_CHECK=0
47+
RUN --mount=type=bind,source=.git,target=.git \
48+
if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
4649

4750
# Support for building with non-AVX512 vLLM: docker build --build-arg VLLM_CPU_DISABLE_AVX512="true" ...
4851
ARG VLLM_CPU_DISABLE_AVX512

Dockerfile.neuron

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ RUN apt-get update && \
1717
# When launching the container, mount the code directory to /app
1818
ARG APP_MOUNT=/app
1919
VOLUME [ ${APP_MOUNT} ]
20-
WORKDIR ${APP_MOUNT}
20+
WORKDIR ${APP_MOUNT}/vllm
2121

2222
RUN python3 -m pip install --upgrade pip
2323
RUN python3 -m pip install --no-cache-dir fastapi ninja tokenizers pandas
2424
RUN python3 -m pip install sentencepiece transformers==4.36.2 -U
2525
RUN python3 -m pip install transformers-neuronx --extra-index-url=https://pip.repos.neuron.amazonaws.com -U
2626
RUN python3 -m pip install --pre neuronx-cc==2.15.* --extra-index-url=https://pip.repos.neuron.amazonaws.com -U
2727

28-
COPY . /app/vllm
28+
COPY . .
29+
ARG GIT_REPO_CHECK=0
30+
RUN --mount=type=bind,source=.git,target=.git \
31+
if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
2932

30-
RUN cd /app/vllm \
31-
&& python3 -m pip install -U \
33+
RUN python3 -m pip install -U \
3234
cmake>=3.26 ninja packaging setuptools-scm>=8 wheel jinja2 \
3335
-r requirements-neuron.txt
3436

3537
ENV VLLM_TARGET_DEVICE neuron
3638
RUN --mount=type=bind,source=.git,target=.git \
37-
cd /app/vllm \
38-
&& pip install --no-build-isolation -v -e . \
39-
&& cd ..
39+
pip install --no-build-isolation -v -e . \
4040

4141
CMD ["/bin/bash"]

Dockerfile.openvino

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ RUN apt-get update -y && \
1010
WORKDIR /workspace
1111

1212
COPY . .
13+
ARG GIT_REPO_CHECK=0
14+
RUN --mount=type=bind,source=.git,target=.git \
15+
if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
1316

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

Dockerfile.ppc64le

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ RUN micromamba install -y -n base -c https://ftp.osuosl.org/pub/open-ce/1.11.0-p
1414
COPY ./ /workspace/vllm
1515

1616
WORKDIR /workspace/vllm
17+
ARG GIT_REPO_CHECK=0
18+
RUN --mount=type=bind,source=.git,target=.git \
19+
if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh; fi
1720

1821
# These packages will be in rocketce eventually
1922
RUN --mount=type=cache,target=/root/.cache/pip \

Dockerfile.rocm

+3
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ RUN --mount=type=cache,target=${CCACHE_DIR} \
117117
FROM base AS final
118118
# Import the vLLM development directory from the build context
119119
COPY . .
120+
ARG GIT_REPO_CHECK=0
121+
RUN --mount=type=bind,source=.git,target=.git \
122+
if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
120123

121124
# Package upgrades for useful functionality or to avoid dependency issues
122125
RUN --mount=type=cache,target=/root/.cache/pip \

Dockerfile.tpu

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG NIGHTLY_DATE="20240828"
22
ARG BASE_IMAGE="us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/xla:nightly_3.10_tpuvm_$NIGHTLY_DATE"
33

44
FROM $BASE_IMAGE
5-
WORKDIR /workspace
5+
WORKDIR /workspace/vllm
66

77
# Install some basic utilities
88
RUN apt-get update && apt-get install -y \
@@ -16,14 +16,17 @@ RUN --mount=type=cache,target=/root/.cache/pip \
1616
python3 -m pip install torch_xla[pallas] -f https://storage.googleapis.com/jax-releases/jax_nightly_releases.html -f https://storage.googleapis.com/jax-releases/jaxlib_nightly_releases.html
1717

1818
# Build vLLM.
19-
COPY . /workspace/vllm
19+
COPY . .
20+
ARG GIT_REPO_CHECK=0
21+
RUN --mount=type=bind,source=.git,target=.git \
22+
if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh; fi
23+
2024
ENV VLLM_TARGET_DEVICE="tpu"
2125
RUN --mount=type=cache,target=/root/.cache/pip \
2226
--mount=type=bind,source=.git,target=.git \
23-
cd /workspace/vllm && \
2427
python3 -m pip install \
2528
cmake>=3.26 ninja packaging setuptools-scm>=8 wheel jinja2 \
2629
-r requirements-tpu.txt
27-
RUN cd /workspace/vllm && python3 setup.py develop
30+
RUN python3 setup.py develop
2831

2932
CMD ["/bin/bash"]

Dockerfile.xpu

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ RUN --mount=type=cache,target=/root/.cache/pip \
3333
--extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ \
3434
-r requirements-xpu.txt
3535

36-
COPY ./ /workspace/vllm
36+
COPY . .
37+
ARG GIT_REPO_CHECK
38+
RUN --mount=type=bind,source=.git,target=.git \
39+
if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh; fi
3740

3841
ENV VLLM_TARGET_DEVICE=xpu
3942

tools/check_repo.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# Checks whether the repo is clean and whether tags are available (necessary to correctly produce vllm version at build time)
3+
4+
if ! git diff --quiet; then
5+
echo "Repo is dirty" >&2
6+
7+
exit 1
8+
fi
9+
10+
if ! git describe --tags; then
11+
echo "No tags are present. Is this a shallow clone? git fetch --unshallow --tags" >&2
12+
13+
exit 1
14+
fi

0 commit comments

Comments
 (0)