Skip to content

chore: add readme for agent local db to be persistent#232

Merged
ambermingxin merged 1 commit into
mainfrom
chore/add-readme-for-local-db
Jul 20, 2026
Merged

chore: add readme for agent local db to be persistent#232
ambermingxin merged 1 commit into
mainfrom
chore/add-readme-for-local-db

Conversation

@ambermingxin

@ambermingxin ambermingxin commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Description

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Summary by CodeRabbit

  • Documentation
    • Added guidance on persistent local storage for agent identity, enrollment metadata, and retained metrics or events.
    • Documented the risks of deleting or replacing the state directory, including loss of enrollment credentials.
    • Added deployment and access-control recommendations for custom images, installers, and containers.

Signed-off-by: Amber Xue <ambermingxin@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Persistent local state

Layer / File(s) Summary
Persistent state guidance
README.md
Documents the default state directory, retained identity, enrollment, metrics, and event data, required persistence across lifecycle events, deletion consequences, deployment guidance, and access restrictions.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: jingxiang-z

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the change: it documents making the agent's local database/state persistent in the README.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/add-readme-for-local-db

Comment @coderabbitai help to get the list of available commands.

@ambermingxin
ambermingxin merged commit 5e385d2 into main Jul 20, 2026
5 of 6 checks passed
@ambermingxin
ambermingxin deleted the chore/add-readme-for-local-db branch July 20, 2026 20:42

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 26-29: Update the README state-storage documentation to describe
the non-root fallback path `$HOME/.fleetint/fleetint.state` when the agent
cannot use `/var/lib`. State that this directory, like `/var/lib/fleetint`, must
use persistent local storage across restarts, reboots, upgrades, and reinstalls.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: bb16a819-324a-42a9-9c97-e8aee6a9904f

📥 Commits

Reviewing files that changed from the base of the PR and between b7e7093 and 2c54546.

📒 Files selected for processing (1)
  • README.md

Comment thread README.md
Comment on lines +26 to +29
The agent stores its node identity, enrollment metadata, and retained metrics and
events in `/var/lib/fleetint/fleetint.state` by default. The
`/var/lib/fleetint` directory must use persistent local storage that survives
agent and host restarts, reboots, upgrades, and reinstalls.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Document the non-root default state path.

internal/config/default.go:120-175 falls back to $HOME/.fleetint/fleetint.state when the agent is not running as root or /var/lib is unavailable. As written, operators may persist the wrong directory and lose identity/credentials across restarts or redeployments.

Proposed wording
-The agent stores its node identity, enrollment metadata, and retained metrics and
-events in `/var/lib/fleetint/fleetint.state` by default.
+When running as root with `/var/lib` available, the agent stores its node
+identity, enrollment metadata, and retained metrics and events in
+`/var/lib/fleetint/fleetint.state`. Otherwise, the default is
+`$HOME/.fleetint/fleetint.state`. Persist the path selected for the deployment.

Also applies to: 34-35

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 26 - 29, Update the README state-storage
documentation to describe the non-root fallback path
`$HOME/.fleetint/fleetint.state` when the agent cannot use `/var/lib`. State
that this directory, like `/var/lib/fleetint`, must use persistent local storage
across restarts, reboots, upgrades, and reinstalls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants