feat: Expose last seen scout version for a machine#2037
Conversation
Track and surface the scout version reported during host registration, persisting it via a new last_seen_scout_version column and exposing it through the machine API. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Eric Wetzel <ewetzel@nvidia.com>
# Conflicts: # crates/rpc/proto/forge.proto
| pub controller_state: ManagedHostState, | ||
| pub last_discovery_time: Option<DateTime<Utc>>, | ||
| pub last_scout_contact_time: Option<DateTime<Utc>>, | ||
| pub last_seen_scout_version: Option<String>, |
There was a problem hiding this comment.
super nit but since we have last_scout_contact_time, maybe your new variable can be last_scout_observed_version? (as in keep the last_scout_* prefix going?)
| } | ||
| bool create_machine = 3; | ||
| MachineDiscoveryReporter discovery_reporter = 4; | ||
| optional string reporter_version = 5; |
There was a problem hiding this comment.
another super nit: discovery_reporter and discovery_reporter_version
| ) | ||
| .await?; | ||
| } | ||
| } |
There was a problem hiding this comment.
i would turn this into a match on discovery_reporter, with match arms for each variant. ::Scout would obviously be this branch, ::Unspecified would log a warning, and ::DpuAgent would do...oh.. umm... something? i dont see DpuAgent really being used here at all?
i mean all said, i like the idea of reporting the scout version! just a couple of questions!
There was a problem hiding this comment.
Yeah... the API handler doesn't do anything with the version when it gets a DpuAgent reporter. From what I understand, dpu-agent's version is already reported in the machine inventory so it would be redundant to persist it here. I just decided to include it like this for the sake of consistency. scout and dpu-agent both go through this same code path and it felt awkward to try to separate the handler just for this change.
- Rename last_seen_scout_version -> last_scout_observed_version to keep the last_scout_* prefix consistent with last_scout_contact_time - Rename proto field reporter_version -> discovery_reporter_version for consistency with discovery_reporter - Collapse nested if in discover_machine handler (clippy::collapsible_if) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Eric Wetzel <ewetzel@nvidia.com>
Fixes check-format-nightly: import grouping, .await placement, and trailing whitespace in the machine discovery handler and tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Eric Wetzel <ewetzel@nvidia.com>
Description
When a machine is discovered with forge-scout, the version of forge-scout that was booted is currently not saved anywhere and can be lost. This PR has forge-scout report its version
carbide_version::v!(build_version)to the API on machine discovery and persist it in the machines table aslast_seen_scout_version(overwritten when re-discovered). For existing machines, this will reportnulluntil next discovery.Note that dpu-agent also performs discovery and will report its version for consistency, but unlike forge-scout, the API currently won't do anything with it because dpu-agent's current running version is already reported elsewhere and is frequently updated.
Type of Change
Related Issues (Optional)
Closes #1614
Breaking Changes
Testing
Additional Notes