joelrebel
Repos
73
Followers
35
Following
112

Library to interact with bmcs from different vendors

130
21

Vendor neutral hardware in-band library

0
0

A LDAP proxy to authenticate BMCs

15
2

Server inventory collector

1
1

Events

started
Created at 4 hours ago
pull request opened
Supermicro redfish inventory support

What does this PR implement/change/remove?

Updates the Redfish provider inventory collection to work on Supermicro hardware,

Sample output https://gist.github.com/2633a7068ddd72ab837f6e6302da0605

Checklist

  • [ ] Tests added
  • [X ] Similar commits squashed

The HW vendor this change applies to (if applicable)

Supermicro

The HW model number, product name this change applies to (if applicable)

Should work with all SMC hardware, tested on hardware variants,

SYS-5019C-MR 6029P-E1CR12L SYS-510T-MR

Description for changelog/release notes

Redfish inventory support for Supermicro hardware.
Created at 17 hours ago
create branch
joelrebel create branch redfish-smc
Created at 17 hours ago

api/v1/requests: Adds json Unmarshal test case for Client.do

Created at 1 day ago
README: add notes on crdb client requirement

The crdb client is required for running tests and setting up a local docker instance, add a note that helps new users.

cc: Mark Hahn

Created at 2 days ago
joelrebel create branch docs-fix
Created at 2 days ago
Switch to json.Unmarshal instead of json.Decoder.Decode()

This is replaced for a few reasons,

  • The JSON stream decoder blocks forever if the server stops sending data midway in the body, see goroutine dump below [0].

  • Switching this to the json.Marshal surfaced issues in implementations where multiple JSON blocks were being returned in the response to the client, e.g: {"foo": "bar"}{"foo": "baz"} they are not caught in tests because json.Decoder.Decode doesn't have a problem with those.

  • As of now this service does not stream JSON and if the need arises, the implementation could be switched back to the json.Decoder along with a for, select loop on the request context.

[0]. Goroutine hung on json.(*Decoder).Decode

1 @ 0x43b196 0x44abf2 0x6bf129 0x6be71e 0x46ba21
   0x6bf128    net/http.(*http2clientStream).writeRequest+0x9c8
   /opt/hostedtoolcache/go/1.18.5/x64/src/net/http/h2_bundle.go:8037
   0x6be71d    net/http.(*http2clientStream).doRequest+0x1d
   /opt/hostedtoolcache/go/1.18.5/x64/src/net/http/h2_bundle.go:7899

1 @ 0x43b196 0x467afd 0x467add 0x48024c 0x6a9aab 0x6c5be5 0x56ee5f 0x56ea5b
0x56e798 0xb627dc 0xb60de7 0xb64065 0xcd3f85 0xcd30dc 0xcd2ba5 0xd128fe
0x46ba21
   0x467adc    sync.runtime_notifyListWait+0x11c
   /opt/hostedtoolcache/go/1.18.5/x64/src/runtime/sema.go:513
   0x48024b    sync.(*Cond).Wait+0x8b
   /opt/hostedtoolcache/go/1.18.5/x64/src/sync/cond.go:56
   0x6a9aaa    net/http.(*http2pipe).Read+0xea
   /opt/hostedtoolcache/go/1.18.5/x64/src/net/http/h2_bundle.go:3663
   0x6c5be4    net/http.http2transportResponseBody.Read+0x84
   /opt/hostedtoolcache/go/1.18.5/x64/src/net/http/h2_bundle.go:9098
   0x56ee5e    encoding/json.(*Decoder).refill+0x17e
   /opt/hostedtoolcache/go/1.18.5/x64/src/encoding/json/stream.go:165
   0x56ea5a    encoding/json.(*Decoder).readValue+0xba
   /opt/hostedtoolcache/go/1.18.5/x64/src/encoding/json/stream.go:140
   0x56e797    encoding/json.(*Decoder).Decode+0x77
   /opt/hostedtoolcache/go/1.18.5/x64/src/encoding/json/stream.go:63
