Skip to content

Commit 10cdf0d

Browse files
Jaspal SinghJaspal Singh
authored andcommitted
initial rocm commands
1 parent 445b561 commit 10cdf0d

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

nodescraper/plugins/inband/rocm/rocm_collector.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from typing import Optional
2828

2929
from nodescraper.base import InBandDataCollector
30+
from nodescraper.connection.inband import TextFileArtifact
3031
from nodescraper.enums import EventCategory, EventPriority, ExecutionStatus, OSFamily
3132
from nodescraper.models import TaskResult
3233

@@ -79,6 +80,11 @@ def collect_data(self, args=None) -> tuple[TaskResult, Optional[RocmDataModel]]:
7980
for line in rocminfo_res.stdout.strip().split("\n")
8081
]
8182

83+
# Add rocminfo output as a text file artifact
84+
self.result.artifacts.append(
85+
TextFileArtifact(filename="rocminfo.log", contents=rocminfo_res.stdout)
86+
)
87+
8288
# Collect latest versioned ROCm path (rocm-[3-7]*)
8389
versioned_path_res = self._run_sut_cmd(self.CMD_ROCM_VERSIONED_PATHS)
8490
if versioned_path_res.exit_code == 0:
@@ -93,25 +99,13 @@ def collect_data(self, args=None) -> tuple[TaskResult, Optional[RocmDataModel]]:
9399
if path.strip()
94100
]
95101

96-
# Create concise summary for logging
97-
log_summary = {
98-
"rocm_version": rocm_data.rocm_version,
99-
"rocminfo_lines_collected": (
100-
len(rocm_data.rocminfo) if rocm_data.rocminfo else 0
101-
),
102-
"rocm_latest_versioned_path": rocm_data.rocm_latest_versioned_path,
103-
"rocm_paths_count": (
104-
len(rocm_data.rocm_all_paths) if rocm_data.rocm_all_paths else 0
105-
),
106-
}
107-
108102
self._log_event(
109103
category="ROCM_VERSION_READ",
110104
description="ROCm version data collected",
111-
data=log_summary,
105+
data=rocm_data.model_dump(include={"rocm_version"}),
112106
priority=EventPriority.INFO,
113107
)
114-
self.result.message = f"ROCm version: {rocm_data.rocm_version}, Latest path: {rocm_data.rocm_latest_versioned_path}"
108+
self.result.message = f"ROCm version: {rocm_data.rocm_version}"
115109
self.result.status = ExecutionStatus.OK
116110
break
117111
else:

0 commit comments

Comments
 (0)