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

Ess terraform + run integration tests on BK agents #5113

Merged
merged 123 commits into from
Oct 8, 2024
Merged

Ess terraform + run integration tests on BK agents #5113

merged 123 commits into from
Oct 8, 2024

Conversation

pazone
Copy link
Contributor

@pazone pazone commented Jul 10, 2024

What does this PR do?

A dedicated pipeline that runs Ubuntu integration tests directly on Buildkite runners without OGC. Currently it's not triggered by any of Github events.
Sudo tests build example

  • Improves groupping transparency. We can now immediately see long-running groups;
  • Adds the ability to rerun failed groups instead of the entire pipeline build;
  • Introduces a simple terraform configuration for ESS stack instead of a complex stack provisioner;
  • Uses prebuilt VM images platform-ingest-elastic-agent-ubuntu-2204. All required packages are pre-installed and we don't need to install them in runtime;
  • Adds the ability to use all the gobld-supported CSPs and VMs incl. ARM64 and MacOS.

Shared ESS stack and test reruns

The Start ESS stack for integration tests spins up an ESS stack that is used by following integration tests. When the tests are complete, the stack will be destroyed regardless of the test results. When we restart a single test group, it will start a dedicated stack and destroy it when the tests are complete.

Screenshot 2024-10-07 at 11 53 03

This type of pipeline is supposed to replace the existing single-step approach. Further upcoming changes a listed in the the meta-issue.

Why is it important?

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/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

How to test this PR locally

Related issues

Questions to ask yourself

  • How are we going to support this in production?
  • How are we going to measure its adoption?
  • How are we going to debug this?
  • What are the metrics I should take care of?
  • ...

@pazone pazone added the enhancement New feature or request label Jul 10, 2024
@pazone pazone changed the title Ess terraform Ess terraform + run integration tests on BK agents Jul 10, 2024
Copy link
Contributor

mergify bot commented Jul 10, 2024

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.

Copy link

@ycombinator ycombinator added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team and removed Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Jul 11, 2024
Copy link
Contributor

mergify bot commented Jul 16, 2024

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

Copy link

@pazone pazone merged commit 7aa8bb2 into main Oct 8, 2024
14 checks passed
@pazone pazone deleted the ess_terraform branch October 8, 2024 08:35
mergify bot pushed a commit that referenced this pull request Oct 8, 2024
* ESS by terraforms

* Use bk runners

* added state to artifacts

* Add common.sh to scripts

* Add depends_on

* Inlined paclage variables

* tmp disbale unit tests

* tmp disbale unit tests

* install tf

* install tf

* install tf

* install tf

* fix ec creds

* Added auto-approve

* Test run

* package again

* package again

* package again

* package again

* package

* package

* added mage build:testBinaries

* Install mage

* Install mage

* Install mage

* Install mage

* Install mage

* fix go

* Merged

* Merged

* fix

* fix

* Fix tests

* Debug

* Use custom image

* New suod tests

* Test run

* Test run

* Test run

* Debug

* Debug

* Debug

* Debug

* Debug

* Cleanup

* Using subshell in newgrp

* Using subshell in newgrp

* Test new custom VM image

* Test new custom VM image

* Set terraform version

* Cleanup

* terraform 1.9.3

* terraform 1.9.3

* Debug

* Explicit image version

* Explicit image version

* Explicit image version

* Sudo tests

* +x

* Try mage integration:local

* Use gotestsum

* Use gotestsum

* Run sudo tests

* Run sudo tests

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Increased test timeout

* Groupped sudo tests

* Quoted regexps

* BK steps by groups

* BK steps by groups

* BK steps by groups

* BK steps by groups

* fix param propagation

* Debug

* Big run

* reuse EC_API_KEY

* Debug test

* Debug a test

* Revert debug

* Debug

* Html report

* groupping, auto-retry, packaging

* removed reruns

* Reuse the initial ESS stack. Start a new stack for retries

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Debug

* Debug

* Debug

* Fix EC_KEY recovery

* Added lock to artifacts

* Fix artifacts download path

* Fix artifacts download path

* Fix artifacts download path

* Removed unnecessaru build dependencies

* Added build id

* Separated BK integration tests to a dedicated pipeline

* CLeanup

* Applied proposed changes

* Applied proposed changes

* Applied proposed changes

(cherry picked from commit 7aa8bb2)
pierrehilbert pushed a commit that referenced this pull request Oct 9, 2024
* ESS by terraforms

* Use bk runners

* added state to artifacts

* Add common.sh to scripts

* Add depends_on

* Inlined paclage variables

* tmp disbale unit tests

* tmp disbale unit tests

* install tf

* install tf

* install tf

* install tf

* fix ec creds

* Added auto-approve

* Test run

* package again

* package again

* package again

* package again

* package

* package

* added mage build:testBinaries

* Install mage

* Install mage

* Install mage

* Install mage

* Install mage

* fix go

* Merged

* Merged

* fix

* fix

* Fix tests

* Debug

* Use custom image

* New suod tests

* Test run

* Test run

* Test run

* Debug

* Debug

* Debug

* Debug

* Debug

* Cleanup

* Using subshell in newgrp

* Using subshell in newgrp

* Test new custom VM image

* Test new custom VM image

* Set terraform version

* Cleanup

* terraform 1.9.3

* terraform 1.9.3

* Debug

* Explicit image version

* Explicit image version

* Explicit image version

* Sudo tests

* +x

* Try mage integration:local

* Use gotestsum

* Use gotestsum

* Run sudo tests

* Run sudo tests

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Increased test timeout

* Groupped sudo tests

* Quoted regexps

* BK steps by groups

* BK steps by groups

* BK steps by groups

* BK steps by groups

* fix param propagation

* Debug

* Big run

* reuse EC_API_KEY

* Debug test

* Debug a test

* Revert debug

* Debug

* Html report

* groupping, auto-retry, packaging

* removed reruns

* Reuse the initial ESS stack. Start a new stack for retries

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Debug

* Debug

* Debug

* Fix EC_KEY recovery

* Added lock to artifacts

* Fix artifacts download path

* Fix artifacts download path

* Fix artifacts download path

* Removed unnecessaru build dependencies

* Added build id

* Separated BK integration tests to a dedicated pipeline

* CLeanup

* Applied proposed changes

* Applied proposed changes

* Applied proposed changes

(cherry picked from commit 7aa8bb2)

Co-authored-by: Pavel Zorin <[email protected]>
@oakrizan oakrizan added backport-8.16 Automated backport with mergify backport-8.17 Automated backport with mergify backport-8.15 Automated backport to the 8.15 branch with mergify and removed backport-skip labels Dec 11, 2024
mergify bot pushed a commit that referenced this pull request Dec 11, 2024
* ESS by terraforms

* Use bk runners

* added state to artifacts

* Add common.sh to scripts

* Add depends_on

* Inlined paclage variables

* tmp disbale unit tests

* tmp disbale unit tests

* install tf

* install tf

* install tf

* install tf

* fix ec creds

* Added auto-approve

* Test run

* package again

* package again

* package again

* package again

* package

* package

* added mage build:testBinaries

* Install mage

* Install mage

* Install mage

* Install mage

* Install mage

* fix go

* Merged

* Merged

* fix

* fix

* Fix tests

* Debug

* Use custom image

* New suod tests

* Test run

* Test run

* Test run

* Debug

* Debug

* Debug

* Debug

* Debug

* Cleanup

* Using subshell in newgrp

* Using subshell in newgrp

* Test new custom VM image

* Test new custom VM image

* Set terraform version

* Cleanup

* terraform 1.9.3

* terraform 1.9.3

* Debug

* Explicit image version

* Explicit image version

* Explicit image version

* Sudo tests

* +x

* Try mage integration:local

* Use gotestsum

* Use gotestsum

* Run sudo tests

* Run sudo tests

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Increased test timeout

* Groupped sudo tests

* Quoted regexps

* BK steps by groups

* BK steps by groups

* BK steps by groups

* BK steps by groups

* fix param propagation

* Debug

* Big run

* reuse EC_API_KEY

* Debug test

* Debug a test

* Revert debug

* Debug

* Html report

* groupping, auto-retry, packaging

* removed reruns

* Reuse the initial ESS stack. Start a new stack for retries

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Debug

* Debug

* Debug

* Fix EC_KEY recovery

* Added lock to artifacts

* Fix artifacts download path

* Fix artifacts download path

* Fix artifacts download path

* Removed unnecessaru build dependencies

* Added build id

* Separated BK integration tests to a dedicated pipeline

* CLeanup

* Applied proposed changes

* Applied proposed changes

* Applied proposed changes

(cherry picked from commit 7aa8bb2)
@oakrizan oakrizan added backport-8.16 Automated backport with mergify backport-8.17 Automated backport with mergify and removed backport-8.15 Automated backport to the 8.15 branch with mergify backport-8.16 Automated backport with mergify backport-8.17 Automated backport with mergify labels Dec 11, 2024
@oakrizan
Copy link
Contributor

@Mergifyio backport 8.x

Copy link
Contributor

mergify bot commented Dec 12, 2024

backport 8.x

✅ Backports have been created

@oakrizan
Copy link
Contributor

https://github.com/Mergifyio backport 8.16

Copy link
Contributor

mergify bot commented Dec 13, 2024

backport 8.16

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Dec 13, 2024
* ESS by terraforms

* Use bk runners

* added state to artifacts

* Add common.sh to scripts

* Add depends_on

* Inlined paclage variables

* tmp disbale unit tests

* tmp disbale unit tests

* install tf

* install tf

* install tf

* install tf

* fix ec creds

* Added auto-approve

* Test run

* package again

* package again

* package again

* package again

* package

* package

* added mage build:testBinaries

* Install mage

* Install mage

* Install mage

* Install mage

* Install mage

* fix go

* Merged

* Merged

* fix

* fix

* Fix tests

* Debug

* Use custom image

* New suod tests

* Test run

* Test run

* Test run

* Debug

* Debug

* Debug

* Debug

* Debug

* Cleanup

* Using subshell in newgrp

* Using subshell in newgrp

* Test new custom VM image

* Test new custom VM image

* Set terraform version

* Cleanup

* terraform 1.9.3

* terraform 1.9.3

* Debug

* Explicit image version

* Explicit image version

* Explicit image version

* Sudo tests

* +x

* Try mage integration:local

* Use gotestsum

* Use gotestsum

* Run sudo tests

* Run sudo tests

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Increased test timeout

* Groupped sudo tests

* Quoted regexps

* BK steps by groups

* BK steps by groups

* BK steps by groups

* BK steps by groups

* fix param propagation

* Debug

* Big run

* reuse EC_API_KEY

* Debug test

* Debug a test

* Revert debug

* Debug

* Html report

* groupping, auto-retry, packaging

* removed reruns

* Reuse the initial ESS stack. Start a new stack for retries

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Debug

* Debug

* Debug

* Fix EC_KEY recovery

* Added lock to artifacts

* Fix artifacts download path

* Fix artifacts download path

* Fix artifacts download path

* Removed unnecessaru build dependencies

* Added build id

* Separated BK integration tests to a dedicated pipeline

* CLeanup

* Applied proposed changes

* Applied proposed changes

* Applied proposed changes

(cherry picked from commit 7aa8bb2)

# Conflicts:
#	.buildkite/bk.integration.pipeline.yml
#	.buildkite/scripts/steps/ess.sh
#	.buildkite/scripts/sudo-integration-tests.sh
@oakrizan
Copy link
Contributor

https://github.com/Mergifyio backport 8.17

Copy link
Contributor

mergify bot commented Dec 13, 2024

backport 8.17

✅ Backports have been created

  • Backport to branch 8.17 not needed, change already in branch 8.17

oakrizan pushed a commit that referenced this pull request Dec 13, 2024
* ESS by terraforms

* Use bk runners

* added state to artifacts

* Add common.sh to scripts

* Add depends_on

* Inlined paclage variables

* tmp disbale unit tests

* tmp disbale unit tests

* install tf

* install tf

* install tf

* install tf

* fix ec creds

* Added auto-approve

* Test run

* package again

* package again

* package again

* package again

* package

* package

* added mage build:testBinaries

* Install mage

* Install mage

* Install mage

* Install mage

* Install mage

* fix go

* Merged

* Merged

* fix

* fix

* Fix tests

* Debug

* Use custom image

* New suod tests

* Test run

* Test run

* Test run

* Debug

* Debug

* Debug

* Debug

* Debug

* Cleanup

* Using subshell in newgrp

* Using subshell in newgrp

* Test new custom VM image

* Test new custom VM image

* Set terraform version

* Cleanup

* terraform 1.9.3

* terraform 1.9.3

* Debug

* Explicit image version

* Explicit image version

* Explicit image version

* Sudo tests

* +x

* Try mage integration:local

* Use gotestsum

* Use gotestsum

* Run sudo tests

* Run sudo tests

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Increased test timeout

* Groupped sudo tests

* Quoted regexps

* BK steps by groups

* BK steps by groups

* BK steps by groups

* BK steps by groups

* fix param propagation

* Debug

* Big run

* reuse EC_API_KEY

* Debug test

* Debug a test

* Revert debug

* Debug

* Html report

* groupping, auto-retry, packaging

* removed reruns

* Reuse the initial ESS stack. Start a new stack for retries

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Debug

* Debug

* Debug

* Fix EC_KEY recovery

* Added lock to artifacts

* Fix artifacts download path

* Fix artifacts download path

* Fix artifacts download path

* Removed unnecessaru build dependencies

* Added build id

* Separated BK integration tests to a dedicated pipeline

* CLeanup

* Applied proposed changes

* Applied proposed changes

* Applied proposed changes

(cherry picked from commit 7aa8bb2)

# Conflicts:
#	.buildkite/bk.integration.pipeline.yml
#	.buildkite/scripts/steps/ess.sh
#	.buildkite/scripts/sudo-integration-tests.sh
oakrizan pushed a commit that referenced this pull request Dec 17, 2024
* ESS by terraforms

* Use bk runners

* added state to artifacts

* Add common.sh to scripts

* Add depends_on

* Inlined paclage variables

* tmp disbale unit tests

* tmp disbale unit tests

* install tf

* install tf

* install tf

* install tf

* fix ec creds

* Added auto-approve

* Test run

* package again

* package again

* package again

* package again

* package

* package

* added mage build:testBinaries

* Install mage

* Install mage

* Install mage

* Install mage

* Install mage

* fix go

* Merged

* Merged

* fix

* fix

* Fix tests

* Debug

* Use custom image

* New suod tests

* Test run

* Test run

* Test run

* Debug

* Debug

* Debug

* Debug

* Debug

* Cleanup

* Using subshell in newgrp

* Using subshell in newgrp

* Test new custom VM image

* Test new custom VM image

* Set terraform version

* Cleanup

* terraform 1.9.3

* terraform 1.9.3

* Debug

* Explicit image version

* Explicit image version

* Explicit image version

* Sudo tests

* +x

* Try mage integration:local

* Use gotestsum

* Use gotestsum

* Run sudo tests

* Run sudo tests

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Increased test timeout

* Groupped sudo tests

* Quoted regexps

* BK steps by groups

* BK steps by groups

* BK steps by groups

* BK steps by groups

* fix param propagation

* Debug

* Big run

* reuse EC_API_KEY

* Debug test

* Debug a test

* Revert debug

* Debug

* Html report

* groupping, auto-retry, packaging

* removed reruns

* Reuse the initial ESS stack. Start a new stack for retries

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Debug

* Debug

* Debug

* Fix EC_KEY recovery

* Added lock to artifacts

* Fix artifacts download path

* Fix artifacts download path

* Fix artifacts download path

* Removed unnecessaru build dependencies

* Added build id

* Separated BK integration tests to a dedicated pipeline

* CLeanup

* Applied proposed changes

* Applied proposed changes

* Applied proposed changes

(cherry picked from commit 7aa8bb2)

# Conflicts:
#	.buildkite/bk.integration.pipeline.yml
#	.buildkite/scripts/steps/ess.sh
#	.buildkite/scripts/sudo-integration-tests.sh
oakrizan pushed a commit that referenced this pull request Dec 17, 2024
* ESS by terraforms

* Use bk runners

* added state to artifacts

* Add common.sh to scripts

* Add depends_on

* Inlined paclage variables

* tmp disbale unit tests

* tmp disbale unit tests

* install tf

* install tf

* install tf

* install tf

* fix ec creds

* Added auto-approve

* Test run

* package again

* package again

* package again

* package again

* package

* package

* added mage build:testBinaries

* Install mage

* Install mage

* Install mage

* Install mage

* Install mage

* fix go

* Merged

* Merged

* fix

* fix

* Fix tests

* Debug

* Use custom image

* New suod tests

* Test run

* Test run

* Test run

* Debug

* Debug

* Debug

* Debug

* Debug

* Cleanup

* Using subshell in newgrp

* Using subshell in newgrp

* Test new custom VM image

* Test new custom VM image

* Set terraform version

* Cleanup

* terraform 1.9.3

* terraform 1.9.3

* Debug

* Explicit image version

* Explicit image version

* Explicit image version

* Sudo tests

* +x

* Try mage integration:local

* Use gotestsum

* Use gotestsum

* Run sudo tests

* Run sudo tests

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Debug

* Increased test timeout

* Groupped sudo tests

* Quoted regexps

* BK steps by groups

* BK steps by groups

* BK steps by groups

* BK steps by groups

* fix param propagation

* Debug

* Big run

* reuse EC_API_KEY

* Debug test

* Debug a test

* Revert debug

* Debug

* Html report

* groupping, auto-retry, packaging

* removed reruns

* Reuse the initial ESS stack. Start a new stack for retries

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Fix ess start path

* Debug

* Debug

* Debug

* Fix EC_KEY recovery

* Added lock to artifacts

* Fix artifacts download path

* Fix artifacts download path

* Fix artifacts download path

* Removed unnecessaru build dependencies

* Added build id

* Separated BK integration tests to a dedicated pipeline

* CLeanup

* Applied proposed changes

* Applied proposed changes

* Applied proposed changes

(cherry picked from commit 7aa8bb2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify backport-8.16 Automated backport with mergify backport-8.17 Automated backport with mergify enhancement New feature or request skip-changelog 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.

8 participants