Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions packages/prime-sandboxes/src/prime_sandboxes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class Sandbox(BaseModel):
name: str
docker_image: str = Field(..., alias="dockerImage")
start_command: Optional[str] = Field(None, alias="startCommand")
cpu_cores: int = Field(..., alias="cpuCores")
memory_gb: int = Field(..., alias="memoryGB")
disk_size_gb: int = Field(..., alias="diskSizeGB")
cpu_cores: float = Field(..., alias="cpuCores")
memory_gb: float = Field(..., alias="memoryGB")
disk_size_gb: float = Field(..., alias="diskSizeGB")
disk_mount_path: str = Field(..., alias="diskMountPath")
gpu_count: int = Field(..., alias="gpuCount")
network_access: bool = Field(True, alias="networkAccess")
Expand Down Expand Up @@ -77,9 +77,9 @@ class CreateSandboxRequest(BaseModel):
name: str
docker_image: str
start_command: Optional[str] = "tail -f /dev/null"
cpu_cores: int = 1
memory_gb: int = 2
disk_size_gb: int = 5
cpu_cores: float = 1.0
memory_gb: float = 2.0
disk_size_gb: float = 5.0
gpu_count: int = 0
network_access: bool = True
timeout_minutes: int = 60
Expand All @@ -97,9 +97,9 @@ class UpdateSandboxRequest(BaseModel):
name: Optional[str] = None
docker_image: Optional[str] = None
start_command: Optional[str] = None
cpu_cores: Optional[int] = None
memory_gb: Optional[int] = None
disk_size_gb: Optional[int] = None
cpu_cores: Optional[float] = None
memory_gb: Optional[float] = None
disk_size_gb: Optional[float] = None
gpu_count: Optional[int] = None
timeout_minutes: Optional[int] = None
environment_vars: Optional[Dict[str, str]] = None
Expand Down
6 changes: 3 additions & 3 deletions packages/prime/src/prime_cli/commands/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@ def create(
start_command: Optional[str] = typer.Option(
"tail -f /dev/null", help="Command to run in the container"
),
cpu_cores: int = typer.Option(1, help="Number of CPU cores"),
memory_gb: int = typer.Option(2, help="Memory in GB"),
disk_size_gb: int = typer.Option(10, help="Disk size in GB"),
cpu_cores: float = typer.Option(1.0, help="Number of CPU cores"),
memory_gb: float = typer.Option(2.0, help="Memory in GB"),
disk_size_gb: float = typer.Option(10.0, help="Disk size in GB"),
gpu_count: int = typer.Option(0, help="Number of GPUs"),
network_access: bool = typer.Option(
True,
Expand Down
4 changes: 2 additions & 2 deletions packages/prime/src/prime_cli/utils/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def format_price(value: float) -> str:
return f"${value:.2f}"


def format_resources(cpu_cores: int, memory_gb: int, gpu_count: int = 0) -> str:
def format_resources(cpu_cores: float, memory_gb: float, gpu_count: int = 0) -> str:
"""Format resource specifications as compact string."""
resources = f"{cpu_cores}CPU/{memory_gb}GB"
resources = f"{cpu_cores:g}CPU/{memory_gb:g}GB"
if gpu_count > 0:
resources += f"/{gpu_count}GPU"
return resources
Expand Down