Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

chore: bring back stand-alone agent #2879

Merged
merged 15 commits into from
Aug 1, 2022

Conversation

mdelapenya
Copy link
Contributor

@mdelapenya mdelapenya commented Jul 31, 2022

  • chore: apply functional opts to agent deployment
  • chore: rename deployment method
  • chore: simplify stand-alone deployment removing flavour
  • fix: revoke token scenario was outdated
  • chore: simplify deploy stand-alone agent method
  • chore: skip scenario for bootstrap fleet server agent in stand-alone
  • chore: include stand-alone agent in CI

What does this PR do?

It adds the stand-alone agent scenarios to the CI including a few changes:

  • the bootstrap fleet-server scenario is skipped, because it uses docker-compose to start the fleet-server in local, and the agent is using the already deployed stack
  • uses a new functional approach (more Go idiomatic) when deploying an agent to Fleet. It uses optional functions instead of input parameters to configure the deployment (installer type, extra flags, etc)
  • updates the revoke-token scenario, as it was based on the old docker-compose style. Now it installs the agent, revokes the token, uninstalls it, and tries to install an agent with the same token again
  • detected that Ansible Docker ARM role was not applied to the ARM instances, causing a failure for having Docker not installed on the instance. Docker is needed because the stand-alone mode uses the Docker image of the elastic-agent.

Why is it important?

Add scenarios that were already working in the past, also improving the readability of the deploment of the agent code

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 run the Unit tests (make unit-test), and they are passing locally
  • I have run the End-2-End tests for the suite I'm working on, and they are passing locally
  • I have noticed new Go dependencies (run make notice in the proper directory)

Related issues

@mdelapenya mdelapenya added Team:Automation Label for the Observability productivity team backport-v7.17.0 Automated backport with mergify backport-v8.2.0 Automated backport with mergify backport-v8.3.0 Automated backport with mergify labels Jul 31, 2022
@mdelapenya mdelapenya self-assigned this Jul 31, 2022
@mdelapenya mdelapenya requested review from pazone and a team July 31, 2022 09:49
@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 31, 2022

💔 Tests Failed

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-08-01T15:17:29.065+0000

  • Duration: 68 min 12 sec

Test stats 🧪

Test Results
Failed 1
Passed 417
Skipped 0
Total 418

Test errors 1

Expand to view the tests failures

Initializing / End-To-End Tests / fleet_debian_10_arm64_system_integration / Adding cpu system/metrics Integration to a Policy – System Integration
    Expand to view the error details

     Step "system/metrics" with "cpu" metrics are present in the datastreams 
    

  • no stacktrace

Steps errors 3

Expand to view the steps failures

Start Elastic Stack
  • Took 10 min 28 sec . View more details here
  • Description: make -C .ci start-elastic-stack
generate-cucumber-reports.sh
  • Took 0 min 0 sec . View more details here
  • Description: .ci/scripts/generate-cucumber-reports.sh
Run tests in the node
  • Took 27 min 57 sec . View more details here
  • Description: make -C .ci run-tests

🐛 Flaky test report

❕ There are test failures but not known flaky tests.

Expand to view the summary

Genuine test errors 1

💔 There are test failures but not known flaky tests, most likely a genuine test failure.

  • Name: Initializing / End-To-End Tests / fleet_debian_10_arm64_system_integration / Adding cpu system/metrics Integration to a Policy – System Integration

🤖 GitHub comments

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

  • /test : Re-trigger the build.

@mdelapenya
Copy link
Contributor Author

Mmm the Ansible role to install Docker does not install Docker Compose on ARM. Will take a look, as it's an external dependency

