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: enable AWS cloud testing on a PR basis if changes in certain files #29047

Merged
merged 12 commits into from
Nov 25, 2021

Conversation

v1v
Copy link
Member

@v1v v1v commented Nov 19, 2021

What does this PR do?

Enable the AWS stage testing in AWS on a PR basis if certain files changed:

  • x-pack/filebeat/input/awss3
  • x-pack/filebeat/module/aws
  • x-pack/filebeat/input/awscloudwatch
  • x-pack/metricbeat/module/aws
  • x-pack/libbeat/common/aws

Why is it important?

This was disabled in #23186 since there were some issues with the DB quota and runs on a weekly basis.

Contributors might forget that using

  • UI based with the parameter awsCloudTests
  • GH comment /test x-pack/metricbeat for aws cloud
  • GH Label aws

can verified their PRs with AWS Cloud.

So this will ensure it runs automatically when needed.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 19, 2021
@mergify
Copy link
Contributor

mergify bot commented Nov 19, 2021

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-v./d./d./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 Nov 19, 2021
Jenkinsfile Outdated Show resolved Hide resolved
@v1v
Copy link
Member Author

v1v commented Nov 19, 2021

/test

@v1v
Copy link
Member Author

v1v commented Nov 19, 2021

metricbeat-goIntegTest is failing over and over. Unrelated to this particular PR but unfortunately I cannot test my changes since there is a prerequisite. I'll try a few more times, otherwise I'll move the new AWS stage to be mandatory to be able to test this changes

@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 19, 2021

💚 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: 2021-11-24T17:40:01.752+0000

  • Duration: 153 min 19 sec

  • Commit: 98c5f41

Test stats 🧪

Test Results
Failed 0
Passed 50805
Skipped 4485
Total 55290

💚 Flaky test report

Tests succeeded.

🤖 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!)

v1v added 3 commits November 22, 2021 17:41
…ws-on-file-changes

