#!/usr/bin/env bash
# Python wheel 仓 -> /srv/mirror/pip  (业务 9 服务运行依赖, best-effort, cp310 manylinux)
# 注: 节点构建镜像用 python3.11 + aliyun pip(58MB/s) 更精确; 本仓为离线便利镜像。
set -uo pipefail
OUT=/srv/mirror/pip
mkdir -p "$OUT"
PIP=/home/ecs-user/dlvenv/bin/pip

REQ=/tmp/req-union.txt
cat > "$REQ" <<'EOF'
fastapi==0.115.0
uvicorn[standard]==0.30.6
pydantic==2.9.2
pyyaml==6.0.2
confluent-kafka==2.5.3
redis==5.0.8
boto3==1.35.20
httpx==0.27.2
structlog==24.4.0
prometheus-client==0.20.0
psycopg[binary,pool]==3.2.3
onnxruntime==1.19.2
numpy==1.26.4
lightgbm==4.5
tritonclient[http]==2.49.0
opencv-python-headless==4.10.0.84
soundfile
webrtcvad==2.0.10
EOF

"$PIP" download -r "$REQ" -d "$OUT" -i https://mirrors.aliyun.com/pypi/simple/ 2>&1 | tail -8
echo "=== pip wheelhouse done: $(ls "$OUT" | wc -l) files, $(du -sh "$OUT" | cut -f1) ==="
