Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.13](backport #39126) Beats DRA pipeline #39198

Merged
merged 12 commits into from
May 3, 2024
Merged

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Apr 24, 2024

Proposed commit message

Beats Packaging pipeline

Migrates packaging.groovy to buildkite.
Buildkite packaging pipeline is used to build and publish the packages for the Beats. The pipeline is triggered by a commit to the main or release branches.
The pipeline definition is located in the .buildkite/packaging.pipeline.yml

Triggers

Staging packaging DRA is triggered for the main and release branches.
Snapshot can be triggered for any branch by the /package comment in the PR. The release-manager dry-run will be used for PR builds.

Pipeline steps

Beats dashboards

Generates build/distributions/dependencies.csv and adds it to the beats-dashboards artifact. The dependencies.csv is required by the release-manager configuration

Packaging snapshot/staging

  • Builds the Beats packages for all supported platforms and architectures (mage package, mage ironbank)
  • Copies artifacts build/distributions/<beat>/ directory and adds it as an artifact. Where <beat> is the name of the beat
  • x-pack artifacts a also copied to build/distributions/<beat>/ directory, where <beat> is the name of the beat. For example, auditbeat, not x-pack/auditbeat

DRA publish

Downloads the artifacts from the packaging snapshot/staging step and publishes them to the Elastic DRA registry.

Snapshot publishing example (Dry run)

Beats-tester and e2e tests are not triggered

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.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • All Snapshot and staging artifacts are built, present, and properly transferred to the corresponding DRA steps
  • DRA dry run passes
  • All artifacts have the same size and permissions as on Jenkins. (Need to check one more time)

How to test this PR locally

Related issues

Use cases

Screenshots

Logs


This is an automatic backport of pull request #39126 done by [Mergify](https://mergify.com).

* Packaging pipieline resource

* Revetred agentbeat pipeline deletion

* Cleanup

* Test auditbeat packaging pipeline

* Fix steps keys

* Fix steps keys

* Fix env vars

* Fix env vars

* Fix env vars

* Unified artifacts dir

* Implemented DRA steps

* Test filebeat

* Test matrix

* Aligned artifacts directories

* Aligned artifacts directories

* Aligned artifacts directories

* Aligned artifacts directories

* Debug

* Debug

* Package all beats

* Test DRA snapshot

* Test DRA snapshot

* Rename artifacts

* fix dashboards artifacts

* Cleanup

* cleanup

* No need to install msi tools

* Apply suggestions from code review

Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>

* Extraced platforms variables

* Cleanup

* Added RUN_SNAPSHOT condition

* Cleanup

* Boolean dry-run

* Boolean dry-run

---------

Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>
(cherry picked from commit c6444db)

# Conflicts:
#	.buildkite/packaging.pipeline.yml
@mergify mergify bot requested a review from a team as a code owner April 24, 2024 15:50
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Apr 24, 2024
@mergify mergify bot assigned pazone Apr 24, 2024
Copy link
Contributor Author

mergify bot commented Apr 24, 2024

Cherry-pick of c6444db has failed:

On branch mergify/bp/8.13/pr-39126
Your branch is up to date with 'origin/8.13'.

You are currently cherry-picking commit c6444db544.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   .buildkite/packaging.pipeline.md
	new file:   .buildkite/scripts/dra.sh
	new file:   .buildkite/scripts/packaging/package-dra.sh
	new file:   .buildkite/scripts/packaging/prepare-release-manager.sh

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   .buildkite/packaging.pipeline.yml

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 24, 2024
@botelastic
Copy link

botelastic bot commented Apr 24, 2024

This pull request doesn't have a Team:<team> label.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Apr 24, 2024

💚 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

  • Duration: 13 min 22 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.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

pazone and others added 6 commits April 25, 2024 15:36
This PR fixes a number of bugs from #39126
This commit fixes the error
"interpolating remaining fields: Expected identifier to start with a letter, got /"
This commit fixes the release-manager error

> # > java.io.FileNotFoundException: /artifacts/build/distributions/... (Permission denied)

by adjusting the permissions of parent directories.
Additionally there are a few logging enhancements to improve debugging, as well as the introduction
of a new optional `DRA_BRANCH` environment variable, to help running and debugging via PRs.

Relates elastic/ingest-dev#3095

---------

Signed-off-by: Alexandros Sapranidis <alexandros@elastic.co>
Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>
…39217)

Added DEV flag to snapshot builds. Specified the workflow for prepare-release-manager.sh

Relates: elastic/ingest-dev#3095
Copy link
Contributor Author

mergify bot commented Apr 29, 2024

This pull request has not been merged yet. Could you please review and merge it @pazone? 🙏

pazone and others added 4 commits April 30, 2024 19:34
As things are now we allow parallel builds on the
packaging pipeline, which could result in out of order
artifacts (depending on which one takes longer to finish).

This commit implements two "queues" (snapshot/staging)
to ensure ordered builds of DRA artifacts.

Relates elastic/ingest-dev#3095
The DRA staging release is failing because the Buildkite step isn't capturing the right artifacts.
This commit fixes the issue by adjusting the artifact_paths to match the other steps.
* Fix the annotating for snapshot and staging

This commit adds the `--append` flag to the buildkite-annotate so that
when it is called by the snapshot and staging steps, it will not overwrite
the other annotation.

Signed-off-by: Alexandros Sapranidis <alexandros@elastic.co>
Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

Looks great! I will LGTM it once we've also cherry-picked 40c68cf (i.e. #39298) into it.

.buildkite/packaging.pipeline.yml Show resolved Hide resolved
PR #39293 introduced one concurrency queue per staging/snapshot but
this slows down unnecessarily concurrent DRA builds for main and other
release branches.

This commit makes the concurrency gates (additionally) specific per branch.
@dliappis
Copy link
Contributor

dliappis commented May 2, 2024

Looks great! I will LGTM it once we've also cherry-picked 40c68cf (i.e. #39298) into it.

This is now cherry-picked via 77c2571

@dliappis dliappis self-requested a review May 2, 2024 11:03
@dliappis dliappis removed the conflicts There is a conflict in the backported pull request label May 2, 2024
@dliappis dliappis requested a review from alexsapran May 2, 2024 11:03
Copy link
Contributor

@dliappis dliappis left a comment

Choose a reason for hiding this comment

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

LGTM

@dliappis dliappis merged commit a3ba8e5 into 8.13 May 3, 2024
107 checks passed
@dliappis dliappis deleted the mergify/bp/8.13/pr-39126 branch May 3, 2024 07:04
dliappis added a commit to dliappis/beats that referenced this pull request May 3, 2024
Now that DRA support via Buildkite has also been backported to 8.13[^1]
this commit widens the whitelisted branches that can trigger Buildkite
DRA builds to include all 8.x branches.

Relates: elastic/ingest-dev#3095

[^1]: elastic#39198
dliappis added a commit that referenced this pull request May 3, 2024
Now that DRA support via Buildkite has also been backported to 8.13[^1]
this commit widens the whitelisted branches that can trigger Buildkite
DRA builds to include all 8.x branches.

Relates: elastic/ingest-dev#3095

[^1]: #39198
mergify bot pushed a commit that referenced this pull request May 3, 2024
Now that DRA support via Buildkite has also been backported to 8.13[^1]
this commit widens the whitelisted branches that can trigger Buildkite
DRA builds to include all 8.x branches.

Relates: https://github.com/elastic/ingest-dev/issues/3095

[^1]: #39198

(cherry picked from commit 7e203ad)
mergify bot pushed a commit that referenced this pull request May 3, 2024
Now that DRA support via Buildkite has also been backported to 8.13[^1]
this commit widens the whitelisted branches that can trigger Buildkite
DRA builds to include all 8.x branches.

Relates: https://github.com/elastic/ingest-dev/issues/3095

[^1]: #39198

(cherry picked from commit 7e203ad)
mergify bot pushed a commit that referenced this pull request May 3, 2024
Now that DRA support via Buildkite has also been backported to 8.13[^1]
this commit widens the whitelisted branches that can trigger Buildkite
DRA builds to include all 8.x branches.

Relates: https://github.com/elastic/ingest-dev/issues/3095

[^1]: #39198

(cherry picked from commit 7e203ad)
dliappis added a commit that referenced this pull request May 3, 2024
Now that DRA support via Buildkite has also been backported to 8.13[^1]
this commit widens the whitelisted branches that can trigger Buildkite
DRA builds to include all 8.x branches.

Relates: https://github.com/elastic/ingest-dev/issues/3095

[^1]: #39198

(cherry picked from commit 7e203ad)

Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>
dliappis added a commit that referenced this pull request May 3, 2024
Now that DRA support via Buildkite has also been backported to 8.13[^1]
this commit widens the whitelisted branches that can trigger Buildkite
DRA builds to include all 8.x branches.

Relates: https://github.com/elastic/ingest-dev/issues/3095

[^1]: #39198

(cherry picked from commit 7e203ad)

Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>
dliappis added a commit that referenced this pull request May 3, 2024
Now that DRA support via Buildkite has also been backported to 8.13[^1]
this commit widens the whitelisted branches that can trigger Buildkite
DRA builds to include all 8.x branches.

Relates: https://github.com/elastic/ingest-dev/issues/3095

[^1]: #39198

(cherry picked from commit 7e203ad)

Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants