Skip to content

Agent required changes for building the agent artifacts#16624

Merged
ph merged 5 commits intoelastic:masterfrom
ph:agent-devtools-changes
Mar 2, 2020
Merged

Agent required changes for building the agent artifacts#16624
ph merged 5 commits intoelastic:masterfrom
ph:agent-devtools-changes

Conversation

@ph
Copy link
Copy Markdown
Contributor

@ph ph commented Feb 26, 2020

The Agent has special requirements:

  • Only Elastic licensed
  • Bundle Metricbeat
  • Bundle Filebeat

This PR isolate all the required changes for the devtools to correctly
build the agent. This can be merged as is because it doesn't impact
building any other beats.

What does this PR do?

Why is it important?

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

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

The Agent has special requirements:

- Only Elastic licensed
- Bundle Metricbeat
- Bundle Filebeat

This PR isolate all the required changes for the devtools to correctly
build the agent. This can be merged as is because it doesn't impact
building any other beats.
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/ingest (Project:fleet)

@ph ph mentioned this pull request Feb 26, 2020
5 tasks
@ph ph added the needs_backport PR is waiting to be backported to other branches. label Feb 26, 2020
@ph
Copy link
Copy Markdown
Contributor Author

ph commented Feb 26, 2020

This can be safely backported to 7.x

Comment thread dev-tools/packaging/packages.yml Outdated
extra_vars:
# OS X 10.8 Mountain Lion is the oldest supported by Go 1.10.
# https://golang.org/doc/go1.10#ports
min_supported_osx_version: 10.8
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

our current build system is based on go1.13. Min macOS version is 1.11

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@urso its a copy-paste of the existing packages task defined in

# OS X 10.8 Mountain Lion is the oldest supported by Go 1.10.
# https://golang.org/doc/go1.10#ports
min_supported_osx_version: 10.8
identifier: 'co.{{.BeatVendor | tolower}}.beats.{{.BeatName}}'

I will update mine to 1.11 and make a PR for the other part in master.

@urso
Copy link
Copy Markdown

urso commented Feb 26, 2020

LGTM

@andrewkroh cam you also have a look?

@urso urso requested a review from andrewkroh February 26, 2020 19:00
Comment thread dev-tools/mage/pkgspecs.go Outdated
Comment thread dev-tools/mage/pkgspecs.go Outdated
Comment thread dev-tools/mage/pkgspecs.go Outdated
ph and others added 3 commits February 27, 2020 08:14
Co-Authored-By: Nicolas Ruflin <spam@ruflin.com>
Co-Authored-By: Nicolas Ruflin <spam@ruflin.com>
Co-Authored-By: Nicolas Ruflin <spam@ruflin.com>
@ph
Copy link
Copy Markdown
Contributor Author

ph commented Feb 27, 2020

@ruflin all yours changes are in.

@ph
Copy link
Copy Markdown
Contributor Author

ph commented Feb 27, 2020

Weird, I had to kick Travis manually it was stuck.

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

lgtm, looks like a cherry pick of what we have in feature ingest branch right?

@michalpristas
Copy link
Copy Markdown
Contributor

i've see travis being slow lately. noemi also complained

@ph
Copy link
Copy Markdown
Contributor Author

ph commented Feb 27, 2020

@michalpristas Yes Its a cherry-pick, there is webhook issues or slowdown on github side.

Copy link
Copy Markdown
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

Code changes look good. My questions are mostly about what's in the packages.

source: '{{ repo.RootDir }}/LICENSE.txt'
mode: 0644
/usr/share/{{.BeatName}}/README.md:
template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/common/README.md.tmpl'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This readme template is specific to a Beat. I think the agent will want to have its own.

extra_vars:
from: 'centos:7'
user: '{{ .BeatName }}'
linux_capabilities: ''
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So that agent can run in a container as a non-root user without any special Linux capabilities added to the binary? 🤔

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.

this is a copy paste from some beat, we in fact need to update user to a full root probably

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.

files:
<<: *agent_binary_files
install-service-{{.BeatName}}.ps1:
template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/windows/install-service.ps1.tmpl'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does the agent use the same CLI arguments as the beats? Maybe you need a customized install script?

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.

we tried to mimic beat behavior here and we support args like -c or path.* i'm not sure about -E

@ph
Copy link
Copy Markdown
Contributor Author

ph commented Mar 2, 2020

I am going to merge this and addresses the changes the mention of @andrewkroh in a followup PR.

@ph ph merged commit ab84afc into elastic:master Mar 2, 2020
@ph ph removed the needs_backport PR is waiting to be backported to other branches. label Mar 2, 2020
@ph ph added the v7.7.0 label Mar 2, 2020
ph added a commit that referenced this pull request Mar 4, 2020
)

* Agent required changes for building the agent artifacts

The Agent has special requirements:

- Only Elastic licensed
- Bundle Metricbeat
- Bundle Filebeat

This PR isolate all the required changes for the devtools to correctly
build the agent. This can be merged as is because it doesn't impact
building any other beats.

* Update dev-tools/mage/pkgspecs.go

Co-Authored-By: Nicolas Ruflin <spam@ruflin.com>

* Update dev-tools/mage/pkgspecs.go

Co-Authored-By: Nicolas Ruflin <spam@ruflin.com>

* Update dev-tools/mage/pkgspecs.go

Co-Authored-By: Nicolas Ruflin <spam@ruflin.com>

* update min version for macos to 1.11

Co-authored-by: Nicolas Ruflin <spam@ruflin.com>
(cherry picked from commit ab84afc)
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.

6 participants