Files
aitbc/apps/edge-api/src/edge_api/clients/gpu_service.py
aitbc a9405a0d28
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Create edge-api service foundation - Phase 1 complete
- Created edge-api service structure with FastAPI application
- Implemented all schema files (island, gpu, database, serve, metrics)
- Created router stub files for all modules
- Created service stub files for all modules
- Created client stub files (blockchain RPC, GPU service)
- Configured PostgreSQL database (aitbc_edge) with proper permissions
- Fixed SQLAlchemy reserved name conflict (metadata -> extra_data)
- Changed port to 8103 to avoid conflicts
- Service runs successfully on port 8103
- Health endpoint tested and working
- Created systemd service file
- Created README.md with documentation
2026-05-14 21:50:09 +02:00

34 lines
1.4 KiB
Python

"""GPU service client for Edge API Service"""
import httpx
from typing import Dict, List
from ..config import settings
class GPUServiceClient:
"""Client for GPU service communication"""
def __init__(self):
self.base_url = f"http://{settings.gpu_service_host}:{settings.gpu_service_port}"
self.client = httpx.AsyncClient(timeout=30.0)
async def close(self):
"""Close the HTTP client"""
await self.client.aclose()
async def scan_gpus(self, miner_id: str) -> Dict:
"""Scan GPUs via GPU service - TODO: Implement in Phase 3"""
# TODO: Call GPU service endpoint /v1/marketplace/edge-gpu/scan/{miner_id}
return {"message": "scan_gpus via GPU service - to be implemented in Phase 3"}
async def get_gpu_profiles(self) -> List[Dict]:
"""Get GPU profiles via GPU service - TODO: Implement in Phase 3"""
# TODO: Call GPU service endpoint /v1/marketplace/edge-gpu/profiles
return [{"message": "get_gpu_profiles via GPU service - to be implemented in Phase 3"}]
async def get_gpu_metrics(self, gpu_id: str) -> Dict:
"""Get GPU metrics via GPU service - TODO: Implement in Phase 3"""
# TODO: Call GPU service endpoint /v1/marketplace/edge-gpu/metrics/{gpu_id}
return {"message": "get_gpu_metrics via GPU service - to be implemented in Phase 3"}