Created at 2 days ago

api/v1/requests: use plain json.Unmarshal instead of json.Decode

This is replaced for a few reasons,

  • The JSON stream decoder blocks forever if the server stops sending data midway in the body, see goroutine dump below [0].

  • Switching this to the json.Marshal surfaced issues in implementations where multiple JSON blocks were being returned in the response to the client, e.g: {"foo": "bar"}{"foo": "baz"} they are not caught in tests because json.Decoder.Decode doesn't have a problem with those.

  • As of now this service does not stream JSON and if the need arises, the implementation could be switched back to the json.Decoder along with a for, select loop on the request context.

[0]. Goroutine hung on json.(*Decoder).Decode

1 @ 0x43b196 0x44abf2 0x6bf129 0x6be71e 0x46ba21
   0x6bf128    net/http.(*http2clientStream).writeRequest+0x9c8
   /opt/hostedtoolcache/go/1.18.5/x64/src/net/http/h2_bundle.go:8037
   0x6be71d    net/http.(*http2clientStream).doRequest+0x1d
   /opt/hostedtoolcache/go/1.18.5/x64/src/net/http/h2_bundle.go:7899

1 @ 0x43b196 0x467afd 0x467add 0x48024c 0x6a9aab 0x6c5be5 0x56ee5f 0x56ea5b
0x56e798 0xb627dc 0xb60de7 0xb64065 0xcd3f85 0xcd30dc 0xcd2ba5 0xd128fe
0x46ba21
   0x467adc    sync.runtime_notifyListWait+0x11c
   /opt/hostedtoolcache/go/1.18.5/x64/src/runtime/sema.go:513
   0x48024b    sync.(*Cond).Wait+0x8b
   /opt/hostedtoolcache/go/1.18.5/x64/src/sync/cond.go:56
   0x6a9aaa    net/http.(*http2pipe).Read+0xea
   /opt/hostedtoolcache/go/1.18.5/x64/src/net/http/h2_bundle.go:3663
   0x6c5be4    net/http.http2transportResponseBody.Read+0x84
   /opt/hostedtoolcache/go/1.18.5/x64/src/net/http/h2_bundle.go:9098
   0x56ee5e    encoding/json.(*Decoder).refill+0x17e
   /opt/hostedtoolcache/go/1.18.5/x64/src/encoding/json/stream.go:165
   0x56ea5a    encoding/json.(*Decoder).readValue+0xba
   /opt/hostedtoolcache/go/1.18.5/x64/src/encoding/json/stream.go:140
   0x56e797    encoding/json.(*Decoder).Decode+0x77
   /opt/hostedtoolcache/go/1.18.5/x64/src/encoding/json/stream.go:63

loadServerFromParams(): expect caller to set JSON response

In order to reduce ambiguity in who writes the response body, this method now just returns an error if any. and leaves it to the caller to write the response based on the error.

Earlier this method was writing a JSON response to the body, which led to multiple situations where the JSON response was written again by the caller. And so invalid JSON being sent in the JSON body.

Created at 2 days ago
joelrebel create branch json-response
Created at 2 days ago
Created at 3 days ago
Created at 3 days ago

internal/redfishwrapper: Add redfishwrapper client and methods

This moves the redfish client wrapping outside of the providers/redfish package, these methods always check the redfish session is valid before calling into the wrapped redfish library - gofish.

By moving this out, other providers can also import the redfishwrapper.

providers/redfish: use internal/redfishwrapper for redfish calls

The redfishwrapper validates the redfish session is active before any calling into the redfish methods. The rest of changes tries to prevents direct interaction with the gofish library methods although the gofish objects are accessed as is.

misc: lint and remove deprecated ioutil method calls

redfish: use consistent case in method name

Merge pull request #296 from bmc-toolbox/redfish-refactor

Redfish refactor

Created at 5 days ago

api/v1: Adds component deletion endpoint and client implementation (#166)

Created at 5 days ago

api/v1: Adds component deletion endpoint and client implementation (#166)

Created at 6 days ago
api/v1: Adds component deletion endpoint and client implementation

To support deleting server components.

Created at 6 days ago
api/v1: Adds component deletion endpoint and client implementation

rebased on main

Created at 6 days ago

router_responses: return status 400 on duplicate key error (#165)

Instead of returning all db errors as 500, return 400s so that the client can differentiate between a server error and a invalid request.

https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1

This prevents clients retrying when the db error not a server side problem.

fix(deps): update module github.com/spf13/viper to v1.14.0 (#161)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

chore(deps): update alpine docker tag to v3.17.0 (#164)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

chore(deps): update anothrnick/github-tag-action action to v1.52.0 (#151)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

fix(deps): update module gocloud.dev to v0.27.0 (#152)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

chore(deps): update jaegertracing/all-in-one docker tag to v1.39.0 (#154)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

chore(deps): update anchore/sbom-action action to v0.13.1 (#160)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

fix(deps): update module github.com/cockroachdb/cockroach-go/v2 to v2.2.19 (#163)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

fix(deps): update module github.com/gosimple/slug to v1.13.1 (#153)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Update go version for scanning (#168)

fix(deps): update module go.uber.org/zap to v1.24.0 (#169)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

chore(db/tracing): Switch to infratographer/x for tracing/db config (#170)

Signed-off-by: Nicole Renée Hubbard code@nicole.dev

Signed-off-by: Nicole Renée Hubbard code@nicole.dev

bug: api/v1/server_list_params: fixes incorrect record count (#171)

The sqlboiler SQL query builder seems to drop 'distinct' within COUNT() when defined as qm.Select("servers."), this works when using qm.Distinct("servers.") instead.

api/v1: Adds component deletion endpoint and client implementation

Created at 6 days ago

chore(db/tracing): Switch to infratographer/x for tracing/db config (#170)

Signed-off-by: Nicole Renée Hubbard code@nicole.dev

Signed-off-by: Nicole Renée Hubbard code@nicole.dev

bug: api/v1/server_list_params: fixes incorrect record count (#171)

The sqlboiler SQL query builder seems to drop 'distinct' within COUNT() when defined as qm.Select("servers."), this works when using qm.Distinct("servers.") instead.

Created at 6 days ago
api/v1/server_list_params: fixes incorrect record count

The sqlboiler SQL query builder seems to drop 'distinct' from count() when defined as qm.Select("servers.*"), this works when using qm.Distinct("servers.*") instead.

Created at 6 days ago
api/v1: Adds component deletion endpoint and client implementation

@JAORMX I'll need an approve from you here, the component soft deletes will be added through in a separate PR.

Created at 6 days ago
joelrebel create branch servers-distinct
Created at 6 days ago

router_responses: return status 400 on duplicate key error (#165)

Instead of returning all db errors as 500, return 400s so that the client can differentiate between a server error and a invalid request.

https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1

This prevents clients retrying when the db error not a server side problem.

fix(deps): update module github.com/spf13/viper to v1.14.0 (#161)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

chore(deps): update alpine docker tag to v3.17.0 (#164)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

chore(deps): update anothrnick/github-tag-action action to v1.52.0 (#151)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

fix(deps): update module gocloud.dev to v0.27.0 (#152)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

chore(deps): update jaegertracing/all-in-one docker tag to v1.39.0 (#154)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

chore(deps): update anchore/sbom-action action to v0.13.1 (#160)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

fix(deps): update module github.com/cockroachdb/cockroach-go/v2 to v2.2.19 (#163)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

fix(deps): update module github.com/gosimple/slug to v1.13.1 (#153)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Update go version for scanning (#168)

fix(deps): update module go.uber.org/zap to v1.24.0 (#169)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Created at 6 days ago
issue comment
Redfish refactor

@chrisdoherty4 good to go now.

Created at 1 week ago

Fix mergify

Signed-off-by: Jacob Weinstock jakobweinstock@gmail.com

Merge pull request #298 from jacobweinstock/fix-mergify

Fix mergify

internal/redfishwrapper: Add redfishwrapper client and methods

This moves the redfish client wrapping outside of the providers/redfish package, these methods always check the redfish session is valid before calling into the wrapped redfish library - gofish.

By moving this out, other providers can also import the redfishwrapper.

providers/redfish: use internal/redfishwrapper for redfish calls

The redfishwrapper validates the redfish session is active before any calling into the redfish methods. The rest of changes tries to prevents direct interaction with the gofish library methods although the gofish objects are accessed as is.

misc: lint and remove deprecated ioutil method calls

redfish: use consistent case in method name

Created at 1 week ago
create tag
joelrebel create tag v0.1.1
Created at 1 week ago
api/v1: Adds component deletion endpoint and client implementation

It's not actually clear to me if this is doing a straight up delete (which is what I think it's doing). Or if we have already some soft-delete logic implemented. @nicolerenee @joelrebel what's your take on enforcing soft-delete logic here? I'd say it would be preferrable.

Thats makes sense, thanks for pointing it out. It requires a small schema change https://github.com/volatiletech/sqlboiler#automatic-deletedat-soft-delete . I'd be happy to PR that separately, since it would require its own tests.

I'm now thinking it would be worth adding soft deletes for the firmware, firmware sets data as well.

Created at 1 week ago
joelrebel create tag v0.2.2
Created at 1 week ago

actions; define Utils attribute getter interface and inherit in configurors, collectors, updaters.

This interface defines a method to retrieve the utility attributes like the name, absolute path and an error if it was not found on the host system.

utils: define environment variable override for all utilities

This allows consumers of the library to define env vars for all utilities supported by ironlib.

utils/executor: extend interface with methods CmdPath(), CheckExecutable()

These methods return the utility command absolute path and checks if the bin is available and executable.

utils: implement the UtilAttributeGetter interface

The Attributes() method returns the utility name, absolute path and check if the executable is available for execution.

device.go: CheckDependencies() initializes validates dependency utils

It prints output in the form

  util: dmidecode, path: /sbin/dmidecode [ok]
  util: asrr-bioscontrol, path: /usr/sbin/asrr-bioscontrol [ok]
  util: dell-racadm, path: /opt/dell/srvadmin/bin/idracadm7 [err] - lstat /opt/dell/srvadmin/bin/idracadm7: no such file or directory: failed to run lstat on bin
  util: dnf, path: /usr/bin/microdnf [ok]
  util: dsu, path: dsu [err] - exec: "dsu": executable file not found in $PATH: failed to lookup bin path
  util: hdparm, path: /usr/sbin/hdparm [ok]
  util: lshw, path: /usr/sbin/lshw [ok]
  util: lsblk, path: /usr/bin/lsblk [ok]
  util: mlxup, path: /usr/sbin/mlxup [ok]
  util: msecli, path: /usr/bin/msecli [ok]
  util: mvcli, path: mvcli [err] - exec: "mvcli": executable file not found in $PATH: failed to lookup bin path
  util: nvme, path: /usr/sbin/nvme [ok]
  util: smartctl, path: /usr/sbin/smartctl [ok]
  util: smc-ipmicfg, path: /usr/sbin/smc-ipmicfg [ok]
  util: smc-sum, path: /usr/sbin/sum [ok]
  util: storecli, path: /opt/MegaRAID/storcli/storcli64 [ok]

docs, sample: add notes, snippet to check ironlib util deps

go: update go to 1.19, update deps

prefix env variable names with IRONLIB_

Created at 1 week ago