-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Boris Glimcher <36732377+glimchb@users.noreply.github.com>
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,59 @@ | ||
# OPI Inventory APIs | ||
|
||
## Demos | ||
|
||
None | ||
|
||
## Clients | ||
|
||
see <https://github.com/opiproject/pydpu> and <https://github.com/opiproject/godpu> | ||
|
||
## Reference implementations | ||
|
||
- <https://github.com/opiproject/opi-smbios-bridge> | ||
|
||
_All implementations above are reference only and __not__ meant to be used as-is in production_ | ||
|
||
## More documentation | ||
|
||
see <https://github.com/opiproject/opi-prov-life/tree/main/inventory> | ||
|
||
## Implementation | ||
|
||
Compile it as: | ||
|
||
```bash | ||
docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/v1":/common namely/protoc-all:1.51_2 -i /common --lint -d v1 -l go -o ./v1/gen/go/ --go-source-relative | ||
``` | ||
|
||
Linter it as: | ||
|
||
```bash | ||
docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/v1":/common -v "${PWD}"/v1/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.57.0 -c "api-linter -I /common /out/*.proto --output-format github --set-exit-status" | ||
``` | ||
|
||
Additional linter: | ||
|
||
```bash | ||
docker run --rm -it -v /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem:/etc/ssl/certs/ca-certificates.crt -v "$(pwd):/workspace" -w /workspace bufbuild/buf lint | ||
``` | ||
|
||
Generate [docs](v1/autogen.md) as: | ||
|
||
```bash | ||
docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/v1":/common -v "${PWD}"/v1alpha1/:/out -w /out -v "${PWD}"/v1:/protos pseudomuto/protoc-gen-doc:1.5.1 -c "protoc -I /common -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto /common/*.proto" | ||
``` | ||
|
||
Test your APIs even if unmerged using your private fork like this: | ||
|
||
```bash | ||
chmod a+w go.* | ||
docker run --rm -it -v `pwd`:/app -w /app golang:alpine go mod edit -replace github.com/opiproject/opi-api@main=github.com/YOURUSERNAME/opi-api@main | ||
docker run --rm -it -e GO111MODULE=on -v `pwd`:/app -w /app golang:alpine go get -u github.com/YOURUSERNAME/opi-api/inventory/v1/gen/go@a98ca449468a | ||
``` | ||
|
||
## Documentation for reference of other specs | ||
|
||
- <https://www.dmtf.org/standards/smbios> | ||
- <https://linux.die.net/man/8/dmidecode> | ||
- <https://github.com/jaypipes/ghw> |