-
Notifications
You must be signed in to change notification settings - Fork 13
Merge from GO #455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
arjunsuresh
wants to merge
10
commits into
mlcommons:dev
Choose a base branch
from
GATEOverflow:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Merge from GO #455
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4b389f3
Added option to skip detect-sudo, support postfix detection
amd-arsuresh dc76ec1
[Automated Commit] Format Codebase [skip ci]
github-actions[bot] ffc4e25
Support installation variations in get,llvm
amd-arsuresh fc772a2
Merge branch 'mlcommons:dev' into dev
arjunsuresh 988924a
Fix tags for nvidia-harness
arjunsuresh 061bf60
Support tar.bz2, 7z and rar in extract-file, export more variables in…
amd-arsuresh 0b55f57
[Automated Commit] Format Codebase [skip ci]
github-actions[bot] 833bb10
Merge branch 'mlcommons:dev' into dev
arjunsuresh a15e989
Added a parser for system-detail.txt
amd-arsuresh 0d9cdd7
[Automated Commit] Format Codebase [skip ci]
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import json | ||
import re | ||
|
||
# Load the input text from the system-info.txt file | ||
with open("system-info.txt", "r", encoding="utf-8") as f: | ||
data = f.read() | ||
|
||
# Define patterns to extract key data points | ||
extracts = { | ||
"uname": r"uname -a\n(.+)", | ||
"username": r"3\. Username\n(.+)", | ||
"uptime": r"2\. w\n\s+.+\s+up\s+(.+?),", | ||
"cpu_model": r"Model name:\s+(.+)", | ||
"cpu_cores": r"Core\(s\) per socket:\s+(\d+)", | ||
"threads_per_core": r"Thread\(s\) per core:\s+(\d+)", | ||
"total_cpus": r"CPU\(s\):\s+(\d+)", | ||
"mem_total_kb": r"MemTotal:\s+(\d+)\s+kB", | ||
"mem_free_kb": r"MemFree:\s+(\d+)\s+kB", | ||
"swap_total_kb": r"SwapTotal:\s+(\d+)\s+kB", | ||
"swap_free_kb": r"SwapFree:\s+(\d+)\s+kB", | ||
"kernel_version": r"kernel.version\s+=\s+(.+)", | ||
"architecture": r"Architecture:\s+(\S+)", | ||
"boot_args": r"13\. Linux kernel boot-time arguments, from /proc/cmdline\n(.+)", | ||
"bios_vendor": r"Vendor:\s+(.+)", | ||
"bios_version": r"Version:\s+([\d\.]+)", | ||
"bios_release_date": r"Release Date:\s+(.+)", | ||
"cpu_frequency_range": r"hardware limits:\s+(.+)", | ||
"virtualization": r"Virtualization:\s+(.+)", | ||
"l1d_cache": r"L1d cache:\s+(.+)", | ||
"l2_cache": r"L2 cache:\s+(.+)", | ||
"l3_cache": r"L3 cache:\s+(.+)", | ||
"numa_nodes": r"NUMA node\(s\):\s+(\d+)", | ||
"runlevel": r"who -r\n\s+run-level\s+(\d+)", | ||
"systemd_version": r"Systemd service manager version\n(.+)", | ||
"max_mhz": r"CPU max MHz:\s+([\d\.]+)", | ||
"min_mhz": r"CPU min MHz:\s+([\d\.]+)", | ||
"bogomips": r"BogoMIPS:\s+([\d\.]+)", | ||
"cache_alignment": r"cache_alignment\s+:\s+(\d+)", | ||
"address_sizes": r"Address sizes:\s+(.+)", | ||
"numactl_total_mem_mb": r"node 0 size:\s+(\d+)\s+MB", | ||
"dimm_actual_speed": r"Speed:\s+(\d+)\s+MT/s", | ||
"dimm_configured_speed": r"Configured Memory Speed:\s+(\d+)\s+MT/s" | ||
} | ||
|
||
# Extract matched values | ||
results = [] | ||
for key, pattern in extracts.items(): | ||
match = re.search(pattern, data) | ||
if match: | ||
results.append({"key": key, "value": match.group(1)}) | ||
|
||
# Add derived field: number of services | ||
services = re.findall(r"\.service", data) | ||
results.append({"key": "total_services_detected", "value": len(services)}) | ||
|
||
# Output as JSON array | ||
json_output = json.dumps(results, indent=2) | ||
print(json_output) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @arjunsuresh , would
--skip-old-files
skip the partially written files also if the previous extraction was not clean?