Dockerfile.tpu 1.18 KB
Newer Older
1
ARG NIGHTLY_DATE="20250730"
2
ARG BASE_IMAGE="us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/xla:nightly_3.12_tpuvm_$NIGHTLY_DATE"
3
4

FROM $BASE_IMAGE
5
WORKDIR /workspace/vllm
6

7
# Install some basic utilities
8
9
RUN apt-get update && apt-get install -y \
    git \
10
11
    ffmpeg libsm6 libxext6 libgl1 && \
    rm -rf /var/lib/apt/lists/*
12

13
# Build vLLM.
14
15
16
17
18
COPY . .
ARG GIT_REPO_CHECK=0
RUN --mount=type=bind,source=.git,target=.git \
    if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh; fi

19
# Remove existing versions of dependencies
20
21
22
# TODO: These packages will remain as dead weight in the Docker image layers.
# We should find a way to build the image without uninstalling these.
# Consider using a different base image.
23
24
RUN pip uninstall -y torch torch_xla torchvision

25
ENV VLLM_TARGET_DEVICE="tpu"
26
27
28
RUN --mount=type=cache,target=/root/.cache/pip \
    --mount=type=bind,source=.git,target=.git \
    python3 -m pip install \
29
        -r requirements/tpu.txt
30
31

RUN --mount=type=cache,target=/root/.cache/pip python3 -m pip install -e .
32

youkaichao's avatar
youkaichao committed
33
# install development dependencies (for testing)
34
RUN --mount=type=cache,target=/root/.cache/pip python3 -m pip install -e tests/vllm_test_utils
youkaichao's avatar
youkaichao committed
35

36
CMD ["/bin/bash"]