fix(ci): retry verified pgvector downloads

This commit is contained in:
2026-08-12 16:00:37 +08:00
parent a408d65408
commit 37315fcf6c
2 changed files with 13 additions and 4 deletions
+8 -1
View File
@@ -32,10 +32,17 @@ RUN sed -i \
/etc/apt/sources.list /etc/apt/sources.list.d/*.sources 2>/dev/null || true \
&& apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl ffmpeg postgresql-15 postgresql-client-15 rclone tini \
&& curl --fail --location --retry 4 --retry-all-errors \
&& verified=0 \
&& for attempt in 1 2 3 4; do \
rm -f /tmp/pgvector.deb; \
curl --fail --location --connect-timeout 20 --max-time 120 \
"https://apt.postgresql.org/pub/repos/apt/pool/main/p/pgvector/postgresql-15-pgvector_${PGVECTOR_PACKAGE_VERSION_URL}_amd64.deb" \
--output /tmp/pgvector.deb \
&& printf '%s %s\n' "$PGVECTOR_SHA256" /tmp/pgvector.deb | sha256sum --check --status \
&& verified=1 && break; \
sleep "$attempt"; \
done \
&& test "$verified" = 1 \
&& dpkg -i /tmp/pgvector.deb \
&& rm -f /tmp/pgvector.deb \
&& rm -rf /var/lib/apt/lists/*
+2
View File
@@ -29,3 +29,5 @@ def test_docker_build_uses_domestic_dependency_mirrors() -> None:
assert "mirrors.tuna.tsinghua.edu.cn/debian" in dockerfile
assert "registry.npmmirror.com" in dockerfile
assert '--index-url "$PIP_INDEX_URL"' in dockerfile
assert 'for attempt in 1 2 3 4' in dockerfile
assert 'test "$verified" = 1' in dockerfile