@@ -9,28 +9,23 @@ ARG CUDA_VERSION=12.4.1
9
9
# ################### BASE BUILD IMAGE ####################
10
10
# prepare basic build environment
11
11
FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 AS base
12
-
13
12
ARG CUDA_VERSION=12.4.1
14
13
ARG PYTHON_VERSION=3.10
15
-
16
14
ENV DEBIAN_FRONTEND=noninteractive
17
15
16
+ # Install Python and other dependencies
18
17
RUN echo 'tzdata tzdata/Areas select America' | debconf-set-selections \
19
18
&& echo 'tzdata tzdata/Zones/America select Los_Angeles' | debconf-set-selections \
20
19
&& apt-get update -y \
21
- && apt-get install -y ccache software-properties-common \
20
+ && apt-get install -y ccache software-properties-common git curl sudo \
22
21
&& add-apt-repository ppa:deadsnakes/ppa \
23
22
&& apt-get update -y \
24
23
&& apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv \
25
- && if [ "${PYTHON_VERSION}" != "3" ]; then update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1; fi \
26
- && python3 --version
27
-
28
- RUN apt-get update -y \
29
- && apt-get install -y git curl sudo
30
-
31
- # Install pip s.t. it will be compatible with our PYTHON_VERSION
32
- RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION}
33
- RUN python3 -m pip --version
24
+ && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \
25
+ && update-alternatives --set python3 /usr/bin/python${PYTHON_VERSION} \
26
+ && ln -sf /usr/bin/python${PYTHON_VERSION}-config /usr/bin/python3-config \
27
+ && curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} \
28
+ && python3 --version && python3 -m pip --version
34
29
35
30
# Workaround for https://github.com/openai/triton/issues/2507 and
36
31
# https://github.com/pytorch/pytorch/issues/107960 -- hopefully
@@ -62,17 +57,12 @@ ENV TORCH_CUDA_ARCH_LIST=${torch_cuda_arch_list}
62
57
# ################### WHEEL BUILD IMAGE ####################
63
58
FROM base AS build
64
59
65
- ARG PYTHON_VERSION=3.10
66
-
67
60
# install build dependencies
68
61
COPY requirements-build.txt requirements-build.txt
69
62
70
63
RUN --mount=type=cache,target=/root/.cache/pip \
71
64
python3 -m pip install -r requirements-build.txt
72
65
73
- # install compiler cache to speed up compilation leveraging local or remote caching
74
- RUN apt-get update -y && apt-get install -y ccache
75
-
76
66
# files and directories related to build wheels
77
67
COPY csrc csrc
78
68
COPY setup.py setup.py
@@ -95,6 +85,8 @@ ARG buildkite_commit
95
85
ENV BUILDKITE_COMMIT=${buildkite_commit}
96
86
97
87
ARG USE_SCCACHE
88
+ ARG SCCACHE_BUCKET_NAME=vllm-build-sccache
89
+ ARG SCCACHE_REGION_NAME=us-west-2
98
90
# if USE_SCCACHE is set, use sccache to speed up compilation
99
91
RUN --mount=type=cache,target=/root/.cache/pip \
100
92
if [ "$USE_SCCACHE" = "1" ]; then \
@@ -103,12 +95,9 @@ RUN --mount=type=cache,target=/root/.cache/pip \
103
95
&& tar -xzf sccache.tar.gz \
104
96
&& sudo mv sccache-v0.8.1-x86_64-unknown-linux-musl/sccache /usr/bin/sccache \
105
97
&& rm -rf sccache.tar.gz sccache-v0.8.1-x86_64-unknown-linux-musl \
106
- && if [ "$CUDA_VERSION" = "11.8.0" ]; then \
107
- export SCCACHE_BUCKET=vllm-build-sccache-2; \
108
- else \
109
- export SCCACHE_BUCKET=vllm-build-sccache; \
110
- fi \
111
- && export SCCACHE_REGION=us-west-2 \
98
+ && export SCCACHE_BUCKET=${SCCACHE_BUCKET_NAME} \
99
+ && export SCCACHE_REGION=${SCCACHE_REGION_NAME} \
100
+ && export SCCACHE_IDLE_TIMEOUT=0 \
112
101
&& export CMAKE_BUILD_TYPE=Release \
113
102
&& sccache --show-stats \
114
103
&& python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38 \
@@ -160,23 +149,24 @@ FROM nvidia/cuda:${CUDA_VERSION}-base-ubuntu20.04 AS vllm-base
160
149
ARG CUDA_VERSION=12.4.1
161
150
ARG PYTHON_VERSION=3.10
162
151
WORKDIR /vllm-workspace
152
+ ENV DEBIAN_FRONTEND=noninteractive
153
+
154
+ RUN PYTHON_VERSION_STR=$(echo ${PYTHON_VERSION} | sed 's/\. //g' ) && \
155
+ echo "export PYTHON_VERSION_STR=${PYTHON_VERSION_STR}" >> /etc/environment
163
156
157
+ # Install Python and other dependencies
164
158
RUN echo 'tzdata tzdata/Areas select America' | debconf-set-selections \
165
159
&& echo 'tzdata tzdata/Zones/America select Los_Angeles' | debconf-set-selections \
166
160
&& apt-get update -y \
167
- && apt-get install -y ccache software-properties-common \
161
+ && apt-get install -y ccache software-properties-common git curl sudo vim python3-pip \
168
162
&& add-apt-repository ppa:deadsnakes/ppa \
169
163
&& apt-get update -y \
170
- && apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv \
171
- && if [ "${PYTHON_VERSION}" != "3" ]; then update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1; fi \
172
- && python3 --version
173
-
174
- RUN apt-get update -y \
175
- && apt-get install -y python3-pip git vim curl libibverbs-dev
176
-
177
- # Install pip s.t. it will be compatible with our PYTHON_VERSION
178
- RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION}
179
- RUN python3 -m pip --version
164
+ && apt-get install -y python${PYTHON_VERSION} python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv libibverbs-dev \
165
+ && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \
166
+ && update-alternatives --set python3 /usr/bin/python${PYTHON_VERSION} \
167
+ && ln -sf /usr/bin/python${PYTHON_VERSION}-config /usr/bin/python3-config \
168
+ && curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} \
169
+ && python3 --version && python3 -m pip --version
180
170
181
171
# Workaround for https://github.com/openai/triton/issues/2507 and
182
172
# https://github.com/pytorch/pytorch/issues/107960 -- hopefully
@@ -194,7 +184,8 @@ RUN --mount=type=bind,from=mamba-builder,src=/usr/src/mamba,target=/usr/src/mamb
194
184
python3 -m pip install /usr/src/mamba/*.whl --no-cache-dir
195
185
196
186
RUN --mount=type=cache,target=/root/.cache/pip \
197
- python3 -m pip install https://github.com/flashinfer-ai/flashinfer/releases/download/v0.1.4/flashinfer-0.1.4+cu121torch2.4-cp310-cp310-linux_x86_64.whl
187
+ . /etc/environment && \
188
+ python3 -m pip install https://github.com/flashinfer-ai/flashinfer/releases/download/v0.1.4/flashinfer-0.1.4+cu121torch2.4-cp${PYTHON_VERSION_STR}-cp${PYTHON_VERSION_STR}-linux_x86_64.whl
198
189
# ################### vLLM installation IMAGE ####################
199
190
200
191
0 commit comments