docs: update README with comprehensive test results, CLI documentation, and enhanced feature descriptions
- Update key capabilities to include GPU marketplace, payments, billing, and governance - Expand CLI section from basic examples to 12 command groups with 90+ subcommands - Add detailed test results table showing 208 passing tests across 6 test suites - Update documentation links to reference new CLI reference and coordinator API docs - Revise test commands to reflect actual test structure (
This commit is contained in:
@@ -6,6 +6,7 @@ from .job_receipt import JobReceipt
|
||||
from .marketplace import MarketplaceOffer, MarketplaceBid
|
||||
from .user import User, Wallet
|
||||
from .payment import JobPayment, PaymentEscrow
|
||||
from .gpu_marketplace import GPURegistry, GPUBooking, GPUReview
|
||||
|
||||
__all__ = [
|
||||
"Job",
|
||||
@@ -17,4 +18,7 @@ __all__ = [
|
||||
"Wallet",
|
||||
"JobPayment",
|
||||
"PaymentEscrow",
|
||||
"GPURegistry",
|
||||
"GPUBooking",
|
||||
"GPUReview",
|
||||
]
|
||||
|
||||
53
apps/coordinator-api/src/app/domain/gpu_marketplace.py
Normal file
53
apps/coordinator-api/src/app/domain/gpu_marketplace.py
Normal file
@@ -0,0 +1,53 @@
|
||||
"""Persistent SQLModel tables for the GPU marketplace."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
from uuid import uuid4
|
||||
|
||||
from sqlalchemy import Column, JSON
|
||||
from sqlmodel import Field, SQLModel
|
||||
|
||||
|
||||
class GPURegistry(SQLModel, table=True):
|
||||
"""Registered GPUs available in the marketplace."""
|
||||
|
||||
id: str = Field(default_factory=lambda: f"gpu_{uuid4().hex[:8]}", primary_key=True)
|
||||
miner_id: str = Field(index=True)
|
||||
model: str = Field(index=True)
|
||||
memory_gb: int = Field(default=0)
|
||||
cuda_version: str = Field(default="")
|
||||
region: str = Field(default="", index=True)
|
||||
price_per_hour: float = Field(default=0.0)
|
||||
status: str = Field(default="available", index=True) # available, booked, offline
|
||||
capabilities: list = Field(default_factory=list, sa_column=Column(JSON, nullable=False))
|
||||
average_rating: float = Field(default=0.0)
|
||||
total_reviews: int = Field(default=0)
|
||||
created_at: datetime = Field(default_factory=datetime.utcnow, nullable=False, index=True)
|
||||
|
||||
|
||||
class GPUBooking(SQLModel, table=True):
|
||||
"""Active and historical GPU bookings."""
|
||||
|
||||
id: str = Field(default_factory=lambda: f"bk_{uuid4().hex[:10]}", primary_key=True)
|
||||
gpu_id: str = Field(index=True)
|
||||
client_id: str = Field(default="", index=True)
|
||||
job_id: Optional[str] = Field(default=None, index=True)
|
||||
duration_hours: float = Field(default=0.0)
|
||||
total_cost: float = Field(default=0.0)
|
||||
status: str = Field(default="active", index=True) # active, completed, cancelled
|
||||
start_time: datetime = Field(default_factory=datetime.utcnow)
|
||||
end_time: Optional[datetime] = Field(default=None)
|
||||
created_at: datetime = Field(default_factory=datetime.utcnow, nullable=False)
|
||||
|
||||
|
||||
class GPUReview(SQLModel, table=True):
|
||||
"""Reviews for GPUs."""
|
||||
|
||||
id: str = Field(default_factory=lambda: f"rv_{uuid4().hex[:10]}", primary_key=True)
|
||||
gpu_id: str = Field(index=True)
|
||||
user_id: str = Field(default="")
|
||||
rating: int = Field(ge=1, le=5)
|
||||
comment: str = Field(default="")
|
||||
created_at: datetime = Field(default_factory=datetime.utcnow, nullable=False, index=True)
|
||||
Reference in New Issue
Block a user