Skip to content

Commit edfe4cb

Browse files
Jaspal SinghJaspal Singh
authored andcommitted
rocm tech support changes
1 parent 14dbe50 commit edfe4cb

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

nodescraper/plugins/inband/rocm/rocm_collector.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ class RocmCollector(InBandDataCollector[RocmDataModel, None]):
4242
"/opt/rocm/.info/version-rocm",
4343
"/opt/rocm/.info/version",
4444
]
45+
CMD_ROCMINFO = "rocminfo"
46+
CMD_ROCM_VERSIONED_PATHS = "ls -v -d /opt/rocm-[3-7]* | tail -1"
47+
CMD_ROCM_ALL_PATHS = "ls -v -d /opt/rocm*"
4548

4649
def collect_data(self, args=None) -> tuple[TaskResult, Optional[RocmDataModel]]:
4750
"""Collect ROCm version data from the system.
@@ -59,6 +62,22 @@ def collect_data(self, args=None) -> tuple[TaskResult, Optional[RocmDataModel]]:
5962
res = self._run_sut_cmd(f"grep . {path}")
6063
if res.exit_code == 0:
6164
rocm_data = RocmDataModel(rocm_version=res.stdout)
65+
66+
# Collect rocminfo output
67+
rocminfo_res = self._run_sut_cmd(self.CMD_ROCMINFO)
68+
if rocminfo_res.exit_code == 0:
69+
rocm_data.rocminfo = rocminfo_res.stdout
70+
71+
# Collect latest versioned ROCm path (rocm-[3-7]*)
72+
versioned_path_res = self._run_sut_cmd(self.CMD_ROCM_VERSIONED_PATHS)
73+
if versioned_path_res.exit_code == 0:
74+
rocm_data.rocm_latest_versioned_path = versioned_path_res.stdout
75+
76+
# Collect all ROCm paths
77+
all_paths_res = self._run_sut_cmd(self.CMD_ROCM_ALL_PATHS)
78+
if all_paths_res.exit_code == 0:
79+
rocm_data.rocm_all_paths = all_paths_res.stdout
80+
6281
self._log_event(
6382
category="ROCM_VERSION_READ",
6483
description="ROCm version data collected",

nodescraper/plugins/inband/rocm/rocmdata.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#
2525
###############################################################################
2626
import re
27+
from typing import Optional
2728

2829
from pydantic import field_validator
2930

@@ -32,6 +33,9 @@
3233

3334
class RocmDataModel(DataModel):
3435
rocm_version: str
36+
rocminfo: Optional[str] = None
37+
rocm_latest_versioned_path: Optional[str] = None
38+
rocm_all_paths: Optional[str] = None
3539

3640
@field_validator("rocm_version")
3741
@classmethod

0 commit comments

Comments
 (0)