docs(client): add architecture document#5938
Conversation
6b211a3 to
67232e4
Compare
|
@eriknordmark This PR is marked as ready for review&merge, but at the same time it depends on some refactoring PRs, which are still in the draft state. What is your plan with all the draft PRs that you opened recently? |
|
Claude finished @rene's task in 2m 20s —— View job Review:
|
|
@milan-zededa Thanks for the nudge. The plan: #5954 has already merged, and I've now taken the remaining refactoring PRs in this series out of draft and requested reviewers — #5956 (seams), #5957 (pure-Go unit tests), and #5958 (seamed unit tests). They should merge in that order, and this doc PR lands last since section "Forcing transitions" references the test seams added by #5956/#5958 (that's the forward reference @claude flagged above). So nothing here is blocked on draft state anymore — the whole chain is ready for review now. |
|
Claude finished @eriknordmark's task in 28s —— View job Re: merge ordering & the "Forcing transitions" forward referenceThanks for the clarification, @eriknordmark — that resolves my finding #2. With #5954 merged and #5956/#5957/#5958 out of draft and ordered ahead of this doc PR, the Two of my earlier findings are independent of the refactor chain and can be fixed on this branch right now regardless of ordering:
Happy to push those two doc corrections to this branch if you'd like — just say the word. Everything else in the doc verified correctly. |
67232e4 to
ccd9232
Compare
ccd9232 to
701e018
Compare
|
Claude finished @eriknordmark's task in 2m 5s —— View job Re-review:
|
| * cached DNS resolutions | ||
| * `CachedResolvedIPs` from `nim` | ||
| * read indirectly through `controllerconn.Client` to short-circuit | ||
| DNS lookups for the controller hostname. |
There was a problem hiding this comment.
CachedResolvedIPs does not exist in the tree — not in cmd/client/ and not anywhere in pkg/pillar (grep -rn CachedResolvedIPs --include=*.go returns nothing). client.go creates exactly two subscriptions (ConfigItemValueMap from zedagent, DeviceNetworkStatus from nim); there is no CachedResolvedIPs subscription and controllerconn.Client is not fed one here. This looks like the same class of forward/phantom reference that was flagged and fixed earlier for the test-seam paragraph. Please drop this input (and its mention in the Control-flow block at line 199) or gate the merge until whatever introduces it actually lands.
There was a problem hiding this comment.
Fixed in 042a07f. Confirmed CachedResolvedIPs exists nowhere in pkg/pillar (grep -rn CachedResolvedIPs --include=*.go returns nothing) and client.go creates exactly two subscriptions (ConfigItemValueMap from zedagent, DeviceNetworkStatus from nim). Dropped the input bullet, its line in the control-flow subscribe step, and its mention in the event-loop pseudocode (line ~209).
| * evalmgr onboarding gate | ||
| * `EvalStatus` from `evalmgr` (synchronous via | ||
| `wait.ForEvalStatus`) | ||
| * `Run()` blocks until evalmgr publishes a status whose | ||
| `IsOnboardingAllowed()` is true; this is where image-evaluation / | ||
| policy holds the device back from contacting the controller. |
There was a problem hiding this comment.
This "evalmgr onboarding gate" is not real on this branch. There is no evalmgr agent (cmd/ has no evalmgr), no EvalStatus type anywhere in pkg/pillar, and no wait.ForEvalStatus (grep -rn "ForEvalStatus\|EvalStatus" --include=*.go returns nothing). Run() does not block on any onboarding gate — after wiring the two subscriptions it goes straight to building controllerconn.NewClient(...) and the retry loop (client.go:186-263). This is a substantive behavioral claim about the boot path that doesn't match the code; it also reappears in the Control-flow pseudocode (wait.ForEvalStatus(), line 200). Please remove it or hold the merge until the agent/type/helper it describes exists in-tree.
There was a problem hiding this comment.
Fixed in 042a07f. Confirmed there is no evalmgr agent, no EvalStatus type, and no wait.ForEvalStatus anywhere in pkg/pillar, and Run() proceeds straight from wiring the two subscriptions to controllerconn.NewClient(...) and the retry loop (client.go:186-263) with no onboarding gate. Removed the input bullet, the wait.ForEvalStatus() line in the control-flow pseudocode, and the "waits for EvalStatus" phrase in the client.go summary.
701e018 to
042a07f
Compare
Documents the zedclient onboarding microservice: responsibilities and its place in pillar (one-shot binary, distinct from the long-running zedbox group), the controller endpoints used (/certs, /register, /uuid) and the LED-state mapping per HTTP status, pubsub inputs (ConfigItemValueMap, DeviceNetworkStatus, CachedResolvedIPs, and the synchronous EvalStatus gate) and outputs (OnboardingStatus, MetricsMap), persistent artifacts under /persist/, the single retry-loop control flow including the SenderStatusCertMiss re-fetch trigger, a dedicated section on the 5-second already-onboarded fast path (pre-conditions, silent behavior, and how to disable it), and a debugging section with the pubsub paths, log grep patterns, a connectivity smoke check, and how each control-flow branch is exercised in development. Structure mirrors nim.md, nodeagent.md, and baseosmgr.md so the pillar docs stay consistent across microservices. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
042a07f to
d9f540f
Compare
Description
I've read this architecture document and asked claude to fix and add a few things. Ready for broader review and merge.
Adds
pkg/pillar/docs/client.mddescribing thezedclientonboardingmicroservice. The document covers:
zedclientdiffers from the rest of pillar(one-shot binary, not part of
zedboxlong-running group);/certs,/register,/uuid) and thedevice-side LED-state mapping per HTTP status code;
ConfigItemValueMap,DeviceNetworkStatus,CachedResolvedIPs, the synchronousEvalStatusgate) and outputs(
OnboardingStatus,MetricsMap);/persist/(status/uuid,status/hardwaremodel,checkpoint/controllercerts);already-onboarded fast path and the
SenderStatusCertMissre-fetchtrigger;
each path during development.
The document is structured to mirror the existing
nim.md,nodeagent.mdandbaseosmgr.mdso the pillar docs remain consistentacross microservices and can serve both as developer-onboarding
material and as a basis for functional test coverage.
Dependencies
The doc describes the post-refactor cmd/client; it should land after
the following PRs in this order:
How to test and validate this PR
Docs-only change. Read
pkg/pillar/docs/client.md; verify it matchesthe behaviour in
pkg/pillar/cmd/client/{client.go,parseuuid.go}andthe boot-time invocation in
pkg/pillar/scripts/device-steps.sh.Changelog notes
No user-facing changes.
PR Backports
Checklist