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

[CI] Pull requests migration to buildkite #3573

Merged
merged 54 commits into from
Oct 30, 2023
Merged

Conversation

pazone
Copy link
Contributor

@pazone pazone commented Oct 9, 2023

What does this PR do?

Migrates pull request workflow from Jenkins and Github Actions to Buildkite

Migration of Jenkins jobs to new ephemeral VMs:

  • Ubuntu
  • Windows
  • macOS (orka)

Now the pipeline runs build and unit tests on all supported OS in buildkike.
Code coverage files are being downloaded by the merge-coverage. Due to platform dependent code we merge coverage results from all platforms and publish the merged coverage report to sonarQube.

@pazone pazone added the enhancement New feature or request label Oct 9, 2023
@mergify mergify bot assigned pazone Oct 9, 2023
@mergify
Copy link
Contributor

mergify bot commented Oct 9, 2023

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

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

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

@mergify mergify bot added the backport-skip label Oct 9, 2023
@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 9, 2023

❕ Build Aborted

There is a new build on-going so the previous on-going builds have been aborted.

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Start Time: 2023-10-30T13:50:36.143+0000

  • Duration: 3 min 49 sec

Steps errors 1

Expand to view the steps failures

Error signal
  • Took 0 min 0 sec . View more details here
  • Description: tar: step failed with error null

🤖 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.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

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

@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 9, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 98.81% (83/84) 👍
Files 66.997% (203/303) 👍
Classes 65.946% (366/555) 👍
Methods 53.241% (1158/2175) 👍
Lines 39.578% (13634/34448) 👎 -0.02
Conditionals 100.0% (0/0) 💚

Copy link

@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.

Thank you for this massive work!
Basically LGTM from me, left some minor comments.

Is https://buildkite.com/elastic/elastic-agent/builds/4389 an example run where we can see this work in operation?

@@ -0,0 +1,27 @@
$ErrorActionPreference = "Stop"

Write-Host "-- Fixing CRLF in git checkout --"

Choose a reason for hiding this comment

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

nit: if this is meant to be used for creating a collapsed section in the buildkite output shouldn't it have three dashes --- as per https://buildkite.com/docs/pipelines/managing-log-output#collapsing-output?

.buildkite/hooks/post-checkout.ps1 Show resolved Hide resolved
agents:
image: "golang:1.20.10"
depends_on:
- unit-tests-2204

Choose a reason for hiding this comment

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

