evalstone/bash/images_load/preload_k3_sandbox_images.sh
sora 0f7c460f1b Add SciCode sandbox preload and extra bench configs for dpv4.
Keep existing yaml entries unchanged; enable SciCode sandbox in run.py and host-side image build without GDPval.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-31 07:24:51 +00:00

40 lines
1.6 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 在宿主机本地构建 SciCode 沙箱镜像(不从 Docker Hub 拉 scicode-benchmark
# 用法与 Terminal Bench 预加载相同:先在宿主机准备好镜像,再 docker run 评测容器并挂 docker.sock。
#
# bash bash/images_load/preload_k3_sandbox_images.sh
#
# 注意:
# - 评测仍在 evalscope 容器里跑,沙箱是宿主机 Docker 再起的子容器
# - SciCode 首次运行还会按内容哈希打 tag有本地层缓存就不会再拉 Hub
set -euo pipefail
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
SCICODE_DIR="$PROJECT_ROOT/evalscope/evalscope/benchmarks/scicode/docker"
H5_URL="https://modelscope.cn/datasets/evalscope/SciCode/resolve/master/test_data.h5"
echo "==> 检查基座镜像(已有则跳过 pull"
if docker image inspect python:3.11-slim >/dev/null 2>&1; then
echo " ok python:3.11-slim"
else
echo " docker pull python:3.11-slim"
docker pull python:3.11-slim
fi
echo "==> SciCode: 确保 test_data.h5"
if [ ! -f "$SCICODE_DIR/test_data.h5" ]; then
echo " downloading test_data.h5 ..."
curl -L --fail -o "$SCICODE_DIR/test_data.h5" "$H5_URL"
fi
ls -lh "$SCICODE_DIR/test_data.h5"
echo "==> docker build scicode-benchmark:latest"
docker build -t scicode-benchmark:latest "$SCICODE_DIR"
echo ""
echo "完成。本地镜像:"
docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.Size}}' | grep -E 'REPOSITORY|scicode-benchmark|python'
echo ""
echo "下一步docker run 评测镜像,挂 -v /var/run/docker.sock:/var/run/docker.sock"
echo "SciCode 需要 run.py 打开 sandbox已加入 SANDBOX_DATASETS。"