mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
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:
parent
19141e180e
commit
3a5c22ef83
5 changed files with 13 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 && \
|
||||
|
|
|
|||
|
|
@ -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 . .
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue