CRITICAL FIX (Nov 30, 2025):
- Dashboard showed 'idle' despite 22+ worker processes running
- Root cause: SSH-based worker detection timing out
- Solution: Check database for running chunks FIRST
Changes:
1. app/api/cluster/status/route.ts:
- Query exploration database before SSH detection
- If running chunks exist, mark workers 'active' even if SSH fails
- Override worker status: 'offline' → 'active' when chunks running
- Log: '✅ Cluster status: ACTIVE (database shows running chunks)'
- Database is source of truth, SSH only for supplementary metrics
2. app/cluster/page.tsx:
- Stop button ALREADY EXISTS (conditionally shown)
- Shows Start when status='idle', Stop when status='active'
- No code changes needed - fixed by status detection
Result:
- Dashboard now shows 'ACTIVE' with 2 workers (correct)
- Workers show 'active' status (was 'offline')
- Stop button automatically visible when cluster active
- System resilient to SSH timeouts/network issues
Verified:
- Container restarted: Nov 30 21:18 UTC
- API tested: Returns status='active', activeWorkers=2
- Logs confirm: Database-first logic working
- Workers confirmed running: 22+ processes on worker1, workers on worker2
42 lines
1.0 KiB
Bash
Executable File
42 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# Setup script for dual v9 parameter sweep (vanilla + RSI divergence)
|
|
# Run this on EPYC server after extracting backtest_v9_dual_sweep.tar.gz
|
|
|
|
set -e
|
|
|
|
echo "=== v9 Dual Sweep Setup ==="
|
|
echo
|
|
|
|
# Check Python version
|
|
PYTHON_VERSION=$(python3 --version 2>&1)
|
|
echo "Python: $PYTHON_VERSION"
|
|
|
|
# Install python3-venv if needed
|
|
if ! dpkg -l | grep -q python3-venv; then
|
|
echo "Installing python3-venv..."
|
|
sudo apt-get update
|
|
sudo apt-get install -y python3-venv
|
|
fi
|
|
|
|
# Create virtual environment
|
|
if [ ! -d ".venv" ]; then
|
|
echo "Creating virtual environment..."
|
|
python3 -m venv .venv
|
|
fi
|
|
|
|
# Activate and install dependencies
|
|
echo "Installing dependencies..."
|
|
source .venv/bin/activate
|
|
pip install --upgrade pip
|
|
pip install pandas numpy
|
|
|
|
echo
|
|
echo "=== Setup Complete ==="
|
|
echo "Virtual environment: $(pwd)/.venv"
|
|
echo "Python: $(which python)"
|
|
echo "Packages: $(pip list | grep -E 'pandas|numpy')"
|
|
echo
|
|
echo "Ready to run sweeps!"
|
|
echo " - Vanilla v9: ./run_sweep_vanilla_epyc.sh"
|
|
echo " - RSI Divergence v9: ./run_sweep_rsi_epyc.sh"
|