https://github.com/opiproject/opi-smbios-bridge
OPI gRPC to SMBIOS bridge for inventory
https://github.com/opiproject/opi-smbios-bridge
Last synced: 12 months ago
JSON representation
OPI gRPC to SMBIOS bridge for inventory
- Host: GitHub
- URL: https://github.com/opiproject/opi-smbios-bridge
- Owner: opiproject
- License: apache-2.0
- Created: 2022-12-20T00:55:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-13T23:10:19.000Z (about 2 years ago)
- Last Synced: 2024-06-14T01:22:14.416Z (about 2 years ago)
- Language: Go
- Size: 258 KB
- Stars: 1
- Watchers: 1
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# OPI inventory gRPC to SMBIOS DMI bridge
[](https://github.com/opiproject/opi-smbios-bridge/actions/workflows/linters.yml)
[](https://github.com/opiproject/opi-smbios-bridge/actions/workflows/codeql.yml)
[](https://securityscorecards.dev/viewer/?platform=github.com&org=opiproject&repo=opi-smbios-bridge)
[](https://github.com/opiproject/opi-smbios-bridge/actions/workflows/go.yml)
[](https://github.com/opiproject/opi-smbios-bridge/actions/workflows/docker-publish.yml)
[](https://github.com/opiproject/opi-smbios-bridge/blob/master/LICENSE)
[](https://codecov.io/gh/opiproject/opi-smbios-bridge)
[](https://goreportcard.com/report/github.com/opiproject/opi-smbios-bridge)
[](http://godoc.org/github.com/opiproject/opi-smbios-bridge)
[](https://hub.docker.com/r/opiproject/opi-smbios-bridge)
[](https://github.com/opiproject/opi-smbios-bridge/releases)
[](https://github.com/opiproject/opi-smbios-bridge)
[](https://github.com/opiproject/opi-smbios-bridge/graphs/contributors)
This is a [SMBIOS](https://www.dmtf.org/standards/smbios) plugin to OPI inventory gRPC APIs based on [dmidecode](https://linux.die.net/man/8/dmidecode) and [ghw](https://github.com/jaypipes/ghw) go library implementing [protobuf](https://github.com/opiproject/opi-api/blob/main/common/v1/inventory.proto).
## I Want To Contribute
This project welcomes contributions and suggestions. We are happy to have the Community involved via submission of **Issues and Pull Requests** (with substantive content or even just fixes). We are hoping for the documents, test framework, etc. to become a community process with active engagement. PRs can be reviewed by by any number of people, and a maintainer may accept.
See [CONTRIBUTING](https://github.com/opiproject/opi/blob/main/CONTRIBUTING.md) and [GitHub Basic Process](https://github.com/opiproject/opi/blob/main/doc-github-rules.md) for more details.
## Getting started
build like this:
```bash
go build -v -o /opi-smbios-bridge ./cmd/...
```
import like this:
```go
import "github.com/opiproject/opi-smbios-bridge/pkg/inventory"
```
## Using docker
on DPU/IPU (i.e. with IP=10.10.10.1) run
```bash
$ docker run --rm -it -p 50051:50051 -p 8082:8082 ghcr.io/opiproject/opi-smbios-bridge:main
2024/06/13 23:07:43 gRPC Server listening at [::]:50051
2024/06/13 23:07:43 HTTP Server listening at 8082
```
on X86 management VM run
```bash
$ docker run --network=host --rm -it namely/grpc-cli ls 10.10.10.10:50051 opi_api.inventory.v1.InventorySvc -l
filename: inventory.proto
package: opi_api.inventory.v1;
service InventorySvc {
rpc GetInventory(opi_api.inventory.v1.GetInventoryRequest) returns (opi_api.inventory.v1.Inventory) {}
}
```
HTTP example using grpc gateway
```bash
curl -kL http://10.10.10.10:8082/v1/inventory/1/inventory/2
```
### Nvidia example
```bash
$ docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 GetInventory "{}"
connecting to 10.10.10.10:50051
{
"bios": {
"vendor": "https://www.mellanox.com",
"version": "BlueField:3.7.0-20-g98daf29",
"date": "Jun 26 2021"
},
"system": {
"family": "BlueField",
"name": "BlueField SoC",
"vendor": "https://www.mellanox.com",
"serialNumber": "Unspecified System Serial Number",
"uuid": "2e3bc1d1-e205-4830-a817-968ed1978bac",
"sku": "Unspecified System SKU",
"version": "1.0.0"
},
"baseboard": {
"assetTag": "Unspecified Asset Tag",
"serialNumber": "Unspecified Base Board Serial Number",
"vendor": "https://www.mellanox.com",
"version": "1.0.0",
"product": "BlueField SoC"
},
"chassis": {
"assetTag": "Unspecified Chassis Board Asset Tag",
"serialNumber": "Unspecified Chassis Board Serial Number",
"type": "1",
"typeDescription": "Other",
"vendor": "https://www.mellanox.com",
"version": "1.0.0"
},
"processor": {
"totalCores": 8,
"totalThreads": 8
},
"memory": {
"totalPhysicalBytes": "17179869184",
"totalUsableBytes": "16733876224"
},
"pci": [
{
"driver": "pcieport",
"address": "0000:00:00.0",
"vendor": "Mellanox Technologies",
"product": "MT42822 BlueField-2 SoC Crypto enabled",
"revision": "0x00",
"subsystem": "unknown",
"class": "Bridge",
"subclass": "PCI bridge"
},
{
"driver": "pcieport",
"address": "0000:01:00.0",
"vendor": "Mellanox Technologies",
"product": "MT42822 Family [BlueField-2 SoC PCIe Bridge]",
"revision": "0x00",
"subsystem": "unknown",
"class": "Bridge",
"subclass": "PCI bridge"
},
{
"driver": "pcieport",
"address": "0000:02:00.0",
"vendor": "Mellanox Technologies",
"product": "MT42822 Family [BlueField-2 SoC PCIe Bridge]",
"revision": "0x00",
"subsystem": "unknown",
"class": "Bridge",
"subclass": "PCI bridge"
},
{
"driver": "mlx5_core",
"address": "0000:03:00.0",
"vendor": "Mellanox Technologies",
"product": "MT42822 BlueField-2 integrated ConnectX-6 Dx network controller",
"revision": "0x00",
"subsystem": "unknown",
"class": "Network controller",
"subclass": "Ethernet controller"
},
{
"driver": "mlx5_core",
"address": "0000:03:00.1",
"vendor": "Mellanox Technologies",
"product": "MT42822 BlueField-2 integrated ConnectX-6 Dx network controller",
"revision": "0x00",
"subsystem": "unknown",
"class": "Network controller",
"subclass": "Ethernet controller"
}
]
}
Rpc succeeded with OK status
```
### Marvell example
Reduced output a little bit...
```bash
$ docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 11.11.11.11:50051 GetInventory "{}"
connecting to 11.11.11.11:50051
{
"bios": {
"vendor": "U-Boot",
"version": "2020.10-6.0.0",
"date": "11/29/2021"
},
"system": {
"name": "octeontx2",
"vendor": "Marvell",
"serialNumber": "CN9600-CRB-BOARD-PR3-CP-R3P1-209",
"uuid": "36394e43-3030-432d-5242-2d424f415244"
},
"baseboard": {
"vendor": "Marvell",
"product": "octeontx2"
},
"chassis": {
"type": "23",
"typeDescription": "Rack mount chassis",
"vendor": "Marvell"
},
"processor": {
"totalCores": 24,
"totalThreads": 24
},
"memory": {
"totalPhysicalBytes": "51118669824",
"totalUsableBytes": "51118669824"
},
"pci": [
{
"address": "0000:00:01.0",
"vendor": "Cavium, Inc.",
"product": "THUNDERX PCC Bridge",
"revision": "0x11",
"subsystem": "unknown",
"class": "Bridge",
"subclass": "PCI bridge"
},
{
"address": "0000:01:01.0",
"vendor": "Cavium, Inc.",
"product": "THUNDERX NCSI (Network Controller Sideband Interface)",
"revision": "0x11",
"subsystem": "unknown",
"class": "Network controller",
"subclass": "Network controller"
},
{
"driver": "thunderx_mmc",
"address": "0000:01:01.4",
"vendor": "Cavium, Inc.",
"product": "THUNDERX eMMC/SD Controller",
"revision": "0x11",
"subsystem": "unknown",
"class": "Memory controller",
"subclass": "Memory controller"
},
{
"address": "0000:01:06.1",
"vendor": "Cavium, Inc.",
"product": "unknown",
"revision": "0x11",
"subsystem": "unknown",
"class": "Memory controller",
"subclass": "Memory controller"
},
{
"address": "0000:01:08.0",
"vendor": "Cavium, Inc.",
"product": "unknown",
"revision": "0x11",
"subsystem": "unknown",
"class": "Generic system peripheral",
"subclass": "System peripheral"
},
{
"driver": "Marvell-CGX!RPM",
"address": "0000:01:10.0",
"vendor": "Cavium, Inc.",
"product": "Octeon TX2 CGX (MAC)",
"revision": "0x11",
"subsystem": "unknown",
"class": "Network controller",
"subclass": "Network controller"
},
{
"driver": "cavium_rng_pf",
"address": "0000:03:00.0",
"vendor": "Cavium, Inc.",
"product": "THUNDERX Random Number Generator",
"revision": "0x11",
"subsystem": "unknown",
"class": "Processing accelerators",
"subclass": "Processing accelerators"
},
{
"address": "0005:00:00.0",
"vendor": "Cavium, Inc.",
"product": "THUNDERX PCIERC (PCIe Root Complex)",
"revision": "0x00",
"subsystem": "unknown",
"class": "Bridge",
"subclass": "PCI bridge"
},
{
"driver": "nvme",
"address": "0005:01:00.0",
"vendor": "Samsung Electronics Co Ltd",
"product": "NVMe SSD Controller PM9A1/PM9A3/980PRO",
"revision": "0x00",
"subsystem": "unknown",
"class": "Mass storage controller",
"subclass": "Non-Volatile memory controller"
}
]
}
Rpc succeeded with OK status
```
### Intel example
Values market as ```-------------``` will be populated in future FW releases.
```bash
$ docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.0.18:50051 GetInventory "{}"
connecting to 10.10.0.18:50051
{
"bios": {
"vendor": "Intel",
"version": "Intel(R) IPU Embedded UEFI FW 0.6.7 for AArch64",
"date": "Dec 9 2022"
},
"system": {
"family": "-------------",
"name": "Intel(R) Infrastructure Processing Unit (Intel(R) IPU)",
"vendor": "Intel",
"serialNumber": "-------------",
"uuid": "8a95d198-7f46-11e5-bf8b-08002704d48e",
"sku": "-------------",
"version": "A0"
},
"baseboard": {
"assetTag": "unknown",
"serialNumber": "unknown",
"vendor": "unknown",
"version": "unknown",
"product": "unknown"
},
"chassis": {
"assetTag": "N/A",
"serialNumber": "N/A",
"type": "1",
"typeDescription": "Other",
"vendor": "Intel",
"version": "N/A"
},
"processor": {},
"memory": {
"totalPhysicalBytes": "13732470784",
"totalUsableBytes": "13732470784"
}
}
Rpc succeeded with OK status
```
### AMD example
tbd