You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-27Lines changed: 20 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,10 +19,11 @@ Open a terminal and start the API server:
19
19
20
20
```bash
21
21
go mod tidy
22
-
go run ./cmd/server serve
22
+
mkdir -p data
23
+
go run ./cmd/server serve --database-url="file:./data/fru-tracker.db?cache=shared&_fk=1"
23
24
```
24
25
25
-
*What is happening:* The server initializes the local file database, starts the internal event bus, and spins up the background reconciliation workers. It is now listening for requests on `http://localhost:8080`.
26
+
*What is happening*: The server initializes the local SQLite database, starts the internal event bus, and spins up the background reconciliation workers. It is now listening for requests on http://localhost:8080.
26
27
27
28
### 2. Simulate a Hardware Discovery
28
29
Open a **second** terminal. Create a file named `upload_request.json` containing a mock payload with a Node and a DIMM:
@@ -108,13 +109,12 @@ The current implementation has been validated with an end-to-end workflow using
108
109
***Two-Pass Reconciliation:**
109
110
***Pass 1 (Ingestion):** The reconciler parses the raw JSON payload and performs a get-or-create operation for each device, utilizing the `redfish_uri` from the properties map as a unique primary key.
110
111
***Pass 2 (Relationship Linking):** The reconciler evaluates the `parentSerialNumber` provided by the collector, identifies the corresponding parent device in the database, and updates the child device's `parentID` with the appropriate UUID.
111
-
***Storage Backend:** Validated using the local file storage backend for persisting resources.
112
+
***Storage Backend:** Validated using the Ent ORM backed by a local SQLite database for persisting resources.
112
113
113
114
### Future Work
114
115
115
116
While the core event-driven ingestion pipeline is functional, several enhancements are planned to make `fru-tracker` production-ready:
116
117
117
-
***Production Storage Backend:** Migrate testing and deployment documentation from the local `file` storage backend to a robust relational database (e.g., SMD using Fabrica's `ent` backend option).
118
118
***Hardware Removal Handling:** Enhance the `DiscoverySnapshotReconciler` to detect missing components. If a previously tracked child device is absent from a new snapshot, the reconciler should update the existing `Device` record to mark it as removed, offline, or inactive.
119
119
***Event Delta Consumer:** Build a reference implementation of an event subscriber. This service will listen to the message bus for `fru-tracker.resource.device.updated` and `deleted` events to generate human-readable changelogs and trigger alerts.
120
120
***Collector Enhancements:** * Expand the reference Redfish collector to support additional component types (e.g., Drives, PowerSupplies, NetworkAdapters).
@@ -171,9 +171,10 @@ The server runs the API endpoints and the background reconciliation controller.
171
171
```bash
172
172
# Install dependencies
173
173
go mod tidy
174
+
mkdir -p data
174
175
175
176
# Run the server (using the 'serve' command for cobra)
176
-
go run ./cmd/server serve
177
+
go run ./cmd/server serve --database-url="file:./data/fru-tracker.db?cache=shared&_fk=1"
177
178
```
178
179
179
180
The server will start on `http://localhost:8080`.
@@ -214,31 +215,23 @@ Inventory collection and posting completed successfully.
214
215
The server logs show the generated handler receiving the post, the event bus dispatching the event, and the `DiscoverySnapshotReconciler` executing the two-pass logic.
215
216
216
217
```bash
217
-
$ go run ./cmd/server serve
218
+
$ go run ./cmd/server serve --database-url="file:./data/fru-tracker.db?cache=shared&_fk=1"
218
219
...
219
-
[INFO] Reconciliation controller started with 5 workers
0 commit comments