Skip to content

Commit

Permalink
overwrite CPU model from lscpu when available
Browse files Browse the repository at this point in the history
  • Loading branch information
daroczig committed Feb 7, 2025
1 parent 06c132e commit b544054
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sc_crawler/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ def lscpu_lookup(field: str):
except Exception as e:
_log_cannot_update_server(server_obj, k, e)

# backfill CPU model from alternative sources when not provided by DMI decode
# lscpu is a more reliable data source than dmidecode
if not isinstance(lookups["lscpu"], BaseException):
cpu_model = lscpu_lookup("Model name:")
# CPU speed seems to be unreliable as reported by dmidecode,
Expand All @@ -713,8 +713,9 @@ def lscpu_lookup(field: str):
for family in ["Xeon", "EPYC"]:
if family in cpu_model:
server["cpu_family"] = family
if server.get("cpu_model") is None:
server["cpu_model"] = _standardize_cpu_model(cpu_model)
model = _standardize_cpu_model(cpu_model)
if model:
server["cpu_model"] = model

# 2 Ghz CPU speed at Google is a lie
if server["vendor_id"] == "gcp" and server.get("cpu_speed") == 2:
Expand Down
1 change: 1 addition & 0 deletions src/sc_crawler/vendors/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def _parse_server_name(name):
family = data["family"]
vcpus = int(data["vcpus"])
# accelerators are not always mentioned in the old server names, so we need a manual mapping
# which will be overwritten by the GPU count from HW inspection if we can start the node
gpus = 0
if family in ["NC", "ND", "NG", "NV"]:
# default to one, list all the exceptions below
Expand Down

0 comments on commit b544054

Please sign in to comment.