20260427 拆分独立repo-bytes.db数据库文件,cir materialize 移除旧兼容
This commit is contained in:
@@ -6,7 +6,7 @@ usage() {
|
||||
Usage:
|
||||
./scripts/cir/run_cir_replay_sequence_rpki_client.sh \
|
||||
--sequence-root <path> \
|
||||
--build-dir <path> \
|
||||
[--build-dir <path> | --rpki-client-bin <path>] \
|
||||
[--real-rsync-bin <path>]
|
||||
EOF
|
||||
}
|
||||
@@ -14,6 +14,7 @@ EOF
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
SEQUENCE_ROOT=""
|
||||
BUILD_DIR=""
|
||||
RPKI_CLIENT_BIN=""
|
||||
REAL_RSYNC_BIN="${REAL_RSYNC_BIN:-/usr/bin/rsync}"
|
||||
STEP_SCRIPT="$ROOT_DIR/scripts/cir/run_cir_replay_rpki_client.sh"
|
||||
|
||||
@@ -21,13 +22,14 @@ while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--sequence-root) SEQUENCE_ROOT="$2"; shift 2 ;;
|
||||
--build-dir) BUILD_DIR="$2"; shift 2 ;;
|
||||
--rpki-client-bin) RPKI_CLIENT_BIN="$2"; shift 2 ;;
|
||||
--real-rsync-bin) REAL_RSYNC_BIN="$2"; shift 2 ;;
|
||||
-h|--help) usage; exit 0 ;;
|
||||
*) echo "unknown argument: $1" >&2; usage; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
[[ -n "$SEQUENCE_ROOT" && -n "$BUILD_DIR" ]] || { usage >&2; exit 2; }
|
||||
[[ -n "$SEQUENCE_ROOT" && ( -n "$BUILD_DIR" || -n "$RPKI_CLIENT_BIN" ) ]] || { usage >&2; exit 2; }
|
||||
|
||||
SEQUENCE_ROOT="$(python3 - <<'PY' "$SEQUENCE_ROOT"
|
||||
from pathlib import Path
|
||||
@@ -39,7 +41,7 @@ PY
|
||||
SUMMARY_JSON="$SEQUENCE_ROOT/sequence-summary-rpki-client.json"
|
||||
SUMMARY_MD="$SEQUENCE_ROOT/sequence-summary-rpki-client.md"
|
||||
|
||||
python3 - <<'PY' "$SEQUENCE_ROOT" "$SUMMARY_JSON" "$SUMMARY_MD" "$STEP_SCRIPT" "$BUILD_DIR" "$REAL_RSYNC_BIN"
|
||||
python3 - <<'PY' "$SEQUENCE_ROOT" "$SUMMARY_JSON" "$SUMMARY_MD" "$STEP_SCRIPT" "$BUILD_DIR" "$RPKI_CLIENT_BIN" "$REAL_RSYNC_BIN"
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -50,14 +52,11 @@ summary_json = Path(sys.argv[2])
|
||||
summary_md = Path(sys.argv[3])
|
||||
step_script = Path(sys.argv[4])
|
||||
build_dir = sys.argv[5]
|
||||
real_rsync_bin = sys.argv[6]
|
||||
rpki_client_bin = sys.argv[6]
|
||||
real_rsync_bin = sys.argv[7]
|
||||
|
||||
sequence = json.loads((sequence_root / "sequence.json").read_text(encoding="utf-8"))
|
||||
static_root = sequence_root / sequence["staticRoot"] if "staticRoot" in sequence else None
|
||||
raw_store_db = sequence_root / sequence["rawStoreDbPath"] if "rawStoreDbPath" in sequence else None
|
||||
backend_count = sum(x is not None for x in (static_root, raw_store_db))
|
||||
if backend_count != 1:
|
||||
raise SystemExit("sequence must set exactly one of staticRoot or rawStoreDbPath")
|
||||
repo_bytes_db = sequence_root / sequence["repoBytesDbPath"]
|
||||
steps = sequence["steps"]
|
||||
results = []
|
||||
all_match = True
|
||||
@@ -74,15 +73,14 @@ for step in steps:
|
||||
str(out_dir),
|
||||
"--reference-ccr",
|
||||
str(sequence_root / step["ccrPath"]),
|
||||
"--build-dir",
|
||||
build_dir,
|
||||
"--real-rsync-bin",
|
||||
real_rsync_bin,
|
||||
]
|
||||
if static_root is not None:
|
||||
cmd.extend(["--static-root", str(static_root)])
|
||||
if rpki_client_bin:
|
||||
cmd.extend(["--rpki-client-bin", rpki_client_bin])
|
||||
else:
|
||||
cmd.extend(["--raw-store-db", str(raw_store_db)])
|
||||
cmd.extend(["--build-dir", build_dir])
|
||||
cmd.extend(["--repo-bytes-db", str(repo_bytes_db)])
|
||||
proc = subprocess.run(cmd, capture_output=True, text=True)
|
||||
if proc.returncode != 0:
|
||||
raise SystemExit(
|
||||
|
||||
Reference in New Issue
Block a user