Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,17 @@ RUN --mount=type=cache,target=/opt/uv/cache \
fi && \
python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38

# Record the wheel checksum so downstream stages can bust their layer cache
# when the wheel changes, without copying the wheel itself into the image.
RUN sha256sum dist/*.whl > dist/wheel.sha256

# Copy extension wheels from extensions-build stage for later use
COPY --from=extensions-build /tmp/ep_kernels_workspace/dist /tmp/ep_kernels_workspace/dist

# Record the EP kernels wheel checksum for the same cache-busting purpose.
RUN sha256sum /tmp/ep_kernels_workspace/dist/*.whl \
> /tmp/ep_kernels_workspace/dist/wheels.sha256

# Check the size of the wheel if RUN_WHEEL_CHECK is true
COPY .buildkite/check-wheel-size.py check-wheel-size.py
# sync the default value with .buildkite/check-wheel-size.py
Expand Down Expand Up @@ -838,6 +846,11 @@ ARG PYTORCH_NIGHTLY
# Install vLLM wheel first, so that torch etc will be installed.
# Check whether to install torch nightly instead of release for this build.
COPY --from=base /workspace/torch_lib_versions.txt torch_lib_versions.txt
# Copy only the wheel checksum (a few bytes) so a wheel change invalidates this
# install layer. The wheel itself is bind-mounted below and never enters the
# image. Without this the bind mount is not part of the layer cache key, so a
# warm BuildKit agent can skip the install and ship a stale wheel.
COPY --from=build /workspace/dist/wheel.sha256 /tmp/vllm-wheel.sha256
RUN --mount=type=bind,from=build,src=/workspace/dist,target=/vllm-workspace/dist \
--mount=type=cache,target=/opt/uv/cache \
if [ "${PYTORCH_NIGHTLY}" = "1" ]; then \
Expand All @@ -860,7 +873,10 @@ uv pip list
# Pytorch now installs NVSHMEM, setting LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

# Install EP kernels wheels (DeepEP) that have been built in the `build` stage
# Install EP kernels wheels (DeepEP) that have been built in the `build` stage.
# As with the vLLM wheel above, copy only the checksum to bust the layer cache
# and bind-mount the wheel for the actual install to keep it out of the image.
COPY --from=build /tmp/ep_kernels_workspace/dist/wheels.sha256 /tmp/ep-kernels-wheels.sha256
RUN --mount=type=bind,from=build,src=/tmp/ep_kernels_workspace/dist,target=/vllm-workspace/ep_kernels/dist \
--mount=type=cache,target=/opt/uv/cache \
uv pip install --system ep_kernels/dist/*.whl --verbose \
Expand Down
50 changes: 50 additions & 0 deletions tests/entrypoints/anthropic/test_protocol_exports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
"""Regression tests for Anthropic protocol exports used by serving.

Guards against Docker/nightly images shipping a stale protocol module that is
missing symbols imported by ``vllm.entrypoints.anthropic.serving`` (issue #44759).
"""

import pytest

from vllm.entrypoints.anthropic.protocol import (
AnthropicContentBlock,
AnthropicContextManagement,
AnthropicCountTokensRequest,
AnthropicCountTokensResponse,
AnthropicDelta,
AnthropicError,
AnthropicMessagesRequest,
AnthropicMessagesResponse,
AnthropicOutputConfig,
AnthropicStreamEvent,
AnthropicUsage,
)
Comment on lines +11 to +23

pytestmark = pytest.mark.skip_global_cleanup

SERVING_PROTOCOL_EXPORTS = (
AnthropicContentBlock,
AnthropicContextManagement,
AnthropicCountTokensRequest,
AnthropicCountTokensResponse,
AnthropicDelta,
AnthropicError,
AnthropicMessagesRequest,
AnthropicMessagesResponse,
AnthropicOutputConfig,
AnthropicStreamEvent,
AnthropicUsage,
)


def test_serving_protocol_exports_are_importable():
for export in SERVING_PROTOCOL_EXPORTS:
assert export is not None
Comment on lines +27 to +44


def test_anthropic_output_config_instantiation():
config = AnthropicOutputConfig()
assert config.effort is None
assert config.format is None
Comment on lines +47 to +50
Loading