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 #19205 to 7.x: [Elastic Agent] Support an application spec to be ran through service manager (eg. Endpoint) #19487

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

blakerouse
Copy link
Contributor

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

What does this PR do?

This splits the pkg/core/plugin/app into 2 distinct types of application types process (which runs the application as a subprocess and passes the connection credentials through stdin) and service (which runs the application as it is started by the service manager on the system and passes the connection credentials over a TCP socket defined in the spec file with service: {port_number}.

This updates the endpoint.spec file to set service: 6788 so that the pkg/core/plugin/service.Application will start the TCP connections credentials socket on 6788.

This also moves some modules around outside of pkg/core/plugin to just pkg/core keeping pkg/core/plugin/* for the different application types. This also allows for better code re-use in some areas, as the 2 types have lots in common.

This currently has a pre-req on #19171, so it shows in this diff.

Why is it important?

To enable support for Elastic Agent to control Endpoint as a service that is installed on the same machine.

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.

… manager (eg. Endpoint) (elastic#19205)

* 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.

* Fix some small issues with service app.

* Fix lint and tests.

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

* Fix rules and review.

(cherry picked from commit ac51570)
@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
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jun 29, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Branch indexing]

  • Start Time: 2020-06-29T17:27:00.557+0000

  • Duration: 44 min 59 sec

Test stats 🧪

Test Results
Failed 0
Passed 539
Skipped 127
Total 666

@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.

LGTM backport looks good.

@blakerouse blakerouse merged commit d831809 into elastic:7.x Jun 29, 2020
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