#!/usr/bin/env python3 """ Simple script to guide user to fetch pod logs from RunPod Web UI Since RunPod API doesn't expose container logs directly, this provides instructions. """ import sys import webbrowser def main(): if len(sys.argv) < 2: print("Usage: ./fetch_pod_logs_via_web.py ") sys.exit(1) pod_id = sys.argv[1] url = f"https://www.runpod.io/console/pods/{pod_id}" print("=" * 70) print("RunPod Pod Logs - Access Instructions") print("=" * 70) print(f"\nPod ID: {pod_id}") print(f"\n1. Opening Web UI in browser...") print(f" URL: {url}") print("\n2. Once the page loads:") print(" a. Click on the pod name (foxhunt-training)") print(" b. Navigate to the 'Logs' tab") print(" c. Look for training output") print("\n3. What to verify:") print(" ✓ 'Using device: Cuda(...)' → GPU is active") print(" ✓ 'Epoch 1/5' → Training started") print(" ✓ GPU memory usage (should be ~12-13GB, NOT 15.9GB)") print(" ✗ NO 'CUDA_ERROR_OUT_OF_MEMORY' messages") print("\n4. Alternative: SSH access (once ready)") print(f" ssh root@{pod_id}.ssh.runpod.io") print(" docker logs $(docker ps -aq | head -1)") print("\n" + "=" * 70) print("\nOpening browser in 3 seconds...") try: import time time.sleep(3) webbrowser.open(url) print("✓ Browser opened successfully") except Exception as e: print(f"✗ Failed to open browser: {e}") print(f"\nManually open: {url}") print("\n" + "=" * 70) if __name__ == "__main__": main()