Files
foxhunt/scripts/archive/deploy_runpod.sh
jgrusewski e61e8f54da feat(ml): Complete hyperopt infrastructure + documentation
Changes:
- CLAUDE.md: Update OOM fix validation status
- Add comprehensive documentation (30+ markdown reports)
- LSTM encoder varmap bug fix (tft/lstm_encoder.rs:290)
- Quantized LSTM layer matching fix (tft/quantized_lstm.rs)
- Hyperopt paths module (ml/src/hyperopt/paths.rs)
- Training path tests for all adapters (DQN, MAMBA-2, PPO, TFT)
- Checkpoint integrity tests
- Script cleanup: Remove 29 obsolete deployment scripts
- Archive old scripts to scripts/archive/
- New deployment utilities: check_gpu_availability.py, monitor_hyperopt.sh

Validation:
- OOM fixes validated: 5/5 trials successful (pod b6kc3mc5lbjiro)
- Batch-size-max 256 tested successfully
- All hyperopt adapters working correctly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 19:52:21 +01:00

135 lines
4.7 KiB
Bash
Executable File

#!/bin/bash
# deploy_runpod.sh - Complete Runpod deployment workflow
#
# 100% RUNPOD INFRASTRUCTURE - Zero Cloud Dependencies
# - All storage on Runpod infrastructure ($0.10/GB/month)
# - Credentials are Runpod User ID + Runpod API Key
# - Endpoint is Runpod's S3-compatible API (https://s3api-<datacenter>.runpod.io/)
# - Tool: S3-compatible CLI (standard API interface for Runpod storage)
# - GPU: Tesla V100-PCIE-16GB (16GB VRAM, $0.10/hr)
# - Docker: PRIVATE repo (jgrusewski/foxhunt-runpod:latest)
set -e
echo "========================================="
echo "Foxhunt Runpod Deployment Workflow"
echo "100% RUNPOD INFRASTRUCTURE"
echo "========================================="
echo ""
echo "🔒 PRIVACY & SECURITY CHECK:"
echo " Before proceeding, verify:"
echo " 1. Docker Hub repo 'jgrusewski/foxhunt-runpod' is set to PRIVATE"
echo " 2. Runpod Network Volume has access controls enabled"
echo " 3. No credentials are baked into Docker image or scripts"
echo " 4. Zero cloud dependencies (100% Runpod infrastructure)"
echo " 5. All 9 data files ready for upload (ES.FUT, NQ.FUT, 6E.FUT, ZN.FUT)"
echo ""
read -p "Continue? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Deployment cancelled. Ensure privacy checks pass first!"
exit 1
fi
echo ""
# Configuration
DOCKER_IMAGE="jgrusewski/foxhunt-runpod:latest"
RUNPOD_S3_ENDPOINT="https://s3api-us-ca-2.runpod.io/"
RUNPOD_S3_REGION="US-CA-2"
RUNPOD_NETWORK_VOLUME_ID="your-network-volume-id"
echo "Step 1: Build Docker image"
echo "========================================="
docker build -f Dockerfile.runpod -t "$DOCKER_IMAGE" .
if [ $? -ne 0 ]; then
echo "ERROR: Docker build failed"
exit 1
fi
echo "Step 2: Verify Docker Hub repo is PRIVATE"
echo "========================================="
echo "IMPORTANT: Before pushing, verify repo is PRIVATE:"
echo " 1. Go to https://hub.docker.com/repository/docker/jgrusewski/foxhunt-runpod"
echo " 2. Click 'Settings'"
echo " 3. Ensure 'Visibility' is set to 'Private'"
echo ""
read -p "Is the repo PRIVATE? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "ERROR: Make your Docker Hub repo PRIVATE before proceeding!"
echo "Visit: https://hub.docker.com/repository/docker/jgrusewski/foxhunt-runpod/settings"
exit 1
fi
echo ""
echo "Step 3: Push Docker image to Docker Hub"
echo "========================================="
docker push "$DOCKER_IMAGE"
if [ $? -ne 0 ]; then
echo "ERROR: Docker push failed"
echo "Make sure you're logged in: docker login"
exit 1
fi
echo "Step 4: Upload binaries & data to Runpod storage"
echo "========================================="
./scripts/upload_to_runpod_s3.sh
if [ $? -ne 0 ]; then
echo "ERROR: Binary/data upload failed"
exit 1
fi
echo ""
echo "Verifying all data files uploaded:"
echo " - ES.FUT_180d.parquet (2.9MB)"
echo " - NQ.FUT_180d.parquet (4.4MB)"
echo " - 6E.FUT_180d.parquet (2.8MB)"
echo " - ZN.FUT_180d.parquet (2.8MB)"
echo " + 5 additional parquet files"
echo "========================================="
echo "Deployment Preparation Complete!"
echo "100% RUNPOD INFRASTRUCTURE - ZERO CLOUD DEPENDENCIES"
echo "========================================="
echo ""
echo "Docker image: $DOCKER_IMAGE (PRIVATE repo)"
echo "Runpod S3 endpoint: $RUNPOD_S3_ENDPOINT"
echo "Runpod S3 region: $RUNPOD_S3_REGION"
echo "Network Volume ID: $RUNPOD_NETWORK_VOLUME_ID"
echo ""
echo "Next steps:"
echo "1. Go to Runpod console: https://console.runpod.io"
echo "2. Create a pod with the following configuration:"
echo ""
echo " GPU Type: Tesla V100-PCIE-16GB (16GB VRAM, $0.10/hr)"
echo " Docker Image: $DOCKER_IMAGE (PRIVATE repo)"
echo " Container Disk: 20GB minimum"
echo " Volume Path: /runpod-volume (optional - we use S3 API)"
echo ""
echo " Environment Variables (100% Runpod infrastructure):"
echo " - RUNPOD_S3_ENDPOINT=$RUNPOD_S3_ENDPOINT"
echo " - RUNPOD_S3_REGION=$RUNPOD_S3_REGION"
echo " - RUNPOD_S3_BUCKET=$RUNPOD_NETWORK_VOLUME_ID"
echo " - RUNPOD_ACCESS_KEY_ID=<your-runpod-user-id>"
echo " - RUNPOD_SECRET_ACCESS_KEY=<your-runpod-api-key>"
echo " - BINARY_NAME=train_tft_parquet"
echo " - DATA_NAME=ES_FUT_180d.parquet"
echo ""
echo " Container Arguments:"
echo " --parquet-file /workspace/test_data/ES_FUT_180d.parquet"
echo " --epochs 50"
echo " --use-int8"
echo ""
echo "3. Start the pod and monitor logs"
echo "4. Download trained models from Runpod storage after completion"
echo ""
echo "To download results (using S3-compatible CLI for Runpod storage):"
echo " s3cmd sync --endpoint-url $RUNPOD_S3_ENDPOINT \\"
echo " --region $RUNPOD_S3_REGION \\"
echo " s3://${RUNPOD_NETWORK_VOLUME_ID}/foxhunt/models/ ./models/"
echo ""
echo "========================================="