Skip to content

Commit 4f9da3e

Browse files
Merge pull request #8 from amd/alex_doc_fix
updated README
2 parents 1039186 + 594ca58 commit 4f9da3e

File tree

1 file changed

+93
-19
lines changed

1 file changed

+93
-19
lines changed

README.md

Lines changed: 93 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
11
# Node Scraper
2-
Node Scraper is a tool which performs automated data collection and analysis for the purposes of system debug.
2+
Node Scraper is a tool which performs automated data collection and analysis for the purposes of
3+
system debug.
34

45
## Installation
56
### Install From Source
6-
Node Scraper requires Python 3.10+ for installation. After cloning this repository, call dev-setup.sh script with 'source'. This script creates an editable install of Node Scraper in a python virtual environment and also configures the pre-commit hooks for the project.
7+
Node Scraper requires Python 3.10+ for installation. After cloning this repository,
8+
call dev-setup.sh script with 'source'. This script creates an editable install of Node Scraper in
9+
a python virtual environment and also configures the pre-commit hooks for the project.
710

811
```sh
912
source dev-setup.sh
1013
```
1114

1215
## CLI Usage
13-
The Node Scraper CLI can be used to run Node Scraper plugins on a target system. The following CLI options are available:
16+
The Node Scraper CLI can be used to run Node Scraper plugins on a target system. The following CLI
17+
options are available:
1418

1519
```sh
16-
usage: node-scraper [-h] [--sys-name STRING] [--sys-location {LOCAL,REMOTE}] [--sys-interaction-level {PASSIVE,INTERACTIVE,DISRUPTIVE}]
17-
[--sys-sku STRING] [--sys-platform STRING] [--plugin-config STRING] [--system-config STRING] [--connection-config STRING]
18-
[--log-path STRING] [--log-level {CRITICAL,FATAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}]
19-
{run-plugins,gen-plugin-config,describe} ...
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}]
22+
{run-plugins,describe,gen-plugin-config} ...
2023

21-
Error scraper CLI
24+
node scraper CLI
2225

2326
positional arguments:
24-
{run-plugins,gen-plugin-config,describe}
27+
{run-plugins,describe,gen-plugin-config}
2528
Subcommands
2629
run-plugins Run a series of plugins
27-
gen-plugin-config Generate a config for a plugin or list of plugins
2830
describe Display details on a built-in config or plugin
31+
gen-plugin-config Generate a config for a plugin or list of plugins
2932

3033
options:
3134
-h, --help show this help message and exit
32-
--sys-name STRING System name (default: MKM-L1-LANDRE53)
35+
--sys-name STRING System name (default: TheraC55)
3336
--sys-location {LOCAL,REMOTE}
3437
Location of target system (default: LOCAL)
3538
--sys-interaction-level {PASSIVE,INTERACTIVE,DISRUPTIVE}
3639
Specify system interaction level, used to determine the type of actions that plugins can perform (default: INTERACTIVE)
3740
--sys-sku STRING Manually specify SKU of system (default: None)
3841
--sys-platform STRING
3942
Specify system platform (default: None)
40-
--plugin-config STRING
41-
Path to plugin config json (default: None)
43+
--plugin-configs [STRING ...]
44+
built-in config names or paths to plugin config JSONs. Available built-in configs: NodeStatus (default: None)
4245
--system-config STRING
4346
Path to system config json (default: None)
4447
--connection-config STRING
@@ -49,7 +52,8 @@ options:
4952

5053
```
5154
52-
The plugins to run can be specified in two ways, using a plugin JSON config file or using the 'run-plugins' sub command. These two options are not mutually exclusive and can be used together.
55+
The plugins to run can be specified in two ways, using a plugin JSON config file or using the
56+
'run-plugins' sub command. These two options are not mutually exclusive and can be used together.
5357
5458
---
5559
@@ -80,7 +84,13 @@ node-scraper describe plugin <plugin-name>
8084
---
8185
8286
### Plugin Configs
83-
A plugin JSON config should follow the structure of the plugin config model defined here. The globals field is a dictionary of global key-value pairs; values in globals will be passed to any plugin that supports the corresponding key. The plugins field should be a dictionary mapping plugin names to sub-dictionaries of plugin arguments. Lastly, the result_collators attribute is used to define result collator classes that will be run on the plugin results. By default, the CLI adds the TableSummary result collator, which prints a summary of each plugin’s results in a tabular format to the console.
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.
8494
8595
```json
8696
{
@@ -101,13 +111,15 @@ A plugin JSON config should follow the structure of the plugin config model defi
101111
```
102112
103113
### 'gen-plugin-config' sub command
104-
The 'gen-plugin-config' sub command can be used to generate a plugin config JSON file for a plugin or list of plugins that can then be customized. Plugin arguments which have default values will be prepopulated in the JSON file, arguments without default values will have a value of 'null'.
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'.
105117
106118
#### 'gen-plugin-config' Examples
107119
108120
Generate a config for the DmesgPlugin:
109121
```sh
110-
node-scraper gen-plugin-config DmesgPlugin
122+
node-scraper gen-plugin-config --plugins DmesgPlugin
111123
```
112124
113125
This would produce the following config:
@@ -134,9 +146,12 @@ This would produce the following config:
134146
```
135147
136148
### 'run-plugins' sub command
137-
The plugins to run and their associated arguments can also be specified directly on the CLI using the 'run-plugins' sub-command. Using this sub-command you can specify a plugin name followed by the arguments for that particular plugin. Multiple plugins can be specified at once.
149+
The plugins to run and their associated arguments can also be specified directly on the CLI using
150+
the 'run-plugins' sub-command. Using this sub-command you can specify a plugin name followed by
151+
the arguments for that particular plugin. Multiple plugins can be specified at once.
138152
139-
You can view the available arguments for a particular plugin by running `node-scraper run-plugins <plugin-name> -h`:
153+
You can view the available arguments for a particular plugin by running
154+
`node-scraper run-plugins <plugin-name> -h`:
140155
```sh
141156
usage: node-scraper run-plugins BiosPlugin [-h] [--collection {True,False}] [--analysis {True,False}] [--system-interaction-level STRING]
142157
[--data STRING] [--exp-bios-version [STRING ...]] [--regex-match {True,False}]
@@ -175,3 +190,62 @@ Use plugin configs and 'run-plugins'
175190
```sh
176191
node-scraper run-plugins BiosPlugin
177192
```
193+
194+
195+
### '--plugin-configs' example
196+
A plugin config can be used to compare the system data against the config specifications:
197+
```sh
198+
node-scraper --plugin-configs plugin_config.json
199+
```
200+
Here is an example of a comprehensive plugin config that specifies analyzer args for each plugin:
201+
```json
202+
{
203+
"global_args": {},
204+
"plugins": {
205+
"BiosPlugin": {
206+
"analysis_args": {
207+
"exp_bios_version": "3.5"
208+
}
209+
},
210+
"CmdlinePlugin": {
211+
"analysis_args": {
212+
"cmdline": "imgurl=test NODE=nodename selinux=0 serial console=ttyS1,115200 console=tty0",
213+
"required_cmdline" : "selinux=0"
214+
}
215+
},
216+
"DkmsPlugin": {
217+
"analysis_args": {
218+
"dkms_status": "amdgpu/6.11",
219+
"dkms_version" : "dkms-3.1",
220+
"regex_match" : true
221+
}
222+
},
223+
"KernelPlugin": {
224+
"analysis_args": {
225+
"exp_kernel": "5.11-generic"
226+
}
227+
},
228+
"OsPlugin": {
229+
"analysis_args": {
230+
"exp_os": "Ubuntu 22.04.2 LTS"
231+
}
232+
},
233+
"PackagePlugin": {
234+
"analysis_args": {
235+
"exp_package_ver": {
236+
"gcc": "11.4.0"
237+
},
238+
"regex_match": false
239+
}
240+
},
241+
"RocmPlugin": {
242+
"analysis_args": {
243+
"exp_rocm": "6.5"
244+
}
245+
}
246+
},
247+
"result_collators": {},
248+
"name": "plugin_config",
249+
"desc": "My golden config"
250+
}
251+
```

0 commit comments

Comments
 (0)