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

Cherry-pick #19248 to 7.x: [Elastic Agent] Support the install, control, and uninstall of Endpoint #19497

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

blakerouse
Copy link
Contributor

Cherry-pick of PR #19248 to 7.x branch. Original message:

What does this PR do?

Adds the ability to install and uninstall Endpoint.

Adds new exec_file to the transpiler.StepList so file execution can be defined in a spec file. This allows the endpoint.spec file to encode all the actions required to install, check if installed, and uninstall Endpoint.

pre_uninstall steps added to the spec file and new uninstall-operation was added to perform uninstallation of applications.

check_install steps added to the spec file along with a new InstallerChecker that handles checking if the installation steps need to be ran.

Breakdown of the installation:

  1. Download endpoint (doesn't work yet, must be present in data/downloads, in a custom format until the required changes are released on Endpoint side)
  2. Verify endpoint
  3. Check if endpoint install under data/install exists, if it does call ./endpoint-security verify which will verify if its installed. If it returns 0 then it will skip install, as its already installed. (Currently this command doesn't exist, so it will always return non-zero, so installation is always performed. Once added it will just work!)
  4. If needs install, extract endpoint to data/install, then exec ./endpoint-security install --upgrade --resources endpoint-security-resources.zip
  5. Register endpoint with the GRPC server and start the v0 connection information socket.
  6. Endpoint is running!

Breakdown of the uninstallation:

  1. Send stop over GRPC to endpoint (Not currently connected, so times out after 30 seconds).
  2. Run the ./endpoint-security uninstall command from the PreUninstallSteps.
  3. Endpoint is uninstalled!

Why is it important?

To support Endpoint.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

…nt (elastic#19248)

* Initial spec parsing for endpoint.

* Update comment.

* Fix spec test.

* Update code so it copies the entire input.

* Fix ast test.

* Merge agent-improve-restart-loop

* Merge agent-endpoint-spec

* Refactor core/plugin/app into mostly core/ and use core/plugin for different app types.

* Work on endpoint service application.

* More fixes.

* Fix format and tests.

* Fix some imports.

* More cleanups.

* Fix export comment.

* Pass the program.Spec into the descriptor.

* Run endpoint verify, install, and uninstall when endpoint should be running.

* Fix install and uninstall of Endpoint

* Fix some small issues with service app.

* Add changelog entry.

* Fix lint and tests.

* Fix lint.

* Remove the code no longer needed because of newer config format.

* Fix rules and review.

* Update to Endpoint Security.

* Fix issues so endpoint security runs.

* Add comments.

* Update docstring.

* Some more fixes.

* Delete the extra endpoint testdata files.

* Add timeout to exec_file step.

* Fix supported map.

* Fix getting support programs by cmd.

* Improve app started checks.

* Fix buildspec.

(cherry picked from commit 0fe1554)
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 29, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ingest-management (Team:Ingest Management)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 29, 2020
@blakerouse blakerouse self-assigned this Jun 29, 2020
Copy link
Contributor

@ph ph left a comment

Choose a reason for hiding this comment

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

backport looks good.

@blakerouse blakerouse merged commit f9b5f18 into elastic:7.x Jun 29, 2020
@blakerouse blakerouse deleted the backport_19248_7.x branch June 29, 2020 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants