Skip to content

Commit 1c691f4

Browse files
authored
AArch64 CPU Docker pipeline (#26931)
1 parent 9fce7be commit 1c691f4

File tree

2 files changed

+118
-0
lines changed

2 files changed

+118
-0
lines changed

.buildkite/release-pipeline.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,20 @@ steps:
1515
env:
1616
DOCKER_BUILDKIT: "1"
1717

18+
# aarch64 build.
19+
- label: "Build arm64 CPU wheel"
20+
depends_on: ~
21+
id: build-wheel-arm64-cpu
22+
agents:
23+
queue: arm64_cpu_queue_postmerge
24+
commands:
25+
- "DOCKER_BUILDKIT=1 docker build --build-arg max_jobs=16 --build-arg USE_SCCACHE=1 --build-arg GIT_REPO_CHECK=1 --tag vllm-ci:build-image --target build --progress plain -f docker/Dockerfile.cpu ."
26+
- "mkdir artifacts"
27+
- "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'"
28+
- "bash .buildkite/scripts/upload-wheels.sh"
29+
env:
30+
DOCKER_BUILDKIT: "1"
31+
1832
- label: "Build wheel - CUDA 12.8"
1933
depends_on: ~
2034
id: build-wheel-cuda-12-8
@@ -142,6 +156,22 @@ steps:
142156
env:
143157
DOCKER_BUILDKIT: "1"
144158

159+
- block: "Build arm64 CPU release image"
160+
key: block-arm64-cpu-release-image-build
161+
depends_on: ~
162+
163+
- label: "Build and publish arm64 CPU release image"
164+
depends_on: block-arm64-cpu-release-image-build
165+
agents:
166+
queue: arm64_cpu_queue_postmerge
167+
commands:
168+
- "aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/q9t5s3a7"
169+
- "DOCKER_BUILDKIT=1 docker build --build-arg max_jobs=16 --build-arg GIT_REPO_CHECK=1 --tag public.ecr.aws/q9t5s3a7/vllm-arm64-cpu-release-repo:$(buildkite-agent meta-data get release-version) --tag public.ecr.aws/q9t5s3a7/vllm-arm64-cpu-release-repo:latest --progress plain --target vllm-openai -f docker/Dockerfile.cpu ."
170+
- "docker push public.ecr.aws/q9t5s3a7/vllm-arm64-cpu-release-repo:latest"
171+
- "docker push public.ecr.aws/q9t5s3a7/vllm-arm64-cpu-release-repo:$(buildkite-agent meta-data get release-version)"
172+
env:
173+
DOCKER_BUILDKIT: "1"
174+
145175
- label: "Build and publish nightly multi-arch image to DockerHub"
146176
depends_on:
147177
- create-multi-arch-manifest

docker/Dockerfile.cpu

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,94 @@ RUN --mount=type=cache,target=/root/.cache/uv \
106106
--mount=type=bind,source=.git,target=.git \
107107
VLLM_TARGET_DEVICE=cpu python3 setup.py bdist_wheel
108108

109+
#################### WHEEL BUILD IMAGE ####################
110+
FROM base AS build
111+
ARG TARGETPLATFORM
112+
113+
ARG PIP_INDEX_URL UV_INDEX_URL
114+
ARG PIP_EXTRA_INDEX_URL UV_EXTRA_INDEX_URL
115+
116+
# install build dependencies
117+
COPY requirements/build.txt requirements/build.txt
118+
119+
# This timeout (in seconds) is necessary when installing some dependencies via uv since it's likely to time out
120+
# Reference: https://github.com/astral-sh/uv/pull/1694
121+
ENV UV_HTTP_TIMEOUT=500
122+
ENV UV_INDEX_STRATEGY="unsafe-best-match"
123+
# Use copy mode to avoid hardlink failures with Docker cache mounts
124+
ENV UV_LINK_MODE=copy
125+
126+
RUN --mount=type=cache,target=/root/.cache/uv \
127+
uv pip install --python /opt/venv/bin/python3 -r requirements/build.txt
128+
129+
COPY . .
130+
ARG GIT_REPO_CHECK=0
131+
RUN --mount=type=bind,source=.git,target=.git \
132+
if [ "$GIT_REPO_CHECK" != "0" ]; then bash tools/check_repo.sh ; fi
133+
134+
# max jobs used by Ninja to build extensions
135+
ARG max_jobs=2
136+
ENV MAX_JOBS=${max_jobs}
137+
138+
ARG USE_SCCACHE
139+
ARG SCCACHE_DOWNLOAD_URL=https://github.com/mozilla/sccache/releases/download/v0.8.1/sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz
140+
ARG SCCACHE_ENDPOINT
141+
ARG SCCACHE_BUCKET_NAME=vllm-build-sccache
142+
ARG SCCACHE_REGION_NAME=us-west-2
143+
ARG SCCACHE_S3_NO_CREDENTIALS=0
144+
145+
# Flag to control whether to use pre-built vLLM wheels
146+
ARG VLLM_USE_PRECOMPILED=""
147+
148+
# if USE_SCCACHE is set, use sccache to speed up compilation
149+
RUN --mount=type=cache,target=/root/.cache/uv \
150+
--mount=type=bind,source=.git,target=.git \
151+
if [ "$USE_SCCACHE" = "1" ]; then \
152+
echo "Installing sccache..." \
153+
&& curl -L -o sccache.tar.gz ${SCCACHE_DOWNLOAD_URL} \
154+
&& tar -xzf sccache.tar.gz \
155+
&& sudo mv sccache-v0.8.1-x86_64-unknown-linux-musl/sccache /usr/bin/sccache \
156+
&& rm -rf sccache.tar.gz sccache-v0.8.1-x86_64-unknown-linux-musl \
157+
&& if [ ! -z ${SCCACHE_ENDPOINT} ] ; then export SCCACHE_ENDPOINT=${SCCACHE_ENDPOINT} ; fi \
158+
&& export SCCACHE_BUCKET=${SCCACHE_BUCKET_NAME} \
159+
&& export SCCACHE_REGION=${SCCACHE_REGION_NAME} \
160+
&& export SCCACHE_S3_NO_CREDENTIALS=${SCCACHE_S3_NO_CREDENTIALS} \
161+
&& export SCCACHE_IDLE_TIMEOUT=0 \
162+
&& export CMAKE_BUILD_TYPE=Release \
163+
&& export VLLM_USE_PRECOMPILED="${VLLM_USE_PRECOMPILED}" \
164+
&& export VLLM_DOCKER_BUILD_CONTEXT=1 \
165+
&& sccache --show-stats \
166+
&& python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38 \
167+
&& sccache --show-stats; \
168+
fi
169+
170+
ARG vllm_target_device="cpu"
171+
ENV VLLM_TARGET_DEVICE=${vllm_target_device}
172+
ENV CCACHE_DIR=/root/.cache/ccache
173+
RUN --mount=type=cache,target=/root/.cache/ccache \
174+
--mount=type=cache,target=/root/.cache/uv \
175+
--mount=type=bind,source=.git,target=.git \
176+
if [ "$USE_SCCACHE" != "1" ]; then \
177+
# Clean any existing CMake artifacts
178+
rm -rf .deps && \
179+
mkdir -p .deps && \
180+
export VLLM_USE_PRECOMPILED="${VLLM_USE_PRECOMPILED}" && \
181+
export VLLM_DOCKER_BUILD_CONTEXT=1 && \
182+
python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38; \
183+
fi
184+
185+
# Check the size of the wheel if RUN_WHEEL_CHECK is true
186+
COPY .buildkite/check-wheel-size.py check-wheel-size.py
187+
# sync the default value with .buildkite/check-wheel-size.py
188+
ARG VLLM_MAX_SIZE_MB=450
189+
ENV VLLM_MAX_SIZE_MB=$VLLM_MAX_SIZE_MB
190+
ARG RUN_WHEEL_CHECK=true
191+
RUN if [ "$RUN_WHEEL_CHECK" = "true" ]; then \
192+
python3 check-wheel-size.py dist; \
193+
else \
194+
echo "Skipping wheel size check."; \
195+
fi
196+
109197
######################### TEST DEPS #########################
110198
FROM base AS vllm-test-deps
111199

0 commit comments

Comments
 (0)