- scripts/build_and_upload_docker.sh: sync context, build, save and upload evalscope-complete-py312 image to ModelScope. - scripts/deploy_remote_machine.sh: SSH to a fresh machine and run install.sh. - scripts/run_multi_machine.sh: distribute official-suite benchmarks across 3 machines (gpu048, gpu049, gpu051).
30 lines
1.1 KiB
Bash
Executable File
30 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
||
# ============================================================
|
||
# 在远程机器上部署 EvalScope
|
||
# 用法: bash scripts/deploy_remote_machine.sh <IP> [BASE_DIR]
|
||
# 示例: bash scripts/deploy_remote_machine.sh 174.1.51.3 /data1/sora
|
||
# ============================================================
|
||
|
||
set -euo pipefail
|
||
|
||
IP="${1:?请提供远程机器 IP}"
|
||
BASE_DIR="${2:-/data1/sora}"
|
||
PASS="${SSHPASS:-sskj2025}"
|
||
REMOTE="root@$IP"
|
||
|
||
SSH="sshpass -p $PASS ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 $REMOTE"
|
||
SCP="sshpass -p $PASS scp -o StrictHostKeyChecking=no -o ConnectTimeout=10"
|
||
|
||
echo "==> 部署到 $IP ..."
|
||
|
||
# 1. 确保基础目录存在
|
||
$SSH "mkdir -p $BASE_DIR && which git docker || (apt-get update && apt-get install -y git docker.io)"
|
||
|
||
# 2. 克隆/更新代码
|
||
$SSH "cd $BASE_DIR && if [ -d evalscope ]; then cd evalscope && git pull; else git clone https://git.meta-stone.net/sora/evalstone.git evalscope; fi"
|
||
|
||
# 3. 运行部署脚本(下载数据、Docker 镜像、配置环境)
|
||
$SSH "cd $BASE_DIR/evalscope && bash install.sh $BASE_DIR"
|
||
|
||
echo "==> $IP 部署完成"
|