Skip to content

Commit 3685312

Browse files
committed
fix: install pip transiently in builder, not in requirements
pip is needed only by setup_oss_compliance.sh during the build. Install it via uv in each builder stage rather than pinning it in requirements files, so it never appears as an explicit dependency. Signed-off-by: Junpu Fan <junpu@amazon.com>
1 parent 206de75 commit 3685312

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

docker/lambda/Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ COPY --from=lambda-python /var/lang/lib /var/lang/lib
6868
RUN rm -rf /var/lang/lib/python3.13/site-packages
6969
ENV PATH="/var/lang/bin:$PATH"
7070
COPY ./docker/lambda/requirements-base.txt /tmp/requirements.txt
71-
RUN --mount=type=cache,target=/root/.cache/uv uv pip install --python /var/lang/bin/python3.13 pip==25.3 \
72-
&& uv pip install --python /var/lang/bin/python3.13 -r /tmp/requirements.txt
71+
RUN --mount=type=cache,target=/root/.cache/uv uv pip install --python /var/lang/bin/python3.13 -r /tmp/requirements.txt
7372

7473
# ============================================================
7574
# CuPy builder (Python 3.13 — awslambdaric, CuPy, NumPy, SciPy, etc.)
@@ -82,8 +81,7 @@ RUN rm -rf /var/lang/lib/python3.13/site-packages
8281
ENV PATH="/var/lang/bin:$PATH"
8382
COPY ./docker/lambda/requirements-cupy.txt /tmp/requirements.txt
8483
RUN --mount=type=cache,target=/root/.cache/uv \
85-
uv pip install --python /var/lang/bin/python3.13 pip==25.3 \
86-
&& uv pip install --python /var/lang/bin/python3.13 -r /tmp/requirements.txt \
84+
uv pip install --python /var/lang/bin/python3.13 -r /tmp/requirements.txt \
8785
&& uv pip check --python /var/lang/bin/python3.13 \
8886
&& (find /var/lang -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null; true) \
8987
&& find /var/lang -type f -name "*.pyc" -delete \
@@ -100,8 +98,7 @@ RUN rm -rf /var/lang/lib/python3.13/site-packages
10098
ENV PATH="/var/lang/bin:$PATH"
10199
COPY ./docker/lambda/requirements-pytorch.txt /tmp/requirements.txt
102100
RUN --mount=type=cache,target=/root/.cache/uv \
103-
uv pip install --python /var/lang/bin/python3.13 pip==25.3 \
104-
&& uv pip install --index-strategy unsafe-best-match --python /var/lang/bin/python3.13 -r /tmp/requirements.txt \
101+
uv pip install --index-strategy unsafe-best-match --python /var/lang/bin/python3.13 -r /tmp/requirements.txt \
105102
&& uv pip check --python /var/lang/bin/python3.13 \
106103
&& (find /var/lang -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null; true) \
107104
&& (find /var/lang -type d -name tests -exec rm -rf {} + 2>/dev/null; true) \

docker/lambda/requirements-base.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
awslambdaric==3.1.1
2+
pip==25.3
23
pip-licenses==5.5.1
34
requests==2.32.5
45
setuptools==78.1.1

docker/lambda/requirements-cupy.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ cvxpy==1.8.1
55
numba==0.64.0
66
numpy==2.4.2
77
pandas==3.0.1
8+
pip==25.3
89
pip-licenses==5.5.1
910
requests==2.32.5
1011
scipy==1.17.1

docker/lambda/requirements-pytorch.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ librosa==0.11.0
88
numpy==2.4.2
99
opencv-python-headless==4.13.0.92
1010
pillow==12.1.1
11+
pip==25.3
1112
pip-licenses==5.5.1
1213
requests==2.32.5
1314
safetensors==0.7.0

0 commit comments

Comments
 (0)