Skip to content

Conversation

@alexandraBara
Copy link
Collaborator

@alexandraBara alexandraBara commented Aug 4, 2025

Sample runs:

node-scraper --skip-sudo
node-scraper --skip-sudo run-plugins DimmPlugin BiosPlugin

plugin that require sudo can be skipped through setting global_args in plugin config:

{
  "global_args": {
      "analysis_args": {
        "exp_bios_version": [
          "M17"
        ],
        "regex_match": false
      },
      "collection_args": {
        "skip_sudo" : 1
      },
      "max_event_priority_level" : 1,
      "system_interaction_level" : 1,
      "preserve_connection" : 1,
      "collection" : 1,
      "analysis" : 0
  },
  "plugins": {
    "DimmPlugin": {},
    "StoragePlugin": {},
    "DmesgPlugin": {},
    "BiosPlugin": {}
  },
  "result_collators": {}
}

Sample run:

(venv) (base) [alexbara@TheraC59 node-scraper]$ node-scraper --plugin-config reference_config_globals2.py
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Log path: ./scraper_logs_therac59_2025_08_04-03_32_46_PM
  2025-08-04 15:32:46 CDT       INFO               nodescraper | System Name: TheraC59
  2025-08-04 15:32:46 CDT       INFO               nodescraper | System SKU: None
  2025-08-04 15:32:46 CDT       INFO               nodescraper | System Platform: None
  2025-08-04 15:32:46 CDT       INFO               nodescraper | System location: SystemLocation.LOCAL
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Initializing connection manager for InBandConnectionManager with default args
  2025-08-04 15:32:46 CDT       INFO               nodescraper | --------------------------------------------------
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Running plugin DimmPlugin
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Initializing connection: InBandConnectionManager
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Using local shell
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Checking OS family
  2025-08-04 15:32:46 CDT       INFO               nodescraper | OS Family: LINUX
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Running data collector: DimmCollector
  2025-08-04 15:32:46 CDT       INFO               nodescraper | (DimmPlugin) Skipping sudo plugin
  2025-08-04 15:32:46 CDT       INFO               nodescraper | --------------------------------------------------
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Running plugin StoragePlugin
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Running data collector: StorageCollector
  2025-08-04 15:32:46 CDT       INFO               nodescraper | (StoragePlugin) Skipping sudo plugin
  2025-08-04 15:32:46 CDT       INFO               nodescraper | --------------------------------------------------
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Running plugin DmesgPlugin
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Running data collector: DmesgCollector
  2025-08-04 15:32:46 CDT       INFO               nodescraper | (DmesgPlugin) Skipping sudo plugin
  2025-08-04 15:32:46 CDT       INFO               nodescraper | --------------------------------------------------
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Running plugin BiosPlugin
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Running data collector: BiosCollector
  2025-08-04 15:32:46 CDT       INFO               nodescraper | (BiosPlugin) BIOS: M17
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Closing connections
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Running result collators
  2025-08-04 15:32:46 CDT       INFO               nodescraper | Running TableSummary result collator
  2025-08-04 15:32:46 CDT       INFO               nodescraper |

+-------------------------+--------+-----------------------------+
|  Connection              | Status | Message                     |
+-------------------------+--------+-----------------------------+
|  InBandConnectionManager | UNSET  | task completed successfully |
+-------------------------+--------+-----------------------------+

+---------------+---------+-------------------------------------+
|  Plugin        | Status  | Message                             |
+---------------+---------+-------------------------------------+
|  DimmPlugin    | NOT_RAN | Plugin tasks not ran                |
|  StoragePlugin | NOT_RAN | Plugin tasks not ran                |
|  DmesgPlugin   | NOT_RAN | Plugin tasks not ran                |
|  BiosPlugin    | OK      | Plugin tasks completed successfully |
+---------------+---------+-------------------------------------+

  2025-08-04 15:32:46 CDT       INFO               nodescraper | Data written to csv file: ./scraper_logs_therac59_2025_08_04-03_32_46_PM/nodescraper.csv

@alexandraBara alexandraBara changed the title Enabling to skip sudo plugins through global_args Enabling to skip sudo plugins Aug 8, 2025
@alexandraBara
Copy link
Collaborator Author

@landrews-amd i have updated this PR and enabled to skip sudo through cmd line args as well since my team keeps running into issues like this and doing it through configs isnt enough. We run tests mostly without providing plugin configs

@alexandraBara alexandraBara requested a review from cmcknigh August 8, 2025 15:25
@alexandraBara
Copy link
Collaborator Author

@cmcknigh we can update our tests to look like this:

node-scraper --skip-sudo
node-scraper --skip-sudo run-plugins DimmPlugin BiosPlugin

notice the extra --skip-sudo cmd line arg

Comment on lines 429 to 430
for pcfg in plugin_config_inst_list:
pcfg.global_args.setdefault("collection_args", {})["skip_sudo"] = True
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would only need to be added to the last config in the list, not every one. They will be merged together in plugin executor, with the last config taking precedence.

Comment on lines 49 to 52
if args.skip_sudo:
self.result.message = "Skipping sudo plugin"
self.result.status = ExecutionStatus.NOT_RAN
return self.result, None
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should only be done if targeting linux.

Comment on lines 49 to 52
if args.skip_sudo:
self.result.message = "Skipping sudo plugin"
self.result.status = ExecutionStatus.NOT_RAN
return self.result, None
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should only be done when targeting linux

@alexandraBara alexandraBara merged commit 10ac319 into development Aug 18, 2025
5 checks passed
@alexandraBara alexandraBara deleted the alex_skip_sudo branch August 18, 2025 15:32
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