Skip to content

AIMVT-139: node-scraper offline dmesg adapter + full_dmesg_scan toggle#221

Open
speriaswamy-amd wants to merge 1 commit into
mainfrom
aimvt-139/dmesg-node-scraper-pr1-2
Open

AIMVT-139: node-scraper offline dmesg adapter + full_dmesg_scan toggle#221
speriaswamy-amd wants to merge 1 commit into
mainfrom
aimvt-139/dmesg-node-scraper-pr1-2

Conversation

@speriaswamy-amd

@speriaswamy-amd speriaswamy-amd commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add cvs/lib/node_scraper_adapter.py to parse collected dmesg offline via AMD node-scraper's DmesgAnalyzer (parse_dmesg normalizes events; event_match_lines flattens to legacy {node: [lines]} strings).
  • Wire full_dmesg_scan() behind CVS_DMESG_PARSER (default node-scraper; legacy/false selects err_patterns_dict regex). Auto-falls back to legacy when amd-node-scraper is not installed.
  • Add amd-node-scraper>=1.1.4 to requirements.txt and unit tests for adapter + toggle behavior.

Test plan

  • python -m unittest cvs.lib.unittests.test_node_scraper_adapter (requires amd-node-scraper installed)
  • python -m unittest cvs.lib.unittests.test_verify_lib.TestFullDmesgScan
  • Run a CVS job with CVS_DMESG_PARSER=node-scraper (default) and confirm full_dmesg_scan collects dmesg --time-format iso -x
  • Run with CVS_DMESG_PARSER=legacy and confirm legacy dmesg -T + regex path still works

Made with Cursor

…ggle

Introduce cvs/lib/node_scraper_adapter.py for offline parsing via AMD
node-scraper's DmesgAnalyzer (normalize events → flatten to legacy lines).
Route full_dmesg_scan through the adapter by default (CVS_DMESG_PARSER),
with automatic fallback to err_patterns_dict regex when legacy is selected
or amd-node-scraper is unavailable.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment on lines +93 to +98
plugin = DmesgPlugin(system_info=SystemInfo(name=node_name or DEFAULT_NODE_NAME))
result = plugin.analyze(
data=DmesgData(dmesg_content=dmesg_content or ""),
analysis_args=analysis_args,
)
return [_normalize_event(event) for event in result.events]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI you can also call plugin.run(collection=False, data=dmesg.log, analysis_args=analysis_args) this way the plugin returns the common DataPluginResult which you can later parse similarly for NicPlugin and other plugins you might be interested in.

@alexandraBara alexandraBara left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integration looks good

Comment thread cvs/lib/verify_lib.py
# Environment toggle selecting the dmesg parser backend:
# CVS_DMESG_PARSER=node-scraper (default) -> AMD node-scraper analyzer
# CVS_DMESG_PARSER=legacy -> historical err_patterns_dict regex
# Falls back to legacy automatically when node-scraper is not installed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need fall back mechanism? if we add node-scrapper to requiremets, all cvs installations will have it.

Comment thread requirements.txt
tabulate

# AMD node-scraper: offline dmesg/log parsing (see cvs/lib/node_scraper_adapter.py)
amd-node-scraper >= 1.1.4

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.1.7 is the latest version available

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason to hardcode the version? we are at 1.1.8 as of yesterday

)


def is_available() -> bool:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this, because node-scrapper will be a mandatory requirement for cvs

return NODE_SCRAPER_AVAILABLE


def _require_node_scraper() -> None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this, because node-scrapper will be a mandatory requirement for cvs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants