Skip to content
Merged
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
13 changes: 10 additions & 3 deletions aleph_message/models/execution/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,17 @@ class PortMapping(PublishedPort):
)


MAX_VCPUS = 256
MAX_MEMORY_MIB = 1024 * 1024 # 1 TiB
# ~10 years expressed in seconds. Guards against overflow in downstream
# cost calculations while remaining high enough for long-running instances.
MAX_SECONDS = 10 * 365 * 24 * 3600


class MachineResources(HashableModel):
vcpus: int = 1
memory: Mebibytes = Mebibytes(128)
seconds: int = 1
vcpus: int = Field(default=1, ge=1, le=MAX_VCPUS)
memory: Mebibytes = Field(default=Mebibytes(128), ge=1, le=MAX_MEMORY_MIB)
seconds: int = Field(default=1, ge=1, le=MAX_SECONDS)
published_ports: Optional[List[PublishedPort]] = Field(
default=None, description="IPv4 ports to map to open ports on the host."
)
Expand Down
Loading