fix: explicitly wheel a2a-sdk to ensure proper installation in Docker builds

Root cause: pip wheel with requirements.txt containing environment markers
(like 'python_version >= "3.10"') may not reliably create wheels for
packages with such markers, especially in multi-platform Docker builds.

Fix: Explicitly run pip wheel for a2a-sdk after processing requirements.txt,
similar to the existing pattern used for semantic_router and aurelio-sdk
in Dockerfile.non_root.

This ensures the a2a-sdk wheel and all its dependencies are properly
captured in /wheels/ before the runtime stage installs from them.

Affects: Dockerfile, docker/Dockerfile.alpine, docker/Dockerfile.database,
         docker/Dockerfile.dev, docker/Dockerfile.non_root

Co-authored-by: ishaan <ishaan@berri.ai>
This commit is contained in:
Cursor Agent 2026-01-23 19:42:01 +00:00
parent 19141e180e
commit 3a5c22ef83
5 changed files with 13 additions and 5 deletions

View file

@ -33,7 +33,9 @@ RUN ls -1 dist/*.whl | head -1
RUN pip install dist/*.whl
# install dependencies as wheels
RUN pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt
# Note: a2a-sdk is explicitly included to ensure it's wheeled even with environment markers
RUN pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt \
&& pip wheel --no-cache-dir --wheel-dir=/wheels/ "a2a-sdk>=0.3.22"
# ensure pyjwt is used, not jwt
RUN pip uninstall jwt -y

View file

@ -29,7 +29,9 @@ RUN ls -1 dist/*.whl | head -1
RUN pip install dist/*.whl
# install dependencies as wheels
RUN pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt
# Note: a2a-sdk is explicitly included to ensure it's wheeled even with environment markers
RUN pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt \
&& pip wheel --no-cache-dir --wheel-dir=/wheels/ "a2a-sdk>=0.3.22"
# Runtime stage
FROM $LITELLM_RUNTIME_IMAGE AS runtime

View file

@ -40,7 +40,9 @@ RUN ls -1 dist/*.whl | head -1
RUN pip install dist/*.whl
# install dependencies as wheels
RUN pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt
# Note: a2a-sdk is explicitly included to ensure it's wheeled even with environment markers
RUN pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt \
&& pip wheel --no-cache-dir --wheel-dir=/wheels/ "a2a-sdk>=0.3.22"
# Runtime stage
FROM $LITELLM_RUNTIME_IMAGE AS runtime

View file

@ -25,8 +25,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY requirements.txt .
# Install Python dependencies with cache mount for faster rebuilds
# Note: a2a-sdk is explicitly included to ensure it's wheeled even with environment markers
RUN --mount=type=cache,target=/root/.cache/pip \
pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt
pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt \
&& pip wheel --no-cache-dir --wheel-dir=/wheels/ "a2a-sdk>=0.3.22"
# Fix JWT dependency conflicts early
RUN pip uninstall jwt -y || true && \

View file

@ -32,7 +32,7 @@ RUN for i in 1 2 3; do \
# Cache Python dependencies
COPY requirements.txt .
RUN pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt \
&& pip wheel --no-cache-dir --wheel-dir=/wheels/ "semantic_router==0.1.11" "aurelio-sdk==0.0.19" "PyJWT==2.9.0"
&& pip wheel --no-cache-dir --wheel-dir=/wheels/ "semantic_router==0.1.11" "aurelio-sdk==0.0.19" "PyJWT==2.9.0" "a2a-sdk>=0.3.22"
# Copy source after dependency layers
COPY . .