|
|
@@ -27,20 +27,39 @@ ARG UV_VERSION
|
|
|
|
|
|
FROM ${CUDA_BASE_IMAGE}@${CUDA_BASE_DIGEST} AS apt-base
|
|
|
ARG PYPI_INDEX_URL
|
|
|
+ARG APT_SOURCE
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
|
PIP_BREAK_SYSTEM_PACKAGES=1 \
|
|
|
UV_SYSTEM_PYTHON=1 UV_BREAK_SYSTEM_PACKAGES=1 UV_LINK_MODE=copy
|
|
|
-COPY locks/apt-sources.list /tmp/apt-sources.list
|
|
|
+COPY locks/apt-sources.list /tmp/apt-sources-snapshot.list
|
|
|
COPY locks/apt-packages.txt /tmp/apt-packages.txt
|
|
|
COPY locks/python-bootstrap.txt /tmp/python-bootstrap.txt
|
|
|
-RUN rm -f /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources \
|
|
|
- && cp /tmp/apt-sources.list /etc/apt/sources.list \
|
|
|
- && apt-get update \
|
|
|
- && grep -vE '^\s*(#|$)' /tmp/apt-packages.txt \
|
|
|
- | xargs apt-get install -y --no-install-recommends \
|
|
|
- && rm -rf /var/lib/apt/lists/* \
|
|
|
- && python3 -m pip install --no-cache-dir --no-deps \
|
|
|
- -r /tmp/python-bootstrap.txt --index-url ${PYPI_INDEX_URL}
|
|
|
+# APT_SOURCE (versions.env):
|
|
|
+# snapshot (default, historical behavior): the pinned point-in-time mirror
|
|
|
+# + exact package versions — strictly reproducible, but
|
|
|
+# snapshot.ubuntu.com is slow (~30 kB/s) and intermittently 503s
|
|
|
+# (12-min apt stall, 2026-09-08).
|
|
|
+# current: the live archive.ubuntu.com — fast and reliable; installs the
|
|
|
+# pinned package names unversioned. Acceptable: the engine stack is
|
|
|
+# pinned by the vLLM/B12X/LMCache source pins, not by apt.
|
|
|
+RUN set -eux; \
|
|
|
+ if [ "${APT_SOURCE:-snapshot}" = "current" ]; then \
|
|
|
+ printf '%s\n' \
|
|
|
+ "deb http://ports.ubuntu.com/ubuntu-ports/ noble main restricted universe multiverse" \
|
|
|
+ "deb http://ports.ubuntu.com/ubuntu-ports/ noble-updates main restricted universe multiverse" \
|
|
|
+ "deb http://ports.ubuntu.com/ubuntu-ports/ noble-security main restricted universe multiverse" \
|
|
|
+ > /etc/apt/sources.list; \
|
|
|
+ PKGS="$(grep -vE '^\s*(#|$)' /tmp/apt-packages.txt | cut -d= -f1)"; \
|
|
|
+ else \
|
|
|
+ cp /tmp/apt-sources-snapshot.list /etc/apt/sources.list; \
|
|
|
+ PKGS="$(grep -vE '^\s*(#|$)' /tmp/apt-packages.txt)"; \
|
|
|
+ fi; \
|
|
|
+ rm -f /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; \
|
|
|
+ apt-get update; \
|
|
|
+ apt-get install -y --no-install-recommends ${PKGS}; \
|
|
|
+ rm -rf /var/lib/apt/lists/*; \
|
|
|
+ python3 -m pip install --no-cache-dir --no-deps \
|
|
|
+ -r /tmp/python-bootstrap.txt --index-url "${PYPI_INDEX_URL}"
|
|
|
|
|
|
FROM apt-base AS torch-base
|
|
|
ARG PYPI_INDEX_URL
|