diff --git a/sc_crawler/schemas.py b/sc_crawler/schemas.py index 0786ac68..515739d7 100644 --- a/sc_crawler/schemas.py +++ b/sc_crawler/schemas.py @@ -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 diff --git a/sc_crawler/vendors/aws.py b/sc_crawler/vendors/aws.py index 32bf7d72..d4ee90b1 100644 --- a/sc_crawler/vendors/aws.py +++ b/sc_crawler/vendors/aws.py @@ -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] @@ -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],