Files
foxhunt/scripts/entrypoint-generic.sh
jgrusewski 8d89fe80ff chore: Second cleanup wave - organize root directory
- Archive: 85 agent .txt files → docs/archive/agents/legacy_txt/
- Scripts: Move 110 shell scripts → scripts/ (keep deploy.sh in root)
- Models: Move 18 .safetensors → ml/models/checkpoints/training_artifacts/
- Delete: 34 directories (~33GB freed) - target/, coverage_*, test artifacts
- Build: Clean 14 build artifacts (.rlib, .o, .pid, binaries)
- Tests: Move 14 .rs files → tests/standalone/
- SQL: Move 5 files → sql/ (keep init-db*.sql for Docker)
- Wave 153: Archive to docs/archive/historical/wave153/
- Docs: Archive 9 markdown files to wave_d/reports/ and historical/

Total impact: ~34GB freed (both waves), root directory cleaned from 583 to ~40 essential files
Directory count reduced from 65 to 31 (52% reduction)
All historical data preserved in organized archive structure
2025-10-30 01:26:02 +01:00

93 lines
3.5 KiB
Bash
Executable File

#!/bin/bash
# =============================================================================
# RUNPOD GENERIC ENTRYPOINT - MINIMAL WRAPPER
# =============================================================================
# Purpose: Provide a minimal entrypoint that allows full command override
# Architecture: Execute whatever command is passed, with basic validation
# =============================================================================
set -euo pipefail
# Logging helper
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"
}
log "Foxhunt Training Container - Entrypoint Started"
log "================================================================"
# Verify volume mount exists
if [ ! -d "/runpod-volume" ]; then
log "ERROR: /runpod-volume not mounted!"
log "This container requires a RunPod Network Volume mounted at /runpod-volume"
log "Please configure volume mount in deployment settings"
exit 1
fi
log "✓ Volume mount verified: /runpod-volume"
# List available binaries (informational)
if [ -d "/runpod-volume/binaries" ]; then
log "Available binaries:"
ls -lh /runpod-volume/binaries/ | tail -n +2 | awk '{printf " - %s (%s)\n", $9, $5}'
else
log "WARNING: /runpod-volume/binaries/ not found"
fi
# List available test data (informational)
if [ -d "/runpod-volume/test_data" ]; then
log "Available test data:"
ls -lh /runpod-volume/test_data/*.parquet 2>/dev/null | awk '{printf " - %s (%s)\n", $9, $5}' || log " (no .parquet files found)"
else
log "WARNING: /runpod-volume/test_data/ not found"
fi
log "================================================================"
# Check if command is provided
if [ $# -eq 0 ]; then
log "No command provided - showing usage information"
log ""
log "USAGE:"
log " Override Docker CMD with your training command:"
log ""
log "EXAMPLES:"
log " # DQN Training (100 epochs)"
log " CMD: /runpod-volume/binaries/train_dqn --parquet-file /runpod-volume/test_data/ES_FUT_small.parquet --epochs 100 --output-dir /runpod-volume/models"
log ""
log " # TFT Training (50 epochs, GPU enabled)"
log " CMD: /runpod-volume/binaries/train_tft_parquet --parquet-file /runpod-volume/test_data/ES_FUT_180d.parquet --epochs 50 --use-gpu --output-dir /runpod-volume/models"
log ""
log " # PPO Training (200 epochs)"
log " CMD: /runpod-volume/binaries/train_ppo --parquet-file /runpod-volume/test_data/NQ_FUT_180d.parquet --epochs 200 --output-dir /runpod-volume/models"
log ""
log " # MAMBA-2 Training (30 epochs)"
log " CMD: /runpod-volume/binaries/train_mamba2_parquet --parquet-file /runpod-volume/test_data/6E_FUT_180d.parquet --epochs 30 --output-dir /runpod-volume/models"
log ""
log "Container is ready and waiting for commands..."
log "To deploy with a custom command, override the Docker CMD in your deployment script"
# Keep container running (useful for debugging)
tail -f /dev/null
fi
# If binary path is provided, ensure it's executable
if [[ "$1" =~ ^/runpod-volume/binaries/ ]] && [ -f "$1" ]; then
if [ ! -x "$1" ]; then
log "WARNING: Binary is not executable, attempting to fix..."
chmod +x "$1" || {
log "ERROR: Failed to make binary executable: $1"
exit 1
}
log "✓ Binary is now executable"
fi
fi
# Execute the provided command
log "Executing command: $*"
log "================================================================"
log ""
# Run the command
exec "$@"