#!/usr/bin/env bash
# Setup Windows PC (100.76.218.38) with ML dependencies for BTC optimizer
set -euo pipefail

WINDOWS_HOST="bizzle@100.76.218.38"
REMOTE_DIR="~/btc-ml-optimizer"

echo "=== BTC ML Optimizer — Windows PC Setup ==="
echo "Target: $WINDOWS_HOST"
echo ""

# Create project directory on Windows
echo "[1/3] Creating project directory..."
ssh "$WINDOWS_HOST" "mkdir -p $REMOTE_DIR"

# Install PyTorch with CUDA support + ML libraries
echo "[2/3] Installing Python dependencies (this may take a while)..."
ssh "$WINDOWS_HOST" "pip install --upgrade pip && \
  pip install torch --index-url https://download.pytorch.org/whl/cu128 && \
  pip install xgboost lightgbm catboost optuna && \
  pip install pandas numpy scikit-learn ta"

# Verify installations
echo "[3/3] Verifying installations..."
ssh "$WINDOWS_HOST" "python -c \"
import torch
print(f'PyTorch {torch.__version__}, CUDA available: {torch.cuda.is_available()}')
if torch.cuda.is_available():
    print(f'  GPU: {torch.cuda.get_device_name(0)}')
import xgboost; print(f'XGBoost {xgboost.__version__}')
import lightgbm; print(f'LightGBM {lightgbm.__version__}')
import catboost; print(f'CatBoost {catboost.__version__}')
import optuna; print(f'Optuna {optuna.__version__}')
import pandas; print(f'Pandas {pandas.__version__}')
import numpy; print(f'NumPy {numpy.__version__}')
import ta; print('ta library OK')
import sklearn; print(f'scikit-learn {sklearn.__version__}')
print('All dependencies verified!')
\""

echo ""
echo "=== Setup complete! ==="
