Skip to content

Commit ddcf8bf

Browse files
authored
Merge branch 'development' into feature/mypy-precommit
2 parents 7d1850d + b8cbaf7 commit ddcf8bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1163
-467
lines changed

CONTRIBUITING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ When creating a PR, use the following process.
5555
### Documentation
5656

5757
Submit Node Scraper documentation changes to our
58-
[documentation](https://github.com/amd/node-scraper/development/README.md). You must update
58+
[documentation](https://github.com/amd/node-scraper/blob/development/README.md). You must update
5959
documentation related to any new feature or API contribution.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 AMD HPC Application Performance Team
3+
Copyright (c) 2025 Advanced Micro Devices, Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 127 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ The Node Scraper CLI can be used to run Node Scraper plugins on a target system.
1717
options are available:
1818

1919
```sh
20-
usage: node-scraper [-h] [--sys-name STRING] [--sys-location {LOCAL,REMOTE}] [--sys-interaction-level {PASSIVE,INTERACTIVE,DISRUPTIVE}] [--sys-sku STRING] [--sys-platform STRING] [--plugin-configs [STRING ...]]
21-
[--system-config STRING] [--connection-config STRING] [--log-path STRING] [--log-level {CRITICAL,FATAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}]
20+
usage: node-scraper [-h] [--sys-name STRING] [--sys-location {LOCAL,REMOTE}] [--sys-interaction-level {PASSIVE,INTERACTIVE,DISRUPTIVE}]
21+
[--sys-sku STRING] [--sys-platform STRING] [--plugin-configs [STRING ...]] [--system-config STRING]
22+
[--connection-config STRING] [--log-path STRING] [--log-level {CRITICAL,FATAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}]
23+
[--gen-reference-config]
2224
{run-plugins,describe,gen-plugin-config} ...
2325

2426
node scraper CLI
@@ -32,7 +34,7 @@ positional arguments:
3234

3335
options:
3436
-h, --help show this help message and exit
35-
--sys-name STRING System name (default: TheraC55)
37+
--sys-name STRING System name (default: <my_system_name>)
3638
--sys-location {LOCAL,REMOTE}
3739
Location of target system (default: LOCAL)
3840
--sys-interaction-level {PASSIVE,INTERACTIVE,DISRUPTIVE}
@@ -49,103 +51,42 @@ options:
4951
--log-path STRING Specifies local path for node scraper logs, use 'None' to disable logging (default: .)
5052
--log-level {CRITICAL,FATAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}
5153
Change python log level (default: INFO)
54+
--gen-reference-config
55+
Generate reference config from system. Writes to ./reference_config.json. (default: False)
56+
5257

5358
```
5459
55-
The plugins to run can be specified in two ways, using a plugin JSON config file or using the
60+
### Subcommmands
61+
62+
Plugins to run can be specified in two ways, using a plugin JSON config file or using the
5663
'run-plugins' sub command. These two options are not mutually exclusive and can be used together.
5764
58-
---
5965
60-
### Describing Built-in Configs and Plugins
66+
1. **'describe' subcommand**
6167
6268
You can use the `describe` subcommand to display details about built-in configs or plugins.
63-
64-
#### List all built-in configs:
69+
List all built-in configs:
6570
```sh
6671
node-scraper describe config
6772
```
6873
69-
#### Show details for a specific built-in config:
74+
Show details for a specific built-in config
7075
```sh
7176
node-scraper describe config <config-name>
7277
```
7378
74-
#### List all available plugins:
79+
List all available plugins**
7580
```sh
7681
node-scraper describe plugin
7782
```
7883
79-
#### Show details for a specific plugin:
84+
Show details for a specific plugin
8085
```sh
8186
node-scraper describe plugin <plugin-name>
8287
```
8388
84-
---
85-
86-
### Plugin Configs
87-
A plugin JSON config should follow the structure of the plugin config model defined here.
88-
The globals field is a dictionary of global key-value pairs; values in globals will be passed to
89-
any plugin that supports the corresponding key. The plugins field should be a dictionary mapping
90-
plugin names to sub-dictionaries of plugin arguments. Lastly, the result_collators attribute is
91-
used to define result collator classes that will be run on the plugin results. By default, the CLI
92-
adds the TableSummary result collator, which prints a summary of each plugin’s results in a
93-
tabular format to the console.
94-
95-
```json
96-
{
97-
"globals_args": {},
98-
"plugins": {
99-
"BiosPlugin": {
100-
"analysis_args": {
101-
"exp_bios_version": "TestBios123"
102-
}
103-
},
104-
"RocmPlugin": {
105-
"analysis_args": {
106-
"exp_rocm_version": "TestRocm123"
107-
}
108-
}
109-
}
110-
}
111-
```
112-
113-
### 'gen-plugin-config' sub command
114-
The 'gen-plugin-config' sub command can be used to generate a plugin config JSON file for a plugin
115-
or list of plugins that can then be customized. Plugin arguments which have default values will be
116-
prepopulated in the JSON file, arguments without default values will have a value of 'null'.
117-
118-
#### 'gen-plugin-config' Examples
119-
120-
Generate a config for the DmesgPlugin:
121-
```sh
122-
node-scraper gen-plugin-config --plugins DmesgPlugin
123-
```
124-
125-
This would produce the following config:
126-
127-
```json
128-
{
129-
"global_args": {},
130-
"plugins": {
131-
"DmesgPlugin": {
132-
"collection": true,
133-
"analysis": true,
134-
"system_interaction_level": "INTERACTIVE",
135-
"data": null,
136-
"analysis_args": {
137-
"analysis_range_start": null,
138-
"analysis_range_end": null,
139-
"check_unknown_dmesg_errors": true,
140-
"exclude_category": null
141-
}
142-
}
143-
},
144-
"result_collators": {}
145-
}
146-
```
147-
148-
### 'run-plugins' sub command
89+
2. **'run-plugins' sub command**
14990
The plugins to run and their associated arguments can also be specified directly on the CLI using
15091
the 'run-plugins' sub-command. Using this sub-command you can specify a plugin name followed by
15192
the arguments for that particular plugin. Multiple plugins can be specified at once.
@@ -167,7 +108,7 @@ options:
167108

168109
```
169110
170-
#### 'run-plugins' Examples
111+
Examples
171112
172113
Run a single plugin
173114
```sh
@@ -191,8 +132,69 @@ Use plugin configs and 'run-plugins'
191132
node-scraper run-plugins BiosPlugin
192133
```
193134
135+
3. **'gen-plugin-config' sub command**
136+
The 'gen-plugin-config' sub command can be used to generate a plugin config JSON file for a plugin
137+
or list of plugins that can then be customized. Plugin arguments which have default values will be
138+
prepopulated in the JSON file, arguments without default values will have a value of 'null'.
139+
140+
Examples
141+
142+
Generate a config for the DmesgPlugin:
143+
```sh
144+
node-scraper gen-plugin-config --plugins DmesgPlugin
145+
```
146+
147+
This would produce the following config:
148+
149+
```json
150+
{
151+
"global_args": {},
152+
"plugins": {
153+
"DmesgPlugin": {
154+
"collection": true,
155+
"analysis": true,
156+
"system_interaction_level": "INTERACTIVE",
157+
"data": null,
158+
"analysis_args": {
159+
"analysis_range_start": null,
160+
"analysis_range_end": null,
161+
"check_unknown_dmesg_errors": true,
162+
"exclude_category": null
163+
}
164+
}
165+
},
166+
"result_collators": {}
167+
}
168+
```
169+
170+
### Plugin Configs
171+
A plugin JSON config should follow the structure of the plugin config model defined here.
172+
The globals field is a dictionary of global key-value pairs; values in globals will be passed to
173+
any plugin that supports the corresponding key. The plugins field should be a dictionary mapping
174+
plugin names to sub-dictionaries of plugin arguments. Lastly, the result_collators attribute is
175+
used to define result collator classes that will be run on the plugin results. By default, the CLI
176+
adds the TableSummary result collator, which prints a summary of each plugin’s results in a
177+
tabular format to the console.
178+
179+
```json
180+
{
181+
"globals_args": {},
182+
"plugins": {
183+
"BiosPlugin": {
184+
"analysis_args": {
185+
"exp_bios_version": "TestBios123"
186+
}
187+
},
188+
"RocmPlugin": {
189+
"analysis_args": {
190+
"exp_rocm_version": "TestRocm123"
191+
}
192+
}
193+
}
194+
}
195+
```
194196
195-
### '--plugin-configs' example
197+
1. **'--plugin-configs' command**
196198
A plugin config can be used to compare the system data against the config specifications:
197199
```sh
198200
node-scraper --plugin-configs plugin_config.json
@@ -249,3 +251,50 @@ Here is an example of a comprehensive plugin config that specifies analyzer args
249251
"desc": "My golden config"
250252
}
251253
```
254+
255+
2. **'gen-reference-config' command**
256+
This command can be used to generate a reference config that is populated with current system
257+
configurations. Plugins that use analyzer args (where applicable) will be populated with system
258+
data.
259+
Sample command:
260+
```sh
261+
node-scraper --gen-reference-config run-plugins BiosPlugin OsPlugin
262+
263+
```
264+
This will generate the following config:
265+
```json
266+
{
267+
"global_args": {},
268+
"plugins": {
269+
"BiosPlugin": {
270+
"analysis_args": {
271+
"exp_bios_version": [
272+
"M17"
273+
],
274+
"regex_match": false
275+
}
276+
},
277+
"OsPlugin": {
278+
"analysis_args": {
279+
"exp_os": [
280+
"8.10"
281+
],
282+
"exact_match": true
283+
}
284+
}
285+
},
286+
"result_collators": {}
287+
```
288+
This config can later be used on a different platform for comparison, using the steps at #2:
289+
```sh
290+
node-scraper --plugin-configs reference_config.json
291+
292+
```
293+
294+
An alternate way to generate a reference config is by using log files from a previous run. The
295+
example below uses log files from 'scraper_logs_<path>/':
296+
```sh
297+
node-scraper gen-plugin-config --gen-reference-config-from-logs scraper_logs_<path>/ --output-path custom_output_dir
298+
```
299+
This will generate a reference config that includes plugins with logged results in
300+
'scraper_log_<path>' and save the new config to 'custom_output_dir/reference_config.json'.

0 commit comments

Comments
 (0)