We do not add the role to the stack machine, as it's always created on Debian 10 AMD
@mdelapenya mdelapenya added backport-v8.4.0 Automated backport with mergify and removed backport-v8.2.0 Automated backport with mergify labels Aug 1, 2022
* main:
  fix: poll for api key verification using backoff retry (elastic#2882)
  backport: Add 8.4 branch (elastic#2857)
Originally detected on geerlingguy.docker_arm
mergify bot pushed a commit that referenced this pull request Aug 1, 2022
* chore: apply functional opts to agent deployment

* chore: rename deployment method

* chore: simplify stand-alone deployment removing flavour

It's not used

* fix: revoke token scenario was outdated

Now it uninstalls the agent and tries to enroll it with the already revoked token

* chore: simplify deploy stand-alone agent method

* chore: skip scenario for bootstrap fleet server agent in stand-alone

* chore: include stand-alone agent in CI

* chore: install docker in the ARM instances

We do not add the role to the stack machine, as it's always created on Debian 10 AMD

* fix: install pip on Linux using Ansible role

* fix: install pip in the stack too

* fix: install deps as soon as possible

* Revert "fix: install pip on Linux using Ansible role"

This reverts commit 3d06ce6.

* fix: add python libs for docker on ARM

* fix: add missing library for installing Docker on ARM

Originally detected on geerlingguy.docker_arm

(cherry picked from commit 3f728b7)
mergify bot pushed a commit that referenced this pull request Aug 1, 2022
* chore: apply functional opts to agent deployment

* chore: rename deployment method

* chore: simplify stand-alone deployment removing flavour

It's not used

* fix: revoke token scenario was outdated

Now it uninstalls the agent and tries to enroll it with the already revoked token

* chore: simplify deploy stand-alone agent method

* chore: skip scenario for bootstrap fleet server agent in stand-alone

* chore: include stand-alone agent in CI

* chore: install docker in the ARM instances

We do not add the role to the stack machine, as it's always created on Debian 10 AMD

* fix: install pip on Linux using Ansible role

* fix: install pip in the stack too

* fix: install deps as soon as possible

* Revert "fix: install pip on Linux using Ansible role"

This reverts commit 3d06ce6.

* fix: add python libs for docker on ARM

* fix: add missing library for installing Docker on ARM

Originally detected on geerlingguy.docker_arm

(cherry picked from commit 3f728b7)

# Conflicts:
#	.ci/.e2e-tests-daily.yaml
#	.ci/.e2e-tests-for-elastic-agent.yaml
#	.ci/.e2e-tests.yaml
mergify bot pushed a commit that referenced this pull request Aug 1, 2022
* chore: apply functional opts to agent deployment

* chore: rename deployment method

* chore: simplify stand-alone deployment removing flavour

It's not used

* fix: revoke token scenario was outdated

Now it uninstalls the agent and tries to enroll it with the already revoked token

* chore: simplify deploy stand-alone agent method

* chore: skip scenario for bootstrap fleet server agent in stand-alone

* chore: include stand-alone agent in CI

* chore: install docker in the ARM instances

We do not add the role to the stack machine, as it's always created on Debian 10 AMD

* fix: install pip on Linux using Ansible role

* fix: install pip in the stack too

* fix: install deps as soon as possible

* Revert "fix: install pip on Linux using Ansible role"

This reverts commit 3d06ce6.

* fix: add python libs for docker on ARM

* fix: add missing library for installing Docker on ARM

Originally detected on geerlingguy.docker_arm

(cherry picked from commit 3f728b7)

# Conflicts:
#	.ci/.e2e-tests-daily.yaml
#	.ci/.e2e-tests-for-elastic-agent.yaml
#	.ci/.e2e-tests.yaml
#	.ci/ansible/tasks/install_deps.yml
#	e2e/_suites/fleet/elastic_agent_deploy.go
#	e2e/_suites/fleet/elastic_agent_enroll.go
mdelapenya added a commit that referenced this pull request Aug 2, 2022
* chore: bring back stand-alone agent (#2879)

* chore: apply functional opts to agent deployment

* chore: rename deployment method

* chore: simplify stand-alone deployment removing flavour

It's not used

* fix: revoke token scenario was outdated

Now it uninstalls the agent and tries to enroll it with the already revoked token

* chore: simplify deploy stand-alone agent method

* chore: skip scenario for bootstrap fleet server agent in stand-alone

* chore: include stand-alone agent in CI

* chore: install docker in the ARM instances

We do not add the role to the stack machine, as it's always created on Debian 10 AMD

* fix: install pip on Linux using Ansible role

* fix: install pip in the stack too

* fix: install deps as soon as possible

* Revert "fix: install pip on Linux using Ansible role"

This reverts commit 3d06ce6.

* fix: add python libs for docker on ARM

* fix: add missing library for installing Docker on ARM

Originally detected on geerlingguy.docker_arm

(cherry picked from commit 3f728b7)

# Conflicts:
#	.ci/.e2e-tests-daily.yaml
#	.ci/.e2e-tests-for-elastic-agent.yaml
#	.ci/.e2e-tests.yaml

* fix: resolve conflicts

Co-authored-by: Manuel de la Peña <[email protected]>
mdelapenya added a commit that referenced this pull request Aug 2, 2022
* chore: apply functional opts to agent deployment

* chore: rename deployment method

* chore: simplify stand-alone deployment removing flavour

It's not used

* fix: revoke token scenario was outdated

Now it uninstalls the agent and tries to enroll it with the already revoked token

* chore: simplify deploy stand-alone agent method

* chore: skip scenario for bootstrap fleet server agent in stand-alone

* chore: include stand-alone agent in CI

* chore: install docker in the ARM instances

We do not add the role to the stack machine, as it's always created on Debian 10 AMD

* fix: install pip on Linux using Ansible role

* fix: install pip in the stack too

* fix: install deps as soon as possible

* Revert "fix: install pip on Linux using Ansible role"

This reverts commit 3d06ce6.

* fix: add python libs for docker on ARM

* fix: add missing library for installing Docker on ARM

Originally detected on geerlingguy.docker_arm

(cherry picked from commit 3f728b7)

Co-authored-by: Manuel de la Peña <[email protected]>
mdelapenya added a commit that referenced this pull request Aug 2, 2022
* chore: bring back stand-alone agent (#2879)

* chore: apply functional opts to agent deployment

* chore: rename deployment method

* chore: simplify stand-alone deployment removing flavour

It's not used

* fix: revoke token scenario was outdated

Now it uninstalls the agent and tries to enroll it with the already revoked token

* chore: simplify deploy stand-alone agent method

* chore: skip scenario for bootstrap fleet server agent in stand-alone

* chore: include stand-alone agent in CI

* chore: install docker in the ARM instances

We do not add the role to the stack machine, as it's always created on Debian 10 AMD

* fix: install pip on Linux using Ansible role

* fix: install pip in the stack too

* fix: install deps as soon as possible

* Revert "fix: install pip on Linux using Ansible role"

This reverts commit 3d06ce6.

* fix: add python libs for docker on ARM

* fix: add missing library for installing Docker on ARM

Originally detected on geerlingguy.docker_arm

(cherry picked from commit 3f728b7)

# Conflicts:
#	.ci/.e2e-tests-daily.yaml
#	.ci/.e2e-tests-for-elastic-agent.yaml
#	.ci/.e2e-tests.yaml
#	.ci/ansible/tasks/install_deps.yml
#	e2e/_suites/fleet/elastic_agent_deploy.go
#	e2e/_suites/fleet/elastic_agent_enroll.go

* fix: resolve conflicts

* fix: resolve conflicts

* fix: resolve conflicts

Co-authored-by: Manuel de la Peña <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport-v7.17.0 Automated backport with mergify backport-v8.3.0 Automated backport with mergify backport-v8.4.0 Automated backport with mergify Team:Automation Label for the Observability productivity team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants