Skip to content

Commit

Permalink
more CPU info
Browse files Browse the repository at this point in the history
  • Loading branch information
daroczig committed Dec 30, 2023
1 parent a03520c commit 49d9f2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion sc_crawler/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ class Gpu(BaseModel):
class Server(Resource):
resource_type: resource_types = "compute"
vcpus: int
cores: int
cpu_cores: int
cpu_speed: Optional[float] = None # Ghz
cpu_architecture: Literal["arm64", "arm64_mac", "i386", "x86_64"]
cpu_manufacturer: Optional[str] = None
memory: int
gpu_count: int = 0
gpu_memory: Optional[int] = None # MiB
Expand Down
9 changes: 7 additions & 2 deletions sc_crawler/vendors/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,8 @@ def get_instance_types(vendor, *args, **kwargs):
for instance_type in local_instance_types:
it = instance_type["InstanceType"]
if it not in list(instance_types.keys()):
vcpu_info = instance_type["VCpuInfo"]
cpu_info = instance_type["ProcessorInfo"]
gpu_info = get_gpu(instance_type)
storage_info = get_storage(instance_type)
network_card = instance_type["NetworkInfo"]["NetworkCards"][0]
Expand All @@ -492,8 +494,11 @@ def get_instance_types(vendor, *args, **kwargs):
identifier=it,
name=it,
description=annotate_instance_type(it),
vcpus=instance_type["VCpuInfo"]["DefaultVCpus"],
cores=instance_type["VCpuInfo"]["DefaultCores"],
vcpus=vcpu_info["DefaultVCpus"],
cpu_cores=vcpu_info["DefaultCores"],
cpu_speed=cpu_info.get("SustainedClockSpeedInGhz", None),
cpu_architecture=cpu_info["SupportedArchitectures"][0],
cpu_manufacturer=cpu_info.get("Manufacturer", None),
memory=instance_type["MemoryInfo"]["SizeInMiB"],
gpu_count=gpu_info[0],
gpu_memory=gpu_info[1],
Expand Down

0 comments on commit 49d9f2c

Please sign in to comment.