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

[Fix] Agent incapable of running on Azure Container Instances #3576

Merged
merged 9 commits into from
Oct 16, 2023

Conversation

michalpristas
Copy link
Contributor

@michalpristas michalpristas commented Oct 10, 2023

Bringing back #3139

What this change is introducing on top of bringing back work introduced in #3084 is change of ordrer for some operations.

Changing owner of a file, discards capabilities set. This becomes a problem with heartbeat as it needs setuid and netraw capabilities to perform properly.
So setting capabilities was moved after chown.

How to test

  • build docker image
  • deploy to Azure Container Instances to see it running (it cannot fail)
  • check capabilities docker run --rm -it --entrypoint /bin/bash {image_id} -c "getcap data/elastic-agent-*/components/heartbeat" -> this needs to have output (capabilities mentioned earlier)

I also checked with @justinkambic to see if we can test this with their failing E2E but it seems we need to merge it to see it fail. But it won't fail. OK?

Fixes: #82

@michalpristas michalpristas added bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent Label for the Agent team labels Oct 10, 2023
@michalpristas michalpristas self-assigned this Oct 10, 2023
@michalpristas michalpristas requested a review from a team as a code owner October 10, 2023 09:15
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@elasticmachine
Copy link
Contributor

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

@mergify
Copy link
Contributor

mergify bot commented Oct 10, 2023

This pull request does not have a backport label. Could you fix it @michalpristas? 🙏
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.

@michalpristas michalpristas added backport-v8.11.0 Automated backport with mergify and removed backport-skip labels Oct 10, 2023
@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 10, 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-10-16T10:54:13.232+0000

  • Duration: 66 min 16 sec

Test stats 🧪

Test Results
Failed 0
Passed 6493
Skipped 59
Total 6552

💚 Flaky test report

Tests succeeded.

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

@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 10, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 98.78% (81/82) 👍
Files 67.559% (202/299) 👍
Classes 66.187% (368/556) 👍
Methods 53.539% (1165/2176) 👍
Lines 39.686% (13545/34130) 👎 -0.023
Conditionals 100.0% (0/0) 💚

…tmpl

Co-authored-by: Paolo Chilà <paolo.chila@elastic.co>
@michalpristas michalpristas enabled auto-merge (squash) October 10, 2023 16:30
@elastic-sonarqube
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@michalpristas michalpristas merged commit fa357a8 into elastic:main Oct 16, 2023
8 checks passed
mergify bot pushed a commit that referenced this pull request Oct 16, 2023
What this change is introducing on top of bringing back work introduced in #3084 is change of ordrer for some operations.

Changing owner of a file, discards capabilities set. This becomes a problem with heartbeat as it needs setuid and netraw capabilities to perform properly.
So setting capabilities was moved after chown.

(cherry picked from commit fa357a8)
michalpristas added a commit that referenced this pull request Oct 18, 2023
…#3614)

What this change is introducing on top of bringing back work introduced in #3084 is change of ordrer for some operations.

Changing owner of a file, discards capabilities set. This becomes a problem with heartbeat as it needs setuid and netraw capabilities to perform properly.
So setting capabilities was moved after chown.

(cherry picked from commit fa357a8)

Co-authored-by: Michal Pristas <michal.pristas@gmail.com>
cmacknz added a commit to cmacknz/elastic-agent that referenced this pull request Nov 6, 2023
cmacknz added a commit that referenced this pull request Nov 7, 2023
cmacknz added a commit to cmacknz/elastic-agent that referenced this pull request Nov 7, 2023
cmacknz added a commit that referenced this pull request Nov 7, 2023
michalpristas added a commit to michalpristas/elastic-agent that referenced this pull request Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.11.0 Automated backport with mergify bug Something isn't working Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Elastic Agent docker image for azure containers runtime
4 participants