@@ -23,12 +23,12 @@ RUN git clone $VLLM_REPO /workspace/vllm
2323RUN if [ -n "$VLLM_COMMIT_HASH" ]; then \
2424 git checkout $VLLM_COMMIT_HASH; \
2525 fi
26- RUN pip install -r requirements/tpu.txt --retries 3
27- RUN VLLM_TARGET_DEVICE="tpu" pip install -e .
26+ RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements/tpu.txt --retries 3
27+ RUN --mount=type=cache,target=/root/.cache/pip VLLM_TARGET_DEVICE="tpu" pip install -e .
2828
2929# Install test dependencies
30- RUN python3 -m pip install -e tests/vllm_test_utils
31- RUN python3 -m pip install --no-cache-dir \
30+ RUN --mount=type=cache,target=/root/.cache/pip python3 -m pip install -e tests/vllm_test_utils
31+ RUN --mount=type=cache,target=/root/.cache/pip python3 -m pip install \
3232 git+https://github.com/thuml/depyf.git \
3333 pytest-asyncio \
3434 git+https://github.com/EleutherAI/lm-evaluation-harness.git@206b7722158f58c35b7ffcd53b035fdbdda5126d#egg=lm-eval[api] \
@@ -39,18 +39,18 @@ RUN python3 -m pip install --no-cache-dir \
3939WORKDIR /workspace/tpu_inference
4040# Install requirements first and cache so we don't need to re-install on code change.
4141COPY requirements.txt .
42- RUN pip install -r requirements.txt --retries 3
42+ RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt --retries 3
4343COPY requirements_benchmarking.txt .
4444# These are needed for the E2E benchmarking tests (i.e. tests/e2e/benchmarking/mlperf.sh)
45- RUN pip install -r requirements_benchmarking.txt --retries 3
45+ RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements_benchmarking.txt --retries 3
4646COPY . .
47- RUN pip install -e .
47+ RUN --mount=type=cache,target=/root/.cache/pip pip install -e .
4848
4949# TODO (jacobplatin): remove when v7x is supported in JAX/Libtpu officially
5050# NOTE: it's important that this is done after installing tpu_inference above,
5151# so that the v7x-specific dependencies can override any existing ones.
5252COPY requirements_v7x.txt .
53- RUN if [ "$IS_FOR_V7X" = "true" ]; then \
53+ RUN --mount=type=cache,target=/root/.cache/pip if [ "$IS_FOR_V7X" = "true" ]; then \
5454 pip install -r requirements_v7x.txt; \
5555 fi
5656
0 commit comments