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

[buildkite] DRA staging + snapshot pipelines #15344

Merged

Conversation

dliappis
Copy link
Contributor

@dliappis dliappis commented Sep 25, 2023

This commit adds support for building + publishing DRA (-SNAPSHOT for
now) artifacts for Logstash. It builds on top of elastic#15312 and therefore
only targets the `main` branch and is intended to be run manually
during a trial period before we retire the corresponding Jenkins job.

The structure is similar to Jenkins:

1. Three steps runs in parallel to build packages, x86_64 docker and
aarch64 docker artifacts.

2. Once 1. is successfully done, use release manager to publish the
artifacts.

We generate the pipeline steps for 1. and 2. dynamically (with a simple
Python script) to avoid repetition for future PRs: we will add a new
pipeline in a follow up PR to orchestrate scheduled runs of this
pipeline for the required branches.

Relates: elastic/ingest-dev#1720
Commit a -staging DRA job and refactor for DRY.

Relates: elastic/ingest-dev#1720
@dliappis dliappis marked this pull request as ready for review September 29, 2023 15:15
@dliappis
Copy link
Contributor Author

dliappis commented Sep 29, 2023

This is now ready for review.

Note that it does NOT yet do, is run the -snapshot jobs on a schedule (it's commented out in the code), neither ping the slack channel, so that we do this as the final step when we are ready to decommission Jenkins.

I've checked .deb and windows artifacts pulled from Jenkins and Buildkite DRA -snapshot jobs and they seem to be identical e.g.:

$ debdiff jenkins-dra-snapshot-sep-29-2023/logstash-8.11.0-SNAPSHOT-amd64.deb buildkite-main-build-104/logstash-8.11.0-SNAPSHOT-amd64.deb 
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Maintainer: [-<@logstash-ci-immutable-ubuntu-2004-lts-1695953589908309127>-] {+<buildkite-agent@bk-agent-prod-gcp-1695981146019345527>+}
$ diff <(unzip -vqq jenkins-dra-snapshot-sep-29-2023/logstash-8.11.0-SNAPSHOT-windows-x86_64.zip | awk '{$2=""; $3=""; $4=""; $5=""; $6=""; $7=""; print}' | sort -k3) <(unzip -vqq buildkite-main-build-104/logstash-8.11.0-SNAPSHOT-windows-x86_64.zip | awk '{$2=""; $3=""; $4=""; $5=""; $6=""; $7=""; print}' | sort -k3)

@dliappis dliappis added the DRA Daily releasable artifacts label Sep 29, 2023
@dliappis
Copy link
Contributor Author

dliappis commented Oct 2, 2023

I did an additional validation and compared all the produced .deb artifacts from Sat 30 2023 between the Jenkins -SNAPSHOT DRA Job and Buildkite job 106 and they are looking good:

$ for fname in jenkins-dra-snapshot-sep-30-2023/*.deb; do fn=${fname#*/}; echo ">>> Comparing [jenkins-dra-snapshot-sep-30-2023/$fn] with [buildkite-main-build-106-sep-30-2023/$fn]"; debdiff jenkins-dra-snapshot-sep-30-2023/$fn buildkite-main-build-106-sep-30-2023/$fn; done
>>> Comparing [jenkins-dra-snapshot-sep-30-2023/logstash-8.11.0-SNAPSHOT-amd64.deb] with [buildkite-main-build-106-sep-30-2023/logstash-8.11.0-SNAPSHOT-amd64.deb]
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Maintainer: [-<@logstash-ci-immutable-ubuntu-2004-lts-1696039986267210222>-] {+<buildkite-agent@bk-agent-prod-gcp-1696063492643437294>+}
>>> Comparing [jenkins-dra-snapshot-sep-30-2023/logstash-8.11.0-SNAPSHOT-arm64.deb] with [buildkite-main-build-106-sep-30-2023/logstash-8.11.0-SNAPSHOT-arm64.deb]
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Maintainer: [-<@logstash-ci-immutable-ubuntu-2004-lts-1696039986267210222>-] {+<buildkite-agent@bk-agent-prod-gcp-1696063492643437294>+}
>>> Comparing [jenkins-dra-snapshot-sep-30-2023/logstash-8.11.0-SNAPSHOT-no-jdk.deb] with [buildkite-main-build-106-sep-30-2023/logstash-8.11.0-SNAPSHOT-no-jdk.deb]
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Maintainer: [-<@logstash-ci-immutable-ubuntu-2004-lts-1696039986267210222>-] {+<buildkite-agent@bk-agent-prod-gcp-1696063492643437294>+}
>>> Comparing [jenkins-dra-snapshot-sep-30-2023/logstash-oss-8.11.0-SNAPSHOT-amd64.deb] with [buildkite-main-build-106-sep-30-2023/logstash-oss-8.11.0-SNAPSHOT-amd64.deb]
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Maintainer: [-<@logstash-ci-immutable-ubuntu-2004-lts-1696039986267210222>-] {+<buildkite-agent@bk-agent-prod-gcp-1696063492643437294>+}
>>> Comparing [jenkins-dra-snapshot-sep-30-2023/logstash-oss-8.11.0-SNAPSHOT-arm64.deb] with [buildkite-main-build-106-sep-30-2023/logstash-oss-8.11.0-SNAPSHOT-arm64.deb]
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Maintainer: [-<@logstash-ci-immutable-ubuntu-2004-lts-1696039986267210222>-] {+<buildkite-agent@bk-agent-prod-gcp-1696063492643437294>+}
>>> Comparing [jenkins-dra-snapshot-sep-30-2023/logstash-oss-8.11.0-SNAPSHOT-no-jdk.deb] with [buildkite-main-build-106-sep-30-2023/logstash-oss-8.11.0-SNAPSHOT-no-jdk.deb]
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Maintainer: [-<@logstash-ci-immutable-ubuntu-2004-lts-1696039986267210222>-] {+<buildkite-agent@bk-agent-prod-gcp-1696063492643437294>+}

I also diff'ed one rpm package using:

$ pkgdiff jenkins-dra-snapshot-sep-30-2023/logstash-8.11.0-SNAPSHOT-x86_64.rpm buildkite-main-build-106-sep-30-2023/logstash-8.11.0-SNAPSHOT-x86_64.rpm 
reading packages ...
comparing packages ...
creating report ...
result: CHANGED (0.0001%)
report: pkgdiff_reports/logstash/8.11.0~SNAPSHOT-1_to_8.11.0~SNAPSHOT-1/changes_report.html

and it looks good, the 0.0001% difference is mostly related to the package info (and the build date):

image with the diff pointing to differences in build date:

image

Now that we have a new logstash BK team, group the DRA pipelines
under this team. Also grant rights to the right groups.
@elastic-sonarqube
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@dliappis dliappis merged commit da51a6a into elastic:main Oct 2, 2023
2 checks passed
dliappis added a commit to dliappis/logstash that referenced this pull request Oct 5, 2023
dliappis added a commit to dliappis/logstash that referenced this pull request Oct 5, 2023
dliappis added a commit that referenced this pull request Oct 6, 2023
This is a backport of the DRA pipeline and related scripts from:

- #15366
- #15365
- #15356
- #15352
- #15344
- #15343
- #15337
- #15312

Note that it's a manual backport because some PRs (e.g. #15312) contain files (`catalog-info.yaml`) that should only
live on the `main` branch.
dliappis added a commit that referenced this pull request Oct 6, 2023
This is a backport of the DRA pipeline and related scripts from:

- #15366
- #15365
- #15356
- #15352
- #15344
- #15343
- #15337
- #15312

Note that it's a manual backport because some PRs (e.g. #15312) contain files (`catalog-info.yaml`) that should only
live on the `main` branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DRA Daily releasable artifacts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants