Skip to content

Report updater info in Hello#53938

Merged
hugoShaka merged 4 commits intomasterfrom
hugo/telpeort-reports-updater-status
Apr 23, 2025
Merged

Report updater info in Hello#53938
hugoShaka merged 4 commits intomasterfrom
hugo/telpeort-reports-updater-status

Conversation

@hugoShaka
Copy link
Copy Markdown
Contributor

@hugoShaka hugoShaka commented Apr 10, 2025

Second PR to add agent update tracking. This PR makes the teleport process report the updater status in the inventory hello message using the fields introduced in #53911

This does not report the UpdaterID yet because we are still working on a better way to build/get an ID. The TODO will be addressed in another PR, once @sclevine's changes are merged.

Part of: RFD 184

Goal (internal): https://github.com/gravitational/cloud/issues/11856

@hugoShaka hugoShaka added the no-changelog Indicates that a PR does not require a changelog entry label Apr 10, 2025
@marcoandredinis marcoandredinis removed their request for review April 11, 2025 07:30
Status proto.UpdaterStatus
}

func HelloUpdaterInfo() (*proto.UpdaterV2Info, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
func HelloUpdaterInfo() (*proto.UpdaterV2Info, error) {
func ReadHelloUpdaterInfo() (*proto.UpdaterV2Info, error) {

I'd also be a little wary of mixing IO and logic like this, I'd prefer if it was a function that converted a *UpdateConfig into a *proto.UpdaterV2Info or something.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(also godocs)

@hugoShaka hugoShaka requested a review from espadolini April 11, 2025 16:38
@sclevine sclevine force-pushed the hugo/telpeort-reports-updater-status branch 3 times, most recently from 094148d to 37bd12c Compare April 17, 2025 02:07
@sclevine
Copy link
Copy Markdown
Member

@hugoShaka added updater UUID in 37bd12c

Note that I'm setting it as a raw 16 byte UUID, given the []byte type used in proto.

@hugoShaka hugoShaka force-pushed the hugo/telpeort-reports-updater-status branch from 1b4b0d5 to d6fab87 Compare April 21, 2025 21:50
log.WarnContext(ctx, "Updater ID may be inaccurate for tracking.")
machineID = nil
}
id, err := findDBPIDUUID(p, []byte(hostUUID), machineID, true)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this guaranteed to return a UUID? Teleport host IDs can also be EC2 instance IDs, unfortunately ._.

Copy link
Copy Markdown
Contributor Author

@hugoShaka hugoShaka Apr 22, 2025

Choose a reason for hiding this comment

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

AFAIK we take any string as the host UUID, convert it to a byte slice, and put it into the ASN.1 thing that gets hashed. So at the end we always have a UUID, and we don't care about the host ID being strictly a UUID.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

DBPIDs are guaranteed to be 16-byte deterministic UUIDv5s.

@hugoShaka hugoShaka force-pushed the hugo/telpeort-reports-updater-status branch from d6fab87 to 5cdf82a Compare April 22, 2025 20:40
@hugoShaka hugoShaka force-pushed the hugo/telpeort-reports-updater-status branch from 5cdf82a to d07668f Compare April 23, 2025 20:38
@hugoShaka hugoShaka enabled auto-merge April 23, 2025 20:48
@hugoShaka hugoShaka added this pull request to the merge queue Apr 23, 2025
Merged via the queue into master with commit 7878d7e Apr 23, 2025
40 checks passed
@hugoShaka hugoShaka deleted the hugo/telpeort-reports-updater-status branch April 23, 2025 21:17
@sclevine
Copy link
Copy Markdown
Member

#55071 should be backported when this is backported

hugoShaka added a commit that referenced this pull request Jul 18, 2025
* Report updater info in Hello

* Add UUID to Hello

* lint

* Fix after rebase

---------

Co-authored-by: Stephen Levine <stephen.levine@goteleport.com>
hugoShaka added a commit that referenced this pull request Jul 24, 2025
* Report updater info in Hello

* Add UUID to Hello

* lint

* Fix after rebase

---------

Co-authored-by: Stephen Levine <stephen.levine@goteleport.com>
hugoShaka added a commit that referenced this pull request Jul 25, 2025
* Report updater info in Hello

* Add UUID to Hello

* lint

* Fix after rebase

---------

Co-authored-by: Stephen Levine <stephen.levine@goteleport.com>
github-merge-queue bot pushed a commit that referenced this pull request Jul 28, 2025
* Add rollout mutation functions (#52930)

* Add Trigger, Rollback, ForceDone autoupdate RPCs (#52931)

* Add Trigger, Rollback, ForceDone autoupdate RPCs

* Add all_started_groups bool + switch to group set

* fix error type

* Align semver libs (#52795)

* Convert autoupdate version handling to coreos/go-semver

* get the right version in installer endpoint + get rid of x/mod/semver

* depguard x/mod/semver

* Add nolint rules for existing x/mod/semver usages

* Add depguard explanation

* Add autoupdate trigger/mark-done/rollback commands (#52933)

* Add updater info in Hello (#53911)

* Introduce autoupdate_agent_report proto types (#54175)

* Introduce autoupdate_agent_report proto types

* Fix tests + remove delete all RPC

* Move updater info proto from authclient to types (#54236)

* Report updater info in Hello (#53938)

* Report updater info in Hello

* Add UUID to Hello

* lint

* Fix after rebase

---------

Co-authored-by: Stephen Levine <stephen.levine@goteleport.com>

* Send goodbye even when doing soft-reload (#54176)

* Send goodbye even when doing soft-reload

* Save and replay Goodbye on connect

* Add SoftReload flag to Goodbye

* SendGoodbye -> SetAndSendGoodbye

* Display update group in `tctl inventory` (#54324)

* Add autoupdate manual rollout audit events (#52934)

* Add autoupdate trigger/merk-done/rollback audit events

* Remove useless resource metadata and add groups to audit event

* Add events to web UI

* Add autoupdate_agent_report backend service (#54333)

* Add autoupdate_agent_report backend service

* Saner resource validation

* Add agent rollout cache + service + client (#54772)

* Add agent rollout cache + service + client

* fix after rebase

* add event in tests

* fix autoupdateagenmtreport event streaming

* lint

* Fix backport: slog -> logrus

* Generate autoupdate agent report periodically (#54865)

* Generate autoupdate agent report periodically

* address edoardo's feedback

* Apply suggestions from code review

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* fix proto field lookup + address feedback

* fix tests + add license

---------

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Add omission info in autoupdate report (#55001)

* Add agent counters to autoupdate_agent_rollout proto (#55096)

* Add agent counters to autoupdate_agent_rollout proto

* int64 -> uint64

* Add reports to client and rewrite mockClient using testify (#55097)

* Add reports to client and rewrite mockClient using testify

When adding the ListAutoUpdateAgentReports() function to the Client interface
I realized that the mock client was not supporting List endpoints.
Instead of expanding the custom mock system, I rewrote the mock client to use
the standard testify/mock library.

* checkIfEmpty -> checkIfCallsWereDone

* Make halt-on-error autoupdate strategy use agent reports (#55116)

* Make half-on-error autoupdate strategy use agent reports

* Make report helpers reusable for time-based strategy

* address edoardo's feedback

* Set the agent count when reconciling time-based rollouts (#55152)

* Set the agent count when reconciling time-based rollouts

* Apply suggestions from code review

Co-authored-by: Stephen Levine <stephen.levine@goteleport.com>

---------

Co-authored-by: Stephen Levine <stephen.levine@goteleport.com>

* Fix flaky `TestServer_generateAgentVersionReport` (#56015)

* [v18] Add autoupdate agent report commands (#56495)

* Add autoupdate agent report commands

* Address feedback

* autoupdate canary support: proto messages (#56259)

* autoupdate canary support: inventory and auth primitives (#56261)

* autoupdate canary support: tctl (#56473)

* autoupdate canary support: tctl support

This commits makes `tctl autoupdate agents status` display groups in the
canary state properly.

* add `--force` flag to `tctl autoupdate agents start-update`

* autoupdate canary support: modulate proxy response (#56468)

This commit makes the TEleport Proxcy service find and pind endpoints
fetch the updater ID from the request parameters and lookup if the
requestor is a canary. If it is, the requestor will be told to update.

* autoupdate canary support: rollout controller (#56467)

* autoupdate canary support: rollout controller

This commit adds canary support to the autoupdate_agent_rollout
controller when the strategy is "halt-on-error".

* Apply suggestions from code review

* Fix backport: add inventory clock + deal with edoardo breaking everything

* Fix tests after backport

* fixup! Fix tests after backport

* fixup! fixup! Fix tests after backport

* lint authproto -> clientproto

* Fix autoupdate canary sampling for the catch-all group

* Tune the canary logic (#56926)

- Users can now specify how many canaries they want
- Instead of looking at the current group size, we rely on user input
- max canary 10 -> 5 (I have not done the max message size yet)
- fix a bug causing the start date to be reset when doing canary ->
  active

* Reliably detect update.yaml after soft reloads

* always send group in agent hello (#55071)

* Fix detection on initial install

* fix log

* Always persist new configuration

* cleanup

* fix tests

* fix tests relying on go 1.24

* fix crd snapshot tests + fix linter issue

---------

Co-authored-by: Stephen Levine <stephen.levine@goteleport.com>
Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants