Skip to content

Commit 892e903

Browse files
Harden backend pip install against transient timeouts
1 parent cc7badf commit 892e903

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

Dockerfile.backend

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313
# Copy requirements
1414
COPY requirements-backend.txt .
1515

16+
# Make pip more resilient to transient package index/network hiccups in CI.
17+
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
18+
PIP_DEFAULT_TIMEOUT=120
19+
1620
# Install Python dependencies
17-
RUN pip install --no-cache-dir -r requirements-backend.txt
21+
RUN pip install --no-cache-dir \
22+
--retries 10 \
23+
--timeout 120 \
24+
--prefer-binary \
25+
-r requirements-backend.txt
1826

1927
# Copy application files
2028
COPY docs/archive/legacy/code/fl_metrics_translator.py ./fl_metrics_translator.py

Dockerfile.backend.optimized

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1616
# Copy requirements first (leverage layer caching)
1717
COPY requirements-backend.txt .
1818

19+
# Make pip more resilient to transient package index/network hiccups in CI.
20+
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
21+
PIP_DEFAULT_TIMEOUT=120
22+
1923
# Install Python dependencies with optimization flags
2024
RUN pip install --no-cache-dir --user --no-warn-script-location \
25+
--retries 10 \
26+
--timeout 120 \
27+
--prefer-binary \
2128
--compile \
2229
-r requirements-backend.txt
2330

0 commit comments

Comments
 (0)