Просмотр исходного кода

containers-lock-python313-and-cache-apt

高宇轩 3 месяцев назад
Родитель
Сommit
b76f9b72c0

+ 13 - 3
containers/6400-dev/Containerfile

@@ -2,15 +2,20 @@ FROM docker.io/library/debian@sha256:abc9cb88a5587630d7f915f47b23b0668fe250fbfc6
 ARG DEBIAN_FRONTEND=noninteractive
 ARG DEBIAN_MIRROR=http://mirrors.aliyun.com/debian
 ARG DEBIAN_SECURITY_MIRROR=http://mirrors.aliyun.com/debian-security
-ARG PYPI_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
+ARG PYPI_INDEX_URL=https://mirrors.aliyun.com/pypi/simple
 RUN sed -i \
       -e "s|https://deb.debian.org/debian|${DEBIAN_MIRROR}|g" \
       -e "s|http://deb.debian.org/debian|${DEBIAN_MIRROR}|g" \
       -e "s|https://security.debian.org/debian-security|${DEBIAN_SECURITY_MIRROR}|g" \
       -e "s|http://security.debian.org/debian-security|${DEBIAN_SECURITY_MIRROR}|g" \
-      /etc/apt/sources.list /etc/apt/sources.list.d/debian.sources 2>/dev/null || true
+      /etc/apt/sources.list /etc/apt/sources.list.d/debian.sources 2>/dev/null || true; \
+    rm -f /etc/apt/apt.conf.d/docker-clean
 RUN apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=30 \
-      -o Acquire::https::Timeout=30 update && apt-get install -y --no-install-recommends \
+      -o Acquire::https::Timeout=30 -o Acquire::http::Pipeline-Depth=0 \
+      -o Acquire::Queue-Mode=access update && apt-get \
+      -o Acquire::Retries=5 -o Acquire::http::Timeout=30 \
+      -o Acquire::http::Pipeline-Depth=0 -o Acquire::Queue-Mode=access \
+      install -y --no-install-recommends \
     ca-certificates git python3 python3-venv python3-pip golang-go iverilog verilator yosys \
     z3 boolector protobuf-compiler unzip zip zstd jq tmux && rm -rf /var/lib/apt/lists/*
 ENV PIP_INDEX_URL=${PYPI_INDEX_URL} \
@@ -18,4 +23,9 @@ ENV PIP_INDEX_URL=${PYPI_INDEX_URL} \
     PIP_DEFAULT_TIMEOUT=30
 WORKDIR /workspace
 COPY requirements-verify.lock.txt /opt/prod2u/requirements-verify.lock.txt
+RUN python3 -m venv /opt/prod2u/venv && \
+    /opt/prod2u/venv/bin/pip install --retries 5 --require-hashes \
+      -r /opt/prod2u/requirements-verify.lock.txt && \
+    /opt/prod2u/venv/bin/pip check
+ENV PATH=/opt/prod2u/venv/bin:${PATH}
 ENTRYPOINT ["/bin/bash"]

+ 4 - 1
containers/6400-dev/build-image.sh

@@ -3,10 +3,13 @@ set -euo pipefail
 root="$(cd "$(dirname "$0")/../.." && pwd)"
 export CONTAINERS_REGISTRIES_CONF="${CONTAINERS_REGISTRIES_CONF:-$root/tools/remote/registries-cn.conf}"
 pull_policy="${PROD2U_PULL_POLICY:-missing}"
+cache_base="${PROD2U_CACHE_DIR:-/data/prod2u/cache}"
+mkdir -p "$cache_base/apt/archives/partial"
 exec podman build --pull="$pull_policy" \
+  --volume "$cache_base/apt:/var/cache/apt:rw" \
   --build-arg DEBIAN_MIRROR="${DEBIAN_MIRROR:-http://mirrors.aliyun.com/debian}" \
   --build-arg DEBIAN_SECURITY_MIRROR="${DEBIAN_SECURITY_MIRROR:-http://mirrors.aliyun.com/debian-security}" \
-  --build-arg PYPI_INDEX_URL="${PYPI_INDEX_URL:-https://pypi.tuna.tsinghua.edu.cn/simple}" \
+  --build-arg PYPI_INDEX_URL="${PYPI_INDEX_URL:-https://mirrors.aliyun.com/pypi/simple}" \
   -t localhost/prod2u-6400-dev:locked \
   -f "$root/containers/6400-dev/Containerfile" \
   "$root/containers/6400-dev"

+ 4 - 4
containers/6400-dev/requirements-verify.lock.txt

@@ -1,6 +1,6 @@
-# Exact Python 3.12 Linux x86_64 wheel set. Bootstrap uses --require-hashes.
+# Exact Python 3.13 Linux x86_64 wheel set. Bootstrap uses --require-hashes.
 attrs==26.1.0 --hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309
-cocotb==2.0.1 --hash=sha256:4fd0ae786019d18e7195a1186f93bff5afcda7b5aba8de710d3e74182e57a116
+cocotb==2.0.1 --hash=sha256:9236df78a8fcdecb09a0916300c55ce1ab7a92fc67ac09b22f63ff592a47232e
 find-libpython==0.5.1 --hash=sha256:723a8cfe6fed255a1f58b53c62ed556fb340ec0d456e9863ebc01a5cc047607d
 iniconfig==2.3.0 --hash=sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12
 jsonschema==4.25.1 --hash=sha256:3fba0169e345c7175110351d456342c364814cfcf3b964ba4587f22915230a63
@@ -8,9 +8,9 @@ jsonschema-specifications==2025.9.1 --hash=sha256:98802fee3a11ee76ecaca44429fda8
 packaging==26.3 --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c
 pluggy==1.6.0 --hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746
 psutil==7.0.0 --hash=sha256:4b1388a4f6875d7e2aff5c4ca1cc16c545ed41dd8bb596cefea80111db353a34
-PyYAML==6.0.2 --hash=sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476
+PyYAML==6.0.2 --hash=sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5
 pygments==2.21.0 --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9
 pytest==8.4.1 --hash=sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7
 referencing==0.37.0 --hash=sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231
-rpds-py==2026.6.3 --hash=sha256:ecabd69db66de867690f9797f2f8fa27ba501bbc24540cbdbdc649cd15888ba6
+rpds-py==2026.6.3 --hash=sha256:acac386b453c2516111b50985d60ce46e7fadb5ea71ae7b25f4c946935bf27cf
 typing-extensions==4.16.0 --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8

+ 2 - 1
containers/6400-dev/toolchain-lock.json

@@ -5,12 +5,13 @@
     "oci_docker_io": "docker.m.daocloud.io",
     "debian": "http://mirrors.aliyun.com/debian",
     "debian_security": "http://mirrors.aliyun.com/debian-security",
-    "pypi": "https://pypi.tuna.tsinghua.edu.cn/simple"
+    "pypi": "https://mirrors.aliyun.com/pypi/simple"
   },
   "mirror_policy": "transport acceleration only; base image digest and Python hashes remain authoritative",
   "container_runtime": "rootless-podman",
   "service_manager": "quadlet",
   "td": "external-read-only-volume; 2026.1 SP2; never in image",
   "python_requirements": "requirements-verify.lock.txt",
+  "python": "3.13 from digest-pinned Debian base; cp313 wheel hashes",
   "network_after_build": "offline"
 }