Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Developer Documentation] Illustrate the Agent upgrade process #2858

Merged
merged 4 commits into from
Jun 27, 2023

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented Jun 13, 2023

What does this PR do?

This PR adds developer documentation illustrating the Fleet-managed Agent upgrade process, focussing on the communications amongst the various components involved.

Why is it important?

For Agent and Fleet developers to understand how Agent upgrades work.

Review suggestions

View the rich diff of the file.

@ycombinator ycombinator added documentation Improvements or additions to documentation Team:Fleet Label for the Fleet team Team:Elastic-Agent Label for the Agent team backport-skip skip-changelog labels Jun 13, 2023
@ycombinator ycombinator marked this pull request as ready for review June 13, 2023 20:15
@ycombinator ycombinator requested a review from a team as a code owner June 13, 2023 20:15
@ycombinator ycombinator requested review from cmacknz, juliaElastic and leehinman and removed request for pchila June 13, 2023 20:19
@elasticmachine
Copy link
Contributor

elasticmachine commented Jun 13, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-06-26T23:39:29.881+0000

  • Duration: 11 min 17 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

docs/upgrades.md Outdated
UW->>A: Start
A->>FS: Ack failed upgrade
FS->>ES: Update Agent doc in `.fleet-agents`<br />set `upgrade_status` = null<br />`upgraded_at = <now>
Note right of ES: Need to check
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: check and remove note.

docs/upgrades.md Outdated
FS->>ES: Update Agent doc in `.fleet-agents`<br />set `upgrade_status` = null<br />`upgraded_at = <now>
Note right of ES: Need to check
UI->>UI: Show Agent status as "???"
Note right of UI: Need to check
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: check and remove note.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agent status goes back to Healthy on successful rollback (by clearing upgrade_started_at field)

docs/upgrades.md Outdated
A->>FS: Ack failed upgrade
FS->>ES: Update Agent doc in `.fleet-agents`<br />set `upgrade_status` = "failed"
UI->>UI: Show Agent status as "???"
Note right of UI: Need to check
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: check and remove note.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we show anything, that is this bug essentially #2508

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I think the agent status stays in updating. I think in some cases the error is written to .fleet-action-results and the UI shows the action failure in Agent activity flyout.

@ycombinator ycombinator marked this pull request as draft June 14, 2023 12:18
@ycombinator
Copy link
Contributor Author

Moving back to draft status until the three TODOs are resolved.

@ycombinator ycombinator requested a review from pchila June 14, 2023 14:16
docs/upgrades.md Outdated
A->>A: Rexec to start new Agent artifact
A->>FS: Ack successful upgrade
UW->>UM: Remove
FS->>ES: Update Agent doc in `.fleet-agents`<br />set `upgrade_status` = null<br />`upgraded_at = <now>
Copy link
Contributor

Choose a reason for hiding this comment

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

also set upgrade_started_at = null

Copy link
Contributor

Choose a reason for hiding this comment

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

There is also a step here where FS writes the successful ack to .fleet-actions-results. We have seen an issue where the write fails (e.g. ES connection error) and the action stays in progress in the UI forever.

@ycombinator ycombinator marked this pull request as ready for review June 26, 2023 23:39
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@ycombinator ycombinator requested a review from juliaElastic June 26, 2023 23:39
@ycombinator ycombinator force-pushed the doc-agent-upgrade-comms branch from e8b8959 to 94e4dd3 Compare June 26, 2023 23:39
@ycombinator ycombinator merged commit b7acbff into elastic:main Jun 27, 2023
@ycombinator ycombinator deleted the doc-agent-upgrade-comms branch July 6, 2023 18:19
AndersonQ pushed a commit to AndersonQ/elastic-agent that referenced this pull request Jul 10, 2023
…ic#2858)

* init checkin

* Update comment

* Change user to actor

* Resolve TODOs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip documentation Improvements or additions to documentation skip-changelog Team:Elastic-Agent Label for the Agent team Team:Fleet Label for the Fleet team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants