opi-smbios-bridge

module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2023 License: Apache-2.0

README

OPI inventory gRPC to SMBIOS DMI bridge

Linters tests Docker License codecov Go Report Card Go Doc Pulls Last Release

This is a SMBIOS plugin to OPI inventory gRPC APIs based on dmidecode and ghw go library implementing protobuf.

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 and GitHub Basic Process for more details.

Getting started

build like this:

go build -v -o /opi-smbios-bridge ./cmd/...

import like this:

import "github.com/opiproject/opi-smbios-bridge/pkg/inventory"

Using docker

on DPU/IPU (i.e. with IP=10.10.10.1) run

$ docker run --rm -it -p 50051:50051 ghcr.io/opiproject/opi-smbios-bridge:main
2022/11/29 00:03:55 plugin serevr is &{{}}
2022/11/29 00:03:55 server listening at [::]:50051

on X86 management VM run

$ 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 InventoryGet(opi_api.inventory.v1.InventoryGetRequest) returns (opi_api.inventory.v1.InventoryGetResponse) {}
}

# NVIDIA example:

$ docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 10.10.10.10:50051 InventoryGet "{}"
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": "63ec430e-7620-479a-8ec5-133de3972679",
  "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": {},
 "memory": {
  "totalPhysicalBytes": "17179869184",
  "totalUsableBytes": "16733876224"
 }
}
Rpc succeeded with OK status

# MARVELL example:

docker run --network=host --rm -it namely/grpc-cli call --json_input --json_output 11.11.11.11:50051 InventoryGet "{}"
connecting to 11.11.11.11:50051
{
 "bios": {
  "vendor": "U-Boot",
  "version": "2020.10-6.0.0",
  "date": "08/25/2022"
 },
 "system": {
  "name": "cn10k",
  "vendor": "Marvell",
  "serialNumber": "CN106-A1-CRB-R1-143",
  "uuid": "30314e43-2d36-3141-2d43-52422d52312d"
 },
 "baseboard": {
  "vendor": "Marvell",
  "product": "cn10k"
 },
 "chassis": {
  "type": "23",
  "typeDescription": "Rack mount chassis",
  "vendor": "Marvell"
 },
 "processor": {},
 "memory": {
  "totalPhysicalBytes": "51099402240",
  "totalUsableBytes": "51099402240"
 }
}
Rpc succeeded with OK status

Directories

Path Synopsis
main is the main package of the application
main is the main package of the application
pkg
inventory
Package inventory is the main package of the application
Package inventory is the main package of the application

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL