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

Packaging for elastic agent #126

Merged
merged 5 commits into from
Sep 29, 2022
Merged

Conversation

michalpristas
Copy link
Contributor

@michalpristas michalpristas commented Sep 26, 2022

What does this PR do?

This PR introduces a mage package command.
Result of this mage package command is an archive consisting of

  • binary
  • spec file
  • config file

This archive is then consumed by elastic-agent and included in agent release artifact

Why is it important?

For agent to be able to work with shipper

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 added an entry in CHANGELOG.md or CHANGELOG-developer.md.

@michalpristas michalpristas added enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Sep 26, 2022
@michalpristas michalpristas self-assigned this Sep 26, 2022
@michalpristas michalpristas requested a review from a team as a code owner September 26, 2022 07:10
@michalpristas michalpristas requested review from faec and leehinman and removed request for a team September 26, 2022 07:10
@mergify
Copy link
Contributor

mergify bot commented Sep 26, 2022

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @michalpristas? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 26, 2022

💚 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: 2022-09-27T07:22:39.925+0000

  • Duration: 11 min 5 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

Copy link
Contributor

@leehinman leehinman left a comment

Choose a reason for hiding this comment

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

be good to see if @faec has input before merging

magefile.go Outdated
archiveFullPath := filepath.Join(archivePath, archiveFileName)
archive, err := os.Open(archiveFullPath)
if err != nil {
panic(errors.Wrapf(err, "failed opening archive %q", archiveFileName))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. We have been trying to get away from the "github.com/pkg/errors" package and just go with the std library "errors" package. Would you mind switching?

Copy link
Member

Choose a reason for hiding this comment

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

We should be able to just block this in the linter config: https://github.com/elastic/beats/blob/d777593494788495055fc5b0259613c33fb51e9a/.golangci.yml#L91-L101

For reference pkg/errors and the stdlib errors are almost but not quite compatible. See elastic/beats#31702.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep

@mergify
Copy link
Contributor

mergify bot commented Sep 26, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feat/packaging upstream/feat/packaging
git merge upstream/main
git push upstream feat/packaging

Copy link
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

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

Confirmed the mage package target works locally for me, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request 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.

4 participants