Alternatively, all the unit-tests* could live in a different group e.g. called unit-tests and this and following steps in another group e.g. test-reports using `depends_on: "unit-tests"

.buildkite/scripts/steps/merge.sh Show resolved Hide resolved
Copy link
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.

from what i can tell it looks good.
thanks for making upgrade more stable

@@ -386,14 +386,16 @@ func copyDir(l *logger.Logger, from, to string, ignoreErrs bool) error {
}
}

// Try to detect if we are running with SSDs. If we are increase the copy concurrency,
// otherwise fall back to the default.
copyConcurrency := 1
Copy link
Member

Choose a reason for hiding this comment

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

I changed this a bit, if I merge #3653 before you merge this you'll have a conflict to resolve.

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

Overall the changes to make this run under buildkite look great. Only issue I see and the reason I am making it a blocker is because the RACE_DETECTOR was not enabled, something that we need to keep enabled when running the unit tests.

.ci/Jenkinsfile Show resolved Hide resolved
@mergify
Copy link
Contributor

mergify bot commented Oct 30, 2023

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 buildkite_pull_requests upstream/buildkite_pull_requests
git merge upstream/main
git push upstream buildkite_pull_requests

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

Thanks for enabling the race detector. Looks good now.

@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
0.0% 0.0% Duplication

@pazone pazone merged commit bf78cc1 into main Oct 30, 2023
7 checks passed
@pazone pazone deleted the buildkite_pull_requests branch October 30, 2023 14:44
@elasticmachine
Copy link
Contributor

💚 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: 2023-10-30T13:51:36.919+0000

  • Duration: 94 min 46 sec

Test stats 🧪

Test Results
Failed 0
Passed 4941
Skipped 57
Total 4998

💚 Flaky test report

Tests succeeded.

🤖 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.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

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

@pazone pazone added backport-v8.9.0 Automated backport with mergify backport-v8.10.0 Automated backport with mergify backport-v8.11.0 Automated backport with mergify labels Nov 7, 2023
mergify bot pushed a commit that referenced this pull request Nov 7, 2023
* buildkite test on Ubuntu

* Fixed step ids

* fix image family

* Use aws from arm64

* try windows post-checkout hook

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* set GOPATH

* set GOPATH

* set GOPATH

* set GOPATH

* set GOPATH

* Installed GCC

* Installed GCC

* Installed GCC

* Windows 2016

* Propagate exit code on windows

* Added GOTMPDIR

* Added GOTMPDIR

* Merge coverage reports step

* Merge coverage reports step

* Merge coverage reports step

* changed installation path

* changed installation path

* changed installation path

* changed installation path

* changed installation path

* changed installation path

* test

* test

* merge.sh

* Added coverage.out to simplify artifacts download

* Fixed artifacts copy

* buildite orka integration

* fix os name

* Add err message to upgrade test

* Fix autocrlf for windows

* Craig's patch

* Complete test pipeline

* Complete test pipeline

* Remove macos GHA workflow

* Fix Processing test results step

* fix k8s jenkins step

* Removed m1 stage

* Enabled race detector for unit tests

* Enables race detector for windows

(cherry picked from commit bf78cc1)

# Conflicts:
#	.buildkite/pipeline.yml
#	.buildkite/scripts/common.sh
#	.buildkite/scripts/steps/unit-tests.sh
#	.ci/Jenkinsfile
mergify bot pushed a commit that referenced this pull request Nov 7, 2023
* buildkite test on Ubuntu

* Fixed step ids

* fix image family

* Use aws from arm64

* try windows post-checkout hook

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* set GOPATH

* set GOPATH

* set GOPATH

* set GOPATH

* set GOPATH

* Installed GCC

* Installed GCC

* Installed GCC

* Windows 2016

* Propagate exit code on windows

* Added GOTMPDIR

* Added GOTMPDIR

* Merge coverage reports step

* Merge coverage reports step

* Merge coverage reports step

* changed installation path

* changed installation path

* changed installation path

* changed installation path

* changed installation path

* changed installation path

* test

* test

* merge.sh

* Added coverage.out to simplify artifacts download

* Fixed artifacts copy

* buildite orka integration

* fix os name

* Add err message to upgrade test

* Fix autocrlf for windows

* Craig's patch

* Complete test pipeline

* Complete test pipeline

* Remove macos GHA workflow

* Fix Processing test results step

* fix k8s jenkins step

* Removed m1 stage

* Enabled race detector for unit tests

* Enables race detector for windows

(cherry picked from commit bf78cc1)

# Conflicts:
#	.buildkite/pipeline.yml
#	.buildkite/scripts/steps/unit-tests.sh
#	.ci/Jenkinsfile
mergify bot pushed a commit that referenced this pull request Nov 7, 2023
* buildkite test on Ubuntu

* Fixed step ids

* fix image family

* Use aws from arm64

* try windows post-checkout hook

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* set GOPATH

* set GOPATH

* set GOPATH

* set GOPATH

* set GOPATH

* Installed GCC

* Installed GCC

* Installed GCC

* Windows 2016

* Propagate exit code on windows

* Added GOTMPDIR

* Added GOTMPDIR

* Merge coverage reports step

* Merge coverage reports step

* Merge coverage reports step

* changed installation path

* changed installation path

* changed installation path

* changed installation path

* changed installation path

* changed installation path

* test

* test

* merge.sh

* Added coverage.out to simplify artifacts download

* Fixed artifacts copy

* buildite orka integration

* fix os name

* Add err message to upgrade test

* Fix autocrlf for windows

* Craig's patch

* Complete test pipeline

* Complete test pipeline

* Remove macos GHA workflow

* Fix Processing test results step

* fix k8s jenkins step

* Removed m1 stage

* Enabled race detector for unit tests

* Enables race detector for windows

(cherry picked from commit bf78cc1)
pazone added a commit that referenced this pull request Nov 7, 2023
* buildkite test on Ubuntu

* Fixed step ids

* fix image family

* Use aws from arm64

* try windows post-checkout hook

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* Windows pre-command hook and unit tests ps

* set GOPATH

* set GOPATH

* set GOPATH

* set GOPATH

* set GOPATH

* Installed GCC

* Installed GCC

* Installed GCC

* Windows 2016

* Propagate exit code on windows

* Added GOTMPDIR

* Added GOTMPDIR

* Merge coverage reports step

* Merge coverage reports step

* Merge coverage reports step

* changed installation path

* changed installation path

* changed installation path

* changed installation path

* changed installation path

* changed installation path

* test

* test

* merge.sh

* Added coverage.out to simplify artifacts download

* Fixed artifacts copy

* buildite orka integration

* fix os name

* Add err message to upgrade test

* Fix autocrlf for windows

* Craig's patch

* Complete test pipeline

* Complete test pipeline

* Remove macos GHA workflow

* Fix Processing test results step

* fix k8s jenkins step

* Removed m1 stage

* Enabled race detector for unit tests

* Enables race detector for windows

(cherry picked from commit bf78cc1)

Co-authored-by: Pavel Zorin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip backport-v8.9.0 Automated backport with mergify backport-v8.10.0 Automated backport with mergify backport-v8.11.0 Automated backport with mergify enhancement New feature or request skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants