Files
HSAP/scripts/sync_to_server.sh
Chengfang Lu e72bc061c5 feat: HSAP platform v2 — modular navigation, quality review, audit log, world model simulation
Major changes:
- New frontend (platform/web/): Vite + React 18 + TypeScript + Tailwind
- 4-module navigation: 数据送标 / 模型管理 / 车队管理 / 系统管理
- Data catalog with charts (DMS/ADAS/Lane 3-tab view)
- Quality review workflow (标注质检): Good/Fine/Bad scoring with auto-advance
- Audit enhancements: batch operations, rejection categories, Feishu notifications
- Operation audit log (操作日志)
- World model simulation studio (仿真工坊)
- Dataset version management with snapshots and diff
- ADAS 7-class dataset integration (138K images organized + compressed)
- User management with Feishu integration and pagination
- CRUD/search/filter on all pages, card layout redesign
- PIL-optimized image overlay rendering
- Auto-snapshot on build, in_review workflow stage
- Removed embedded algorithm code (now in workspace)
2026-06-03 11:40:21 +08:00

78 lines
2.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# 同步 HSAP 工作区到训练服务器(展开软链)
#
# 用法:
# ./scripts/sync_to_server.sh USER@HOST:/opt/HSAP
# ./scripts/sync_to_server.sh USER@HOST:/opt/HSAP --code-only
# ./scripts/sync_to_server.sh USER@HOST:/opt/HSAP --dms-only
# ./scripts/sync_to_server.sh USER@HOST:/opt/HSAP --lane-only
set -euo pipefail
REMOTE="${1:?用法: $0 USER@HOST:/path/HSAP [--code-only|--dms-only|--lane-only]}"
shift
MODE="${1:-all}"
AS="$(cd "$(dirname "$0")/.." && pwd)"
DATA="$(cd "$AS/.." && pwd)"
WS="$DATA/workspace"
RSYNC=(rsync -avh --info=progress2 --copy-links)
EXCLUDE=(
--exclude 'vis_random_*'
--exclude 'archive/'
--exclude '__pycache__/'
--exclude '.git/'
--exclude 'runs/'
--exclude 'log/'
--exclude 'tmp/'
--exclude 'node_modules/'
)
echo "HSAP: $AS"
echo "实体 workspace: $WS"
echo "远程: $REMOTE"
mkdir_remote() {
ssh "${REMOTE%%:*}" "mkdir -p '${REMOTE#*:}'"
}
sync_as_meta() {
mkdir_remote
"${RSYNC[@]}" \
"$AS/as.py" \
"$AS/workflow.registry.yaml" \
"$AS/README.md" \
"$AS/requirements.txt" \
"${REMOTE}/"
[[ -d "$AS/scripts" ]] && "${RSYNC[@]}" "$AS/scripts/" "${REMOTE}/scripts/"
[[ -d "$AS/platform/as_platform" ]] && "${RSYNC[@]}" "$AS/platform/as_platform/" "${REMOTE}/platform/as_platform/"
[[ -d "$AS/algorithms" ]] && "${RSYNC[@]}" --exclude 'code' "$AS/algorithms/" "${REMOTE}/algorithms/"
[[ -f "$AS/algorithms/registry.yaml" ]] && "${RSYNC[@]}" "$AS/algorithms/registry.yaml" "${REMOTE}/algorithms/"
}
sync_dms_code() {
"${RSYNC[@]}" "${EXCLUDE[@]}" "$WS/DMS/Code/" "${REMOTE}/algorithms/dms_yolo/code/"
}
sync_dms_data() {
"${RSYNC[@]}" "${EXCLUDE[@]}" "$WS/DMS/DATASET/" "${REMOTE}/datasets/dms/"
}
sync_lane_data() {
"${RSYNC[@]}" "${EXCLUDE[@]}" "$WS/lane/" "${REMOTE}/datasets/lane/"
}
sync_lane_code() {
"${RSYNC[@]}" "${EXCLUDE[@]}" "$WS/LaneDection/Code/" "${REMOTE}/algorithms/lane_ufld/code/"
}
case "$MODE" in
--code-only) sync_as_meta; sync_dms_code; sync_lane_code ;;
--dms-only) sync_as_meta; sync_dms_code; sync_dms_data ;;
--lane-only) sync_as_meta; sync_lane_data; sync_lane_code ;;
*) sync_as_meta; sync_dms_code; sync_dms_data; sync_lane_data; sync_lane_code ;;
esac
echo "完成: cd ${REMOTE#*:} && python as.py status"