Files
foxhunt/scripts/archive/test_ssh_connection.py
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

107 lines
2.8 KiB
Python

#!/usr/bin/env python3
"""Test SSH connection to RunPod pod pdx8g5suuvrwkb."""
import os
import sys
import requests
from dotenv import load_dotenv
# Load environment variables
load_dotenv('/home/jgrusewski/Work/foxhunt/.env.runpod')
api_key = os.getenv('RUNPOD_API_KEY')
if not api_key:
print("ERROR: RUNPOD_API_KEY not found in .env.runpod")
sys.exit(1)
# Query pod details via GraphQL
query = '''
{
pod(input: {podId: "pdx8g5suuvrwkb"}) {
id
name
desiredStatus
runtime {
uptimeInSeconds
ports {
ip
isIpPublic
privatePort
publicPort
type
}
}
machine {
podHostId
}
}
}
'''
print("🔍 Querying RunPod GraphQL API for pod details...")
response = requests.post(
'https://api.runpod.io/graphql',
json={'query': query},
headers={'Authorization': f'Bearer {api_key}'}
)
if response.status_code != 200:
print(f"❌ GraphQL API error: {response.status_code}")
print(response.text)
sys.exit(1)
data = response.json()
if 'errors' in data:
print(f"❌ GraphQL errors: {data['errors']}")
sys.exit(1)
pod = data.get('data', {}).get('pod')
if not pod:
print("❌ Pod not found in GraphQL response")
sys.exit(1)
print("\n📊 Pod Details:")
print(f" ID: {pod['id']}")
print(f" Name: {pod.get('name', 'N/A')}")
print(f" Status: {pod.get('desiredStatus', 'N/A')}")
runtime = pod.get('runtime')
if runtime:
print(f" Uptime: {runtime.get('uptimeInSeconds', 0)} seconds")
ports = runtime.get('ports', [])
if ports:
print(f"\n🔌 Port Mappings:")
for port in ports:
print(f" - {port['privatePort']}/{port['type']} -> {port.get('publicPort', 'N/A')} ({port.get('ip', 'N/A')})")
print(f" Public IP: {port.get('isIpPublic', False)}")
else:
print("\n⚠️ No port mappings found (pod may still be initializing)")
else:
print("\n⚠️ No runtime information (pod may not be running yet)")
# Extract SSH connection details
ssh_hostname = None
ssh_port = None
if runtime and runtime.get('ports'):
for port in runtime['ports']:
if port.get('privatePort') == 22:
if port.get('publicPort'):
ssh_port = port['publicPort']
ssh_hostname = port.get('ip')
break
if ssh_hostname and ssh_port:
print(f"\n✅ SSH Connection Details:")
print(f" Host: {ssh_hostname}")
print(f" Port: {ssh_port}")
print(f"\n📝 SSH Connection Command:")
print(f" ssh -o StrictHostKeyChecking=no -p {ssh_port} root@{ssh_hostname}")
else:
# Try RunPod proxy format
pod_id = pod['id']
print(f"\n⚠️ Direct SSH details not available. Trying RunPod proxy format:")
print(f" ssh -o StrictHostKeyChecking=no root@{pod_id}-22.proxy.runpod.net")
print("\n" + "="*80)