* upstream/master:
  Fix discovery of Nomad allocations (elastic#28700)
  Add null (`\u0000`) as a valid line terminator (elastic#28998)
  Remove `logging.files.suffix` option and always use datetime suffixes (elastic#28927)
  x-pack/filebeat/module: add note for default var.input (elastic#28324)
  Fix AccessList & AccessMask processing in security data_stream (elastic#29016)
  [Metricbeat] Fix wrong mapping on "info" subkey (elastic#28782)
  ci: daily/weekly jobs (elastic#29050)
  [mergify] report open backported PRs once a week (elastic#28964)
@v1v
Copy link
Member Author

v1v commented Nov 22, 2021

@aspacca , are you familiar with the error:

[2021-11-19T15:33:24.959Z] + terraform apply -auto-approve
[2021-11-19T15:33:28.295Z] �[31m
[2021-11-19T15:33:28.295Z] �[1m�[31mError: �[0m�[0m�[1merror configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.
[2021-11-19T15:33:28.295Z] 
[2021-11-19T15:33:28.295Z] Please see https://registry.terraform.io/providers/hashicorp/aws
[2021-11-19T15:33:28.295Z] for more information about providing credentials.
[2021-11-19T15:33:28.295Z] 
[2021-11-19T15:33:28.295Z] Error: NoCredentialProviders: no valid providers in chain
[2021-11-19T15:33:28.295Z] caused by: EnvAccessKeyNotFound: failed to find credentials in the environment.
[2021-11-19T15:33:28.295Z] SharedCredsLoad: failed to load profile, .
[2021-11-19T15:33:28.295Z] EC2RoleRequestError: no EC2 instance role found
[2021-11-19T15:33:28.295Z] caused by: EC2MetadataError: failed to make EC2Metadata

See logs

That particular execution theoretically configured the environment variables with the credentials, but just in case it's something that somehow is not correct in terraform.

@v1v
Copy link
Member Author

v1v commented Nov 22, 2021

/test

@aspacca
Copy link

aspacca commented Nov 23, 2021

@v1v

that's very strange, the terraform file (https://github.com/elastic/beats/blob/master/x-pack/filebeat/input/awss3/_meta/terraform/main.tf) was created 3 months ago and two weeks ago we just added some extra resources.
If anything wrong there it should have failed also in the last two week, shouldn't it?

@v1v
Copy link
Member Author

v1v commented Nov 23, 2021

/test

@aspacca
Copy link

aspacca commented Nov 23, 2021

also I see in the last test run x-pack/filebeat-cloudAWS didn't run anymore. or did I miss anything?

@v1v
Copy link
Member Author

v1v commented Nov 23, 2021

also I see in the last test run x-pack/filebeat-cloudAWS didn't run anymore. or did I miss anything?

It won't as long as there are flaky tests in the pythonIntegTest for metricbeat. :/
I faced this issues quite a lot earlier when testing this PR...

@v1v
Copy link
Member Author

v1v commented Nov 23, 2021

There are genuine test failures in the master branch since build_1504

v1v and others added 4 commits November 23, 2021 11:37
There are genuine test failures for the integ tests therefore the `extended` stage cannot be executed.
…ws-on-file-changes

* upstream/master:
  override host on statsd metricset (elastic#29103)
  Skip config check in autodiscover for duplicated configurations (elastic#29048)
  Change "filebeat.config.modules.enabled" to "true" (elastic#28769)
  Remove deprecated spool queue from Beats (elastic#28869)
  Add `beat` field back to beat.stats (elastic#29094)
  Revert "Move labels and annotations under kubernetes.namespace. (elastic#27917)" (elastic#29069)
  heartbeat: remove w2008 in the CI (elastic#29093)
  Remove deprecated `--template` and `--index-policy` flags (elastic#28870)
  Fix parsing of apache trace log levels (elastic#28717)
  [Elastic-Agent] IUse itnernal port for local fleet server (elastic#28993)
  [Heartbeat] Log error on dupe monitor ID instead of strict req (elastic#29041)
  Enable pprof for elastic-agent and beats (elastic#28983)
@v1v v1v added the backport-v7.16.0 Automated backport with mergify label Nov 24, 2021
@v1v v1v added the backport-v8.0.0 Automated backport with mergify label Nov 24, 2021
@mergify mergify bot removed the backport-skip Skip notification from the automated backport with mergify label Nov 24, 2021
x-pack/filebeat/Jenkinsfile.yml Outdated Show resolved Hide resolved
x-pack/metricbeat/Jenkinsfile.yml Outdated Show resolved Hide resolved
@v1v
Copy link
Member Author

v1v commented Nov 24, 2021

It worked now

GitHub checks

image

image

New stages

x-pack-filebeat cloud AWS

Prerequisites: configure terraform
Mage: mage build test
Build output for the mage command -> https://beats-ci.elastic.co/job/Beats/job/beats/job/PR-29047/10/execution/node/18265/log/

image

build logs

x-pack-metricbeat cloud AWS

Prerequisites: configure terraform
Mage: mage build test
Build output for the mage command -> https://beats-ci.elastic.co/job/Beats/job/beats/job/PR-29047/10/execution/node/20073/log/

image

build logs

@aspacca , can you confirm if those logs are reporting the correct output?

@v1v v1v marked this pull request as ready for review November 24, 2021 17:39
@v1v v1v requested a review from a team as a code owner November 24, 2021 17:39
@v1v v1v added the Team:Automation Label for the Observability productivity team label Nov 24, 2021
@v1v v1v self-assigned this Nov 24, 2021
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Nov 24, 2021
@aspacca
Copy link

aspacca commented Nov 25, 2021

@v1v I've checked terraform apply logs and they are correct

@v1v v1v merged commit 3dc0afb into elastic:master Nov 25, 2021
mergify bot pushed a commit that referenced this pull request Nov 25, 2021
mergify bot pushed a commit that referenced this pull request Nov 25, 2021
v1v added a commit to v1v/beats that referenced this pull request Nov 30, 2021
* upstream/master: (577 commits)
  Remove Journalbeat (elastic#29131)
  Add note that there is no warranty or support for generator code (elastic#28797)
  packetbeat: preparation for npcap addition (elastic#29017)
  Use the generic helper for opening file to read in filestream (elastic#29180)
  Workflow for macos (elastic#29174)
  Fix `decode_json_fields` processor to always add error key (elastic#29107)
  Workflow for macos (elastic#29156)
  Fix agent download timeout values in yaml files (elastic#29039)
  Added workflow file for builds with macos (elastic#29148)
  CI: enable AWS cloud testing on a PR basis if changes in certain files (elastic#29047)
  Remove links to Journalbeat (elastic#29134)
  Fix rds metadata in cloudwatch metricset (elastic#29106)
  [mergify]: notify conflicts in PRs that are still open (elastic#29122)
  Use NamedWatcher in Agent's k8s provider (elastic#29095)
  override host on statsd metricset (elastic#29103)
  Skip config check in autodiscover for duplicated configurations (elastic#29048)
  Change "filebeat.config.modules.enabled" to "true" (elastic#28769)
  Remove deprecated spool queue from Beats (elastic#28869)
  Add `beat` field back to beat.stats (elastic#29094)
  Revert "Move labels and annotations under kubernetes.namespace. (elastic#27917)" (elastic#29069)
  ...
v1v added a commit that referenced this pull request Jan 12, 2022
… changes in certain files (#29145)

* CI: enable AWS cloud testing on a PR basis if changes in certain files (#29047)

(cherry picked from commit 3dc0afb)

* fix test

Co-authored-by: Victor Martinez <[email protected]>
Co-authored-by: Andrea Spacca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.16.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify Team:Automation Label for the Observability productivity team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants