Redfish OEM Extension for SONiC BMC with Schema Mapping to Redis & D-Bus#3
Open
chinmoy-nexthop wants to merge 3 commits into
Open
Redfish OEM Extension for SONiC BMC with Schema Mapping to Redis & D-Bus#3chinmoy-nexthop wants to merge 3 commits into
chinmoy-nexthop wants to merge 3 commits into
Conversation
|
/azp run |
|
No pipelines are associated with this pull request. |
Signed-off-by: Chinmoy Dey <chinmoy@nexthop.ai>
Signed-off-by: Chinmoy Dey <chinmoy@nexthop.ai>
ba7f04b to
efd6cc8
Compare
|
/azp run |
|
No pipelines are associated with this pull request. |
| "additionalProperties": false, | ||
| "description": "Request body for SONiC.SubmitTelemetry action.", | ||
| "properties": { | ||
| "Alarms": { |
There was a problem hiding this comment.
May be good to generalize this name so that it is clear that both alarm and telemetry data are contained
efd6cc8 to
ce080d2
Compare
|
/azp run |
|
No pipelines are associated with this pull request. |
Map OEM rack manager alerts/telemetry to Redis via sonic-dbus-bridge
What:
- Extend the OEM Sonic Manager schema so SONiC.SubmitAlert and SONiC.SubmitTelemetry carry structured, extensible payloads:
- SubmitAlert now accepts a redfish_alert_data object keyed by alert type (FlowRateDeviation, LeakDetected, etc.), each with its own fields plus Severity and RscmPosition.
- SubmitTelemetry now accepts an Alarms object containing sensor status flags, deviation sub-objects, leak detection, and general parameters.
- Update OEM bmcweb actions (SONiC.SubmitAlert / SONiC.SubmitTelemetry) to validate the new JSON shapes and forward the raw JSON to sonic-dbus-bridge over D-Bus instead of parsing individual fields.
- Add a RackManagerReceiver component and declarative field-mapping tables in sonic-dbus-bridge to map OEM JSON into Redis STATE_DB keys/fields.
- Refine Makefile clean/reset targets and Docker build flow for the OEM branch to ensure a fully reproducible workspace.
Why:
- Provide a flexible OEM schema for rack manager alerts and telemetry that can evolve without changing core bmcweb or bridge logic.
- Centralize the JSON→Redis mapping in sonic-dbus-bridge so bmcweb remains a thin HTTP/D-Bus adapter and internal field names are defined in one place.
- Persist rack manager data in STATE_DB in a structured way (RSCM_TELEMETRY|alarms, RSCM_ALERT|<AlertType> hashes) for later consumption by monitoring, analytics, or policy components.
- Make OEM builds more reliable by cleaning all Docker images, build artifacts, and cloned bmcweb state between runs.
How:
- oem-extension schema:
- Change `SonicManager.v1_0_0.json`:
- SubmitAlert:
- Replace flat `AlertType` / `Severity` / `Message` body with `redfish_alert_data` (object, additionalProperties = AlertEntry).
- Introduce `AlertEntry` definition with required `Severity` and `RscmPosition`, allowing additional per-alert-type fields.
- SubmitTelemetry:
- Replace individual scalar fields (InletLiquidTemperatureCelsius, FlowRate, Pressure, LeakDetected) with an `Alarms` object.
- Add nested structures for InletTempDeviation, FlowRateDeviation, LiquidPressureDeviation, LeakDetected, plus status flags and general parameters.
- bmcweb OEM actions:
- `sonic_submit_alert.hpp`:
- Drop json_utils-based field extraction.
- Parse the request body as JSON, require `redfish_alert_data`, and log payload size.
- Forward the raw JSON string via D-Bus to `xyz.openbmc_project.Inventory.Manager` at `/xyz/openbmc_project/sonic/rack_manager`, interface `com.sonic.RackManager`, method `SubmitAlert`.
- `sonic_submit_telemetry.hpp`:
- Similarly replace per-field parsing with JSON validation, require `Alarms`, and forward the full JSON to `SubmitTelemetry` on the same D-Bus interface.
- sonic-dbus-bridge:
- Introduce `FieldType` and `FieldMapping` plus mapping tables in `field_mapping.hpp`:
- `getTelemetryMappings()` maps JSON paths under `Alarms.*` to fields in `RSCM_TELEMETRY|alarms`.
- `getAlertMappings()` maps JSON paths under `redfish_alert_data.*` to fields in `RSCM_ALERT|<AlertType>` hashes.
- Add `RackManagerReceiver` (`rack_manager_receiver.hpp/.cpp`):
- Register D-Bus interface `com.sonic.RackManager` at `/xyz/openbmc_project/sonic/rack_manager`.
- Implement `SubmitAlert(s json) -> b` and `SubmitTelemetry(s json) -> b` methods.
- Parse JSON using jsoncpp, resolve dot-separated JSON paths, serialise values by type, and issue HSET calls into Redis STATE_DB (DB index 6).
- Wire receiver into the bridge:
- Include `rack_manager_receiver.hpp` in `bridge_app.hpp` and create `rackManagerReceiver_` member.
- In `BridgeApp::initialize()`, construct and initialize the receiver, and register the rack manager object with the ObjectMapper when successful.
- Add `src/rack_manager_receiver.cpp` to `meson.build` sources.
Signed-off-by: Chinmoy Dey <chinmoy@nexthop.ai>
ce080d2 to
0fd6089
Compare
|
/azp run |
|
No pipelines are associated with this pull request. |
| {"redfish_alert_data.LiquidPressureDeviation.Severity", "RSCM_ALERT|LiquidPressureDeviation", "severity", FieldType::String}, | ||
| {"redfish_alert_data.LiquidPressureDeviation.RscmPosition", "RSCM_ALERT|LiquidPressureDeviation", "rscm_position", FieldType::Integer}, | ||
|
|
||
| // --- InletTemperatureDeviation --- |
There was a problem hiding this comment.
InletTempDeviation would match JSON
|
|
||
| LOG_INFO("RackManagerReceiver: Stored %d fields (%d skipped / %zu total)", | ||
| stored, skipped, mappings.size()); | ||
| return stored > 0; |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Map OEM rack manager alerts/telemetry to Redis via sonic-dbus-bridge
What:
Why:
How: