Skip to content

ci: Daily Releasable Artifacts pipeline#7530

Merged
v1v merged 30 commits into
elastic:mainfrom
v1v:feature/dra-second-approach
Mar 18, 2022
Merged

ci: Daily Releasable Artifacts pipeline#7530
v1v merged 30 commits into
elastic:mainfrom
v1v:feature/dra-second-approach

Conversation

@v1v
Copy link
Copy Markdown
Member

@v1v v1v commented Mar 14, 2022

Motivation/summary

Daily Releasable Artifacts pipeline for APM Server only on branches

Issues

Superseedes #7529
Requires #7531

Further details

This new pipeline will be triggered automatically after a build in the CI for the active branches has finished successfully.

  1. Docker login to fetch the docker image for the release-manager
  2. Build artifacts like tarballs, Debian packages, RPMs, zips, Docker images, etc. This needs to happen on at least two different platforms, as AArch64 images must be built on an AArch64 host. These should run in parallel.
  3. A following stage that combines them and runs a release-manager container to upload them to GCS.
  4. Notification in Slack, and email, if (and only if) the pipeline fails.

For clarity, it won't run on a PR basis, though it's possible to manually kick off a build in -> here I enabled the support for manual builds for PRs to help with this implementation, potentially to be removed, if so, then https://github.com/elastic/apm-server/blob/main/.ci/jobs/apm-server-package-mbp.yml#L17 should be changed to exclude PR-*

Test

I ran a few iterations within this PR to be able to validate it works as expected:

  1. build-4 generated all the packages for AMD64 and ARM64. (It failed afterwards for some typo)
  2. build-7 used the above generated packages and run the release-manager successfully. (I wanted to confirm the DRA staged worked). https://artifacts-snapshot.elastic.co/apm-server/8.2.0-7c2a7da4/summary-8.2.0-SNAPSHOT.html was generated
  3. build-12 is the one that will validate all the above steps together.

If it works then I'll revert e461a46 and ask for the review

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Mar 14, 2022

This pull request does not have a backport label. Could you fix it @v1v? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-7.x is the label to automatically backport to the 7.x branch.
  • backport-7./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify Bot added the backport-skip Skip notification from the automated backport with mergify label Mar 14, 2022
@v1v v1v marked this pull request as draft March 14, 2022 10:55
@v1v v1v added backport-8.0 Automated backport with mergify backport-8.1 Automated backport with mergify backport-8.2 Automated backport with mergify backport-7.17 Automated backport with mergify to the 7.17 branch labels Mar 14, 2022
@mergify mergify Bot removed the backport-skip Skip notification from the automated backport with mergify label Mar 14, 2022
@ghost
Copy link
Copy Markdown

ghost commented Mar 14, 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-03-18T08:50:48.523+0000

  • Duration: 27 min 48 sec

Test stats 🧪

Test Results
Failed 0
Passed 3911
Skipped 13
Total 3924

🤖 GitHub comments

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

  • /test : Re-trigger the build.

  • /hey-apm : Run the hey-apm benchmark.

  • /package : Generate and publish the docker images.

  • /test windows : Build & tests on Windows.

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

Comment thread .ci/packaging.groovy Outdated
Comment thread .ci/packaging.groovy Outdated
Comment thread .ci/packaging.groovy Outdated
v1v and others added 11 commits March 16, 2022 14:20
it generates all the required artifacts
…er into feature/dra-second-approach

* 'feature/dra-second-approach' of github.com:v1v/apm-server:
  Update .ci/packaging.groovy
  Update .ci/packaging.groovy
  Update .ci/packaging.groovy
…approach

* upstream/main:
  jjbb: Daily Releasable Artifacts pipeline (elastic#7531)
  [Automation] Update elastic stack version to 8.2.0-ff67d7b8 for testing (elastic#7561)
  Update to elastic/beats@b9d17e0c161b (elastic#7560)
  systemtest: set min TLS version to 1.2 (elastic#7551)
  Update module deps (elastic#7552)
  [Automation] Update elastic stack version to 8.2.0-9bac538c for testing (elastic#7549)
  Update to elastic/beats@ab30a0234e1c (elastic#7546)
  [automation] update libbeat and beats packaging (elastic#7534)
  Fix modelindexer benchmarks (elastic#7533)
  [Automation] Update elastic stack version to 8.2.0-fee3b8d2 for testing (elastic#7537)
  Removed `observer.version_major` (elastic#7399)
  [Docs - OpenTelemetry] Document limitation on OTLP/HTTP not being supported (elastic#7505)
@v1v v1v marked this pull request as ready for review March 17, 2022 12:35
@v1v v1v requested review from a team March 17, 2022 12:35
@v1v v1v self-assigned this Mar 17, 2022
Comment thread .ci/packaging.groovy Outdated
Comment thread .ci/scripts/package-docker-snapshot.sh Outdated

export PLATFORMS='linux/amd64'
# linux/amd64 is in the default list already
export PLATFORMS="${PLATFORMS:-+linux/amd64}"
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.

IIRC PLATFORMS="+linux/amd64" will build the defaults platform plus linux/amd64, if you set PLATFORMS='linux/amd64' it build only linux/amd64

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.

I dunno which behaviour we want here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In fact, I don't need this anymore, it was wrongly copied from another PR that I worked with

Co-authored-by: Ivan Fernandez Calvo <kuisathaverat@users.noreply.github.com>
Comment thread .ci/scripts/package-docker-snapshot.sh Outdated
Copy link
Copy Markdown
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

This looks great, thank you.

Are you going to remove the Package stage from the top-level pipeline?

Comment thread .ci/scripts/release-manager.sh
Comment thread .ci/packaging.groovy
unstash 'source'
dir("${BASE_DIR}"){
withMageEnv() {
sh(label: 'make release-manager-snapshot', script: 'make release-manager-snapshot')
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.

I just realised we're only ever building/publishing snapshot images. We'll need to also build staging images for release branches.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I somehow missed this particular bit, we can iterate on this after merging this PR, what do you think?

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.

Yes I think that's fine.

Co-authored-by: Andrew Wilkins <axwalk@gmail.com>
@v1v
Copy link
Copy Markdown
Member Author

v1v commented Mar 18, 2022

Are you going to remove the Package stage from the top-level pipeline?

The main pipeline runs the package on-demand too:

  • apm-server/Jenkinsfile

    Lines 478 to 500 in f8def45

    stage('Package') {
    agent { label 'linux && immutable' }
    options { skipDefaultCheckout() }
    environment {
    PATH = "${env.PATH}:${env.WORKSPACE}/bin"
    HOME = "${env.WORKSPACE}"
    SNAPSHOT = "true"
    }
    when {
    beforeAgent true
    allOf {
    expression { return params.release_ci }
    expression { return env.ONLY_DOCS == "false" }
    anyOf {
    branch 'main'
    branch pattern: '\\d+\\.\\d+', comparator: 'REGEXP'
    tag pattern: 'v\\d+\\.\\d+\\.\\d+.*', comparator: 'REGEXP'
    expression { return isPR() && env.BEATS_UPDATED != "false" }
    expression { return env.GITHUB_COMMENT?.contains('package tests') || env.GITHUB_COMMENT?.contains('/package')}
    expression { return params.Run_As_Main_Branch }
    }
    }
    }

I'm inclined to keep it for now, since this new pipeline will only work for the main/x.y branches

Comment thread .ci/packaging.groovy Outdated
Co-authored-by: Mike Place <mike.place@elastic.co>
Copy link
Copy Markdown
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

thank you very much :)

@v1v v1v merged commit 687f632 into elastic:main Mar 18, 2022
mergify Bot pushed a commit that referenced this pull request Mar 18, 2022
mergify Bot pushed a commit that referenced this pull request Mar 18, 2022
mergify Bot pushed a commit that referenced this pull request Mar 18, 2022
v1v added a commit that referenced this pull request Mar 21, 2022
* ci: Daily Releasable Artifacts pipeline (#7530)

(cherry picked from commit 687f632)

* ci: -SNAPSHOT suffix is required (#7585)

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
v1v added a commit that referenced this pull request Mar 21, 2022
* ci: Daily Releasable Artifacts pipeline (#7530)

(cherry picked from commit 687f632)

* ci: -SNAPSHOT suffix is required (#7585)

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
v1v added a commit that referenced this pull request Mar 21, 2022
* ci: Daily Releasable Artifacts pipeline (#7530)

(cherry picked from commit 687f632)

* ci: -SNAPSHOT suffix is required (#7585)

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-7.17 Automated backport with mergify to the 7.17 branch backport-8.0 Automated backport with mergify backport-8.1 Automated backport with mergify backport-8.2 Automated backport with mergify

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants