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

Update installer code to support deployer abstraction#1163

Merged
adam-stokes merged 14 commits intomasterfrom
feat-installer-rework
May 25, 2021
Merged

Update installer code to support deployer abstraction#1163
adam-stokes merged 14 commits intomasterfrom
feat-installer-rework

Conversation

@adam-stokes
Copy link
Copy Markdown
Contributor

@adam-stokes adam-stokes commented May 13, 2021

What does this PR do?

Refactors the installer code to utilize the deployment backend mechanics

Why is it important?

This allows us to greatly increase the support of testing against various deployments (local host only, docker, kubernetes) and abstracts out the code necessary to install and run the elastic-agent on those providers

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 for the CLI, 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)

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
@adam-stokes adam-stokes requested a review from mdelapenya May 13, 2021 13:11
@adam-stokes adam-stokes marked this pull request as draft May 13, 2021 13:12
@adam-stokes
Copy link
Copy Markdown
Contributor Author

@mdelapenya have a look at this PR as it shows how we can abstract out a 'Package' and support the different installation/configuration methods. This also fixes the installer interface as the previous one wasn't adhering to the interface

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented May 17, 2021

💚 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

Expand to view the summary

Build stats

  • Build Cause: Pull request #1163 updated

  • Start Time: 2021-05-25T00:28:48.917+0000

  • Duration: 25 min 11 sec

  • Commit: c5b7d58

Test stats 🧪

Test Results
Failed 0
Passed 160
Skipped 0
Total 160

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 160
Skipped 0
Total 160

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
@adam-stokes
Copy link
Copy Markdown
Contributor Author

@mdelapenya I needed to rework the installer code to support attaching to a deployment. Similar to the way Mount previously worked but just going the opposite direction to avoid the cyclic import errors

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
@adam-stokes adam-stokes marked this pull request as ready for review May 24, 2021 18:46
Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
@adam-stokes adam-stokes requested review from a team and mdelapenya May 25, 2021 00:54
Copy link
Copy Markdown
Contributor

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

I've verified that Beats PR are covered by this PR, so LGTM

How to test a Beats PR:

# needed to get artifacts from GCP bucket
export BEATS_USE_CI_SNAPSHOTS=true
# git sha1 for a commit in the proper maintenance branch
export GITHUB_CHECK_SHA1=b989478a3003c1b41722b7245586d58d832748a4
SUITE="fleet" TAGS="stand_alone_agent" TIMEOUT_FACTOR=3  LOG_LEVEL=TRACE  DEVELOPER_MODE=true \
    make -C e2e functional-test

Thinking about adding this to the PR template ⬆️⬆️

@adam-stokes
Copy link
Copy Markdown
Contributor Author

I've verified that Beats PR are covered by this PR, so LGTM

How to test a Beats PR:

# needed to get artifacts from GCP bucket
export BEATS_USE_CI_SNAPSHOTS=true
# git sha1 for a commit in the proper maintenance branch
export GITHUB_CHECK_SHA1=b989478a3003c1b41722b7245586d58d832748a4
SUITE="fleet" TAGS="stand_alone_agent" TIMEOUT_FACTOR=3  LOG_LEVEL=TRACE  DEVELOPER_MODE=true \
    make -C e2e functional-test

Thinking about adding this to the PR template ⬆️⬆️

Yea we should add that to the template for sure

@adam-stokes adam-stokes merged commit 584769a into master May 25, 2021
@adam-stokes adam-stokes deleted the feat-installer-rework branch May 25, 2021 15:41
mergify bot pushed a commit that referenced this pull request May 25, 2021
* Installer refactor
* More work abstracting out installer bits
* Update internal/deploy/docker.go
* Update installer to support attaching a deployment
* cleanup execing into services
* fix e2e tests
* print logs of container, up timeout factor
* revert jenkinsfile
* remove dead code

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
(cherry picked from commit 584769a)
mergify bot pushed a commit that referenced this pull request May 25, 2021
* Installer refactor
* More work abstracting out installer bits
* Update internal/deploy/docker.go
* Update installer to support attaching a deployment
* cleanup execing into services
* fix e2e tests
* print logs of container, up timeout factor
* revert jenkinsfile
* remove dead code

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
(cherry picked from commit 584769a)

# Conflicts:
#	e2e/_suites/fleet/fleet.go
#	internal/installer/base.go
#	internal/installer/deb.go
#	internal/installer/rpm.go
#	internal/installer/tar.go
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request May 25, 2021
* master:
  Update installer code to support deployer abstraction (elastic#1163)
adam-stokes added a commit that referenced this pull request May 25, 2021
* Installer refactor
* More work abstracting out installer bits
* Update internal/deploy/docker.go
* Update installer to support attaching a deployment
* cleanup execing into services
* fix e2e tests
* print logs of container, up timeout factor
* revert jenkinsfile
* remove dead code

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
(cherry picked from commit 584769a)

Co-authored-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request May 26, 2021
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request May 26, 2021
mdelapenya added a commit that referenced this pull request May 26, 2021
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request May 26, 2021
* master:
  Revert "Update installer code to support deployer abstraction (elastic#1163)" (elastic#1201)
  Update installer code to support deployer abstraction (elastic#1163)
@adam-stokes adam-stokes restored the feat-installer-rework branch May 26, 2021 13:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants