Pando, Pando the Aspen colony.

This commit is contained in:
Kalzu Rekku committed 2026-10-27 21:27:30 +02:00
1 parent a6d014601d
commit ac73968de7
11 files changed
+152 -89

No files matched your search

+24 -10
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# ==============================================================================
# repl-test.sh: Integration harness for Records API & Replication (mTLS)
# repl-test.sh: Integration harness for Pando 🌳 cluster & pando-sync (mTLS)
#
# Supports N instances in multiple topologies:
# star - one primary, all replicas pull directly from it (default)
@@ -27,7 +27,13 @@ set -euo pipefail
# Configuration
# ---------------------------------------------------------------------------
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BIN="${BIN:-$ROOT_DIR/target/debug/rust_test}"
if [[ -n "${BIN:-}" ]]; then
: # BIN provided externally
elif [[ -f "$ROOT_DIR/target/debug/pando" ]]; then
BIN="$ROOT_DIR/target/debug/pando"
else
BIN="$ROOT_DIR/target/debug/rust_test"
fi
WORK="${WORK:-$ROOT_DIR/repl-test}"
BASE_PORT="${BASE_PORT:-3000}"
NODES="${NODES:-2}" # total node count (must be >= 2)
@@ -188,7 +194,7 @@ rm -rf "$WORK"
for idx in $(seq 0 $(( NODES - 1 ))); do
name=$(node_name "$idx")
mkdir -p "$WORK/$name"
cat > "$WORK/$name/config.json" <<'CFGEOF'
cat > "$WORK/$name/pando.json" <<'CFGEOF'
{
"mode": "loose",
"fields": {
@@ -196,6 +202,7 @@ for idx in $(seq 0 $(( NODES - 1 ))); do
}
}
CFGEOF
cp "$WORK/$name/pando.json" "$WORK/$name/config.json"
done
# ---------------------------------------------------------------------------
@@ -205,10 +212,17 @@ start_node() {
local name=$1 port=$2
shift 2
( cd "$WORK/$name" && exec env \
APP_CONFIG=config.json \
PANDO_CONFIG=pando.json \
APP_CONFIG=pando.json \
PANDO_DB=pando.db \
APP_DB=pando.db \
PANDO_BIND="127.0.0.1:$port" \
APP_BIND="127.0.0.1:$port" \
PANDO_REPL_TOKEN="$TOKEN" \
APP_REPL_TOKEN="$TOKEN" \
PANDO_SYNC_INTERVAL_SECS=1 \
APP_SYNC_INTERVAL_SECS=1 \
PANDO_CORS_ORIGIN="$CORS_ORIGIN" \
APP_CORS_ORIGIN="$CORS_ORIGIN" \
"$@" "$BIN" ) >"$WORK/$name/log.txt" 2>&1 &
PIDS+=("$!")
@@ -292,8 +306,8 @@ for idx in $(seq 1 $(( NODES - 1 ))); do
wait_up "$name" "$port"
color_echo green " ✔ $name is up and enrolled."
if [[ -f "$WORK/$name/messages.db" ]]; then
color_echo green " ✔ mTLS credentials persisted in SQLite."
if [[ -f "$WORK/$name/pando.db" || -f "$WORK/$name/messages.db" ]]; then
color_echo green " ✔ mTLS credentials persisted in SQLite (pando.db)."
fi
done
@@ -421,9 +435,9 @@ fi
# ==============================================================================
echo ""
echo "======================================================================"
echo " Cluster is healthy • Topology: $TOPO • Nodes: $NODES"
echo " Pando Grove is healthy 🌳 • Topology: $TOPO • Nodes: $NODES"
echo ""
echo " Nodes:"
echo " Aspen Nodes (pando-node):"
for idx in $(seq 0 $(( NODES - 1 ))); do
port="${PORTS[$idx]}"
name="${NAMES[$idx]}"
@@ -436,9 +450,9 @@ for idx in $(seq 0 $(( NODES - 1 ))); do
done
echo ""
if [[ "$START_DASHBOARD" -eq 1 ]]; then
echo " Web Dashboard: http://127.0.0.1:$DASHBOARD_PORT"
echo " Pando Dashboard: http://127.0.0.1:$DASHBOARD_PORT"
fi
echo " Logs Dir: $WORK/"
echo " Logs Dir: $WORK/"
echo ""
echo " Press Ctrl+C to stop all instances."
echo "======================================================================"