Skip to content

[Agent] Make default config OS agnostic#17016

Merged
michalpristas merged 7 commits intoelastic:masterfrom
michalpristas:agent-default-home
Mar 17, 2020
Merged

[Agent] Make default config OS agnostic#17016
michalpristas merged 7 commits intoelastic:masterfrom
michalpristas:agent-default-home

Conversation

@michalpristas
Copy link
Copy Markdown
Contributor

What does this PR do?

PR changes path of install and download directories in default config to be OS agnostic by using path.data.

Why is it important?

It simplifies first run experience when running agent by removing the need to change configuration values which are configured to non existent paths.

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

How to test this PR locally

You need to build and package agent to contain data/beats subdirectory containing filebeat and metricbeat archives (tar.gz on linux and darwin).

Second step is just running agent and verifying that metricbeat was installed to data/install and is successfully started

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/ingest-management (Project:fleet)

Copy link
Copy Markdown
Contributor

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

LGTM. We should continue to iterate on the naming / paths but this already improves it.

Comment thread x-pack/agent/_meta/agent.docker.yml Outdated
sourceURI: "https://artifacts.elastic.co/downloads/beats/"
# path to the directory containing downloaded packages
target_directory: "/home/elastic/downloads"
target_directory: "${path.data}/beats"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perhaps still call it downloads and not beats as this will also download endpoint?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 for download

@michalpristas
Copy link
Copy Markdown
Contributor Author

/downloads sounds good to me as well i changed packaging to inject beats into downloads so it is usable right away. this changes downloader to use downloads subdir as a default fallback instead of beats

@michalpristas
Copy link
Copy Markdown
Contributor Author

going to test packaging before merge

Copy link
Copy Markdown
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

@ph ph added the needs_backport PR is waiting to be backported to other branches. label Mar 16, 2020
@ph
Copy link
Copy Markdown
Contributor

ph commented Mar 16, 2020

added need backport label.

@michalpristas michalpristas merged commit 543f2aa into elastic:master Mar 17, 2020
@ph ph removed the needs_backport PR is waiting to be backported to other branches. label Apr 7, 2020
@ph
Copy link
Copy Markdown
Contributor

ph commented Apr 7, 2020

backported in #17574 to have a working build

ph added a commit that referenced this pull request Apr 7, 2020
… enable building the agent. (#17574)

* Fix issue when building Agent snapshot and enable building the agent. (#16927)

An extension in the generated files ("SNAPSHOT") was preventing us to
correctly generate the agent artifact with the packaged
metricbeat/filebeat.

Fixes: #16908
(cherry picked from commit 62d3683)

* [Agent] Fix installers (#17077)

[Agent] Fix installers for snapshots (#17077)

* [Agent] fixed mage package for agent (#17368)

[Agent] fixed mage package for agent (#17368)

* [Agent] Make default config OS agnostic (#17016)

[Agent] Make default config OS agnostic (#17016)

* [Agent] Docker image for integration tests (#16898)

[Agent] Docker image for integration tests (#16898)

Co-authored-by: Michal Pristas <michal.pristas@gmail.com>
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.

4 participants