Skip to content

Commit f5adb88

Browse files
docs: add badges, architecture diagram, and polish README
1 parent 20404d5 commit f5adb88

1 file changed

Lines changed: 99 additions & 67 deletions

File tree

README.md

Lines changed: 99 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,65 @@
1+
[![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=for-the-badge&logo=rust&logoColor=white)](https://www.rust-lang.org) [![Nix](https://img.shields.io/badge/nix-%23000000.svg?style=for-the-badge&logo=nixos&logoColor=white)](https://nixos.org) [![Linux](https://img.shields.io/badge/linux-%23000000.svg?style=for-the-badge&logo=linux&logoColor=white)](https://kernel.org)
2+
13
# Hardware Report
24

3-
Automated infrastructure discovery tool for Linux servers. Generates structured hardware inventory reports in TOML/JSON format.
5+
**Automated infrastructure discovery tool for Linux servers built with hexagonal architecture.**
6+
7+
Generates structured hardware inventory reports in TOML/JSON format. Designed for CMDB population, infrastructure auditing, and bare-metal server management at scale.
48

59
## Table of Contents
610

7-
- [Features](#features)
11+
- [What Does This Do?](#what-does-this-do)
812
- [Quick Start](#quick-start)
913
- [Installation](#installation)
10-
- [Usage](#usage)
14+
- [Architecture Overview](#architecture-overview)
1115
- [Documentation](#documentation)
1216
- [Contributing](#contributing)
1317
- [License](#license)
1418

15-
## Features
19+
## What Does This Do?
1620

17-
- **CPU**: Model, sockets, cores, threads, NUMA topology, cache hierarchy
18-
- **Memory**: Total capacity, module details, type, speed, slot mapping
19-
- **Storage**: NVMe/SSD/HDD detection, capacity, serial numbers, SMART status
20-
- **GPU**: NVIDIA detection via nvidia-smi, memory, PCI topology, UUIDs
21-
- **Network**: Interface discovery, MAC/IP, speed, InfiniBand support
22-
- **System**: BIOS, BMC/IPMI, chassis, motherboard specifications
21+
- **CPU Discovery** - Model, sockets, cores, threads, NUMA topology, cache hierarchy, frequency ranges
22+
- **Memory Detection** - Total capacity, module details, DDR type, speed, slot mapping
23+
- **Storage Enumeration** - NVMe/SSD/HDD detection, capacity, serial numbers, firmware, SMART status
24+
- **GPU Detection** - NVIDIA via nvidia-smi, memory, PCI topology, UUIDs, driver versions
25+
- **Network Interfaces** - MAC/IP, speed (1G-400G+), InfiniBand, driver info, link state
26+
- **System Information** - BIOS, BMC/IPMI, chassis serial, motherboard specs
2327

2428
## Quick Start
2529

26-
### Pre-built Release (Recommended)
30+
Get up and running in minutes:
2731

2832
```bash
29-
# Download latest release
30-
curl -sL https://api.github.com/repos/sfcompute/hardware_report/releases/latest \
31-
| grep "browser_download_url.*\.deb" | cut -d '"' -f 4 | wget -qi -
32-
33-
# Install and run
34-
sudo apt install -y ./hardware-report_*_amd64.deb
35-
sudo hardware_report
36-
```
33+
# 1. Clone and build
34+
git clone https://github.com/sfcompute/hardware_report.git
35+
cd hardware_report
36+
nix build
3737

38-
### Nix Build
38+
# 2. Run hardware discovery
39+
sudo ./result/bin/hardware_report
3940

40-
```bash
41-
git clone https://github.com/sfcompute/hardware_report.git && cd hardware_report
42-
nix build && sudo ./result/bin/hardware_report
41+
# Output: <chassis_serial>_hardware_report.toml
4342
```
4443

45-
### Cargo Build
46-
47-
```bash
48-
# Install dependencies (Ubuntu/Debian)
49-
sudo apt-get install -y build-essential pkg-config libssl-dev numactl ipmitool ethtool pciutils
50-
51-
# Build and run
52-
git clone https://github.com/sfcompute/hardware_report.git && cd hardware_report
53-
cargo build --release
54-
sudo ./target/release/hardware_report
55-
```
44+
**Need more details?** See our detailed guides:
45+
- **[Installation](#installation)** - Complete setup instructions for all environments
46+
- **[Architecture Overview](#architecture-overview)** - Hexagonal architecture and design
5647

5748
## Installation
5849

59-
### Option 1: Pre-built Releases
50+
### Option 1: Pre-built Releases (Recommended)
6051

6152
Download from [GitHub Releases](https://github.com/sfcompute/hardware_report/releases):
62-
- `hardware-report_*_amd64.deb` - Debian/Ubuntu package
63-
- `hardware_report-linux-x86_64-*.tar.gz` - Standalone binary
6453

65-
### Option 2: Nix
54+
```bash
55+
# Debian/Ubuntu package
56+
curl -sL https://api.github.com/repos/sfcompute/hardware_report/releases/latest \
57+
| grep "browser_download_url.*\.deb" | cut -d '"' -f 4 | wget -qi -
58+
sudo apt install -y ./hardware-report_*_amd64.deb
59+
sudo hardware_report
60+
```
61+
62+
### Option 2: Nix Build
6663

6764
```bash
6865
# One-liner: install Nix + build + run
@@ -72,21 +69,23 @@ git clone https://github.com/sfcompute/hardware_report.git && cd hardware_report
7269
nix build && sudo ./result/bin/hardware_report
7370
```
7471

75-
Development shell:
72+
**Development shell:**
7673
```bash
7774
nix develop
7875
cargo build --release
7976
```
8077

81-
### Option 3: Traditional Build
78+
### Option 3: Traditional Cargo Build
8279

8380
**Ubuntu/Debian:**
8481
```bash
8582
sudo apt-get update && sudo apt-get install -y \
8683
build-essential pkg-config libssl-dev git \
8784
numactl ipmitool ethtool util-linux pciutils
8885

86+
git clone https://github.com/sfcompute/hardware_report.git && cd hardware_report
8987
cargo build --release
88+
sudo ./target/release/hardware_report
9089
```
9190

9291
**RHEL/Fedora:**
@@ -97,14 +96,53 @@ sudo dnf install pkg-config openssl-devel numactl ipmitool ethtool util-linux pc
9796
cargo build --release
9897
```
9998

100-
## Usage
99+
### Runtime Dependencies
101100

102-
```bash
103-
# Run with sudo for full hardware access
104-
sudo ./target/release/hardware_report
101+
| Tool | Purpose |
102+
|------|---------|
103+
| `numactl` | NUMA topology |
104+
| `ipmitool` | BMC/IPMI data |
105+
| `ethtool` | Network interface details |
106+
| `lspci` | PCI device enumeration |
107+
| `dmidecode` | System/BIOS/memory info |
108+
| `nvidia-smi` | GPU detection (optional) |
109+
110+
> **Note:** Nix builds bundle all dependencies automatically.
111+
112+
## Architecture Overview
113+
114+
Built with **hexagonal (ports & adapters) architecture** for clean separation of concerns:
105115

106-
# Output: <chassis_serial>_hardware_report.toml
107116
```
117+
┌──────────────────────────────────────┐
118+
│ Core Domain (Pure) │
119+
│ │
120+
Primary Ports │ ┌────────────────────────────┐ │ Secondary Ports
121+
(Inbound) │ │ Domain Services │ │ (Outbound)
122+
│ │ • HardwareCollectionSvc │ │
123+
┌─────────────┐ │ │ • ReportGenerationSvc │ │ ┌──────────────────┐
124+
│ CLI │───►│ └────────────────────────────┘ │───►│ System Adapters │
125+
│ │ │ │ │ • LinuxProvider │
126+
│ hardware_ │ │ ┌────────────────────────────┐ │ │ • MacOSProvider │
127+
│ report │ │ │ Domain Entities │ │ └──────────────────┘
128+
└─────────────┘ │ │ • CpuInfo, MemoryInfo │ │
129+
│ │ • StorageInfo, GpuInfo │ │ ┌──────────────────┐
130+
┌─────────────┐ │ │ • NetworkInfo, SystemInfo │ │───►│ Command Executor │
131+
│ Library │───►│ └────────────────────────────┘ │ │ • UnixExecutor │
132+
│ │ │ │ └──────────────────┘
133+
│ create_ │ │ ┌────────────────────────────┐ │
134+
│ service() │ │ │ Pure Parsers │ │ ┌──────────────────┐
135+
└─────────────┘ │ │ • CPU, Memory, Storage │ │───►│ Publishers │
136+
│ │ • GPU, Network, System │ │ │ • FilePublisher │
137+
│ └────────────────────────────┘ │ │ • HttpPublisher │
138+
└──────────────────────────────────────┘ └──────────────────┘
139+
```
140+
141+
**Why Hexagonal Architecture?**
142+
- **Testable** - Mock any external dependency for thorough testing
143+
- **Flexible** - Swap system providers or publishers independently
144+
- **Maintainable** - Clear boundaries between business logic and infrastructure
145+
- **Platform Independent** - Core domain stays pure, adapters handle OS specifics
108146

109147
### Sample Output
110148

@@ -116,39 +154,34 @@ Memory: 512GB DDR4 @ 3200 MHz
116154
Storage: 15.36 TB (4x 3.84TB NVMe)
117155
GPUs: 8x NVIDIA H100 80GB HBM3
118156
Network: 2x 100GbE, 4x 400Gb InfiniBand
157+
BIOS: AMI 2.4.3 (01/15/2024)
158+
Chassis: SuperMicro (S/N: S454857X9822867)
119159
```
120160

121-
### Runtime Dependencies
122-
123-
| Tool | Purpose |
124-
|------|---------|
125-
| `numactl` | NUMA topology |
126-
| `ipmitool` | BMC/IPMI data |
127-
| `ethtool` | Network interface details |
128-
| `lspci` | PCI device enumeration |
129-
| `dmidecode` | System/BIOS/memory info |
130-
| `nvidia-smi` | GPU detection (optional) |
131-
132-
> **Note:** Nix builds bundle all dependencies automatically.
133-
134161
## Documentation
135162

136163
| Document | Description |
137164
|----------|-------------|
138-
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | Hexagonal architecture overview |
165+
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | Hexagonal architecture deep dive |
139166
| [docs/API.md](docs/API.md) | Library API reference |
140167
| [docs/DEPLOYMENT.md](docs/DEPLOYMENT.md) | Production deployment guide |
141168

142169
## Contributing
143170

144-
Pull requests welcome. For major changes, please open an issue first.
171+
Found a bug or want to add something? We welcome contributions!
145172

173+
**Quick Development Workflow:**
146174
```bash
147-
# Development
148-
nix develop
149-
cargo test
150-
cargo clippy
151-
cargo fmt
175+
# 1. Fork and clone
176+
git clone https://github.com/your-username/hardware_report.git
177+
178+
# 2. Set up development environment
179+
nix develop # or follow traditional Rust setup
180+
181+
# 3. Make changes and test
182+
cargo test && cargo clippy && cargo fmt
183+
184+
# 4. Submit PR with descriptive commit messages
152185
```
153186

154187
## License
@@ -157,5 +190,4 @@ cargo fmt
157190

158191
---
159192

160-
**Repository:** https://github.com/sfcompute/hardware_report
161-
**Author:** SF Compute
193+
**Built for infrastructure management at scale** | [Issues](https://github.com/sfcompute/hardware_report/issues) | [Releases](https://github.com/sfcompute/hardware_report/releases)

0 commit comments

Comments
 (0)