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

V1 controller with agent #561

Conversation

fearful-symmetry
Copy link
Contributor

@fearful-symmetry fearful-symmetry commented Jun 15, 2022

What does this PR do?

This PR allows the agent to build and control the shipper via the V1 specfiles and control protocol: elastic/elastic-agent-shipper#13 elastic/elastic-agent-shipper#46

This will go on a seperate v1-shipper-support branch and not on main, however apparently you can't create a new branch in the github PR UI so I'll do that after. This has been tested, and most of the time was spent figuring out how to make the specfiles happy.

Note that this doesn't include any changes to the default config files such that the shipper might run by default out of the box, as we're still not sure what the shipper config will actually look like.

Why is it important?

The shipper needs to run under agent, and using the existing V1 APIs is sort of a fallback in case we can't have V2 done in time.

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.

@fearful-symmetry fearful-symmetry requested a review from a team as a code owner June 15, 2022 21:23
@fearful-symmetry fearful-symmetry self-assigned this Jun 15, 2022
@fearful-symmetry fearful-symmetry requested review from blakerouse and michel-laterman and removed request for a team June 15, 2022 21:23
@mergify
Copy link
Contributor

mergify bot commented Jun 15, 2022

This pull request does not have a backport label. Could you fix it @fearful-symmetry? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@fearful-symmetry fearful-symmetry changed the base branch from main to v1-shipper-support June 15, 2022 21:25
@fearful-symmetry fearful-symmetry added backport-v8.4.0 Automated backport with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Jun 15, 2022
@mergify mergify bot removed the backport-skip label Jun 15, 2022
@elasticmachine
Copy link
Contributor

elasticmachine commented Jun 15, 2022

💚 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: 2022-06-23T16:40:41.910+0000

  • Duration: 34 min 41 sec

Test stats 🧪

Test Results
Failed 0
Passed 5991
Skipped 23
Total 6014

🤖 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!)

@elasticmachine
Copy link
Contributor

elasticmachine commented Jun 15, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 97.222% (70/72) 👍
Files 68.636% (151/220) 👍
Classes 68.481% (302/441) 👍
Methods 51.817% (827/1596) 👍
Lines 38.31% (8961/23391) 👍 0.058
Conditionals 100.0% (0/0) 💚

Copy link
Contributor

@michalpristas michalpristas left a comment

Choose a reason for hiding this comment

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

looks good, please take a look at comments i left, just few small improvements

@@ -917,6 +962,24 @@ specs:
<<: *binary_spec
<<: *elastic_license_for_binaries

#elastic-agent-shipper packaged for the agent
elastic_shipper_agent:
Copy link
Contributor

Choose a reason for hiding this comment

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

is this used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the packaging spec that's called from the shipper itself during mage package.

@@ -0,0 +1,13 @@
name: Shipper
Copy link
Contributor

Choose a reason for hiding this comment

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

please rename to elastic-agent-shipper.spec.yml we added spec so we dont have a conflict with config files

magefile.go Outdated
pwd, err := filepath.Abs(filepath.Join("../beats/x-pack", b))
var pwd string
var err error
if !strings.Contains(b, "beat") {
Copy link
Contributor

Choose a reason for hiding this comment

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

i'd rather have this explicitely configured e.g changing packedBeats to a struct or a map where key is a beat name and value is IsXpack

@fearful-symmetry fearful-symmetry merged commit 915b2b3 into elastic:v1-shipper-support Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.4.0 Automated backport with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants