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

[GCP] add compute datastream tests #2849

Closed
wants to merge 20 commits into from
Closed

[GCP] add compute datastream tests #2849

wants to merge 20 commits into from

Conversation

endorama
Copy link
Member

This PR is part of the effort to migrate Beats metricsets to data stream and adding system tests for them.

What does this PR do?

  • add GCP envs to Jenkins pipelines
  • add gcp.compute datastream tests

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@endorama endorama requested review from a team as code owners March 18, 2022 16:43
@endorama endorama self-assigned this Mar 18, 2022
@endorama endorama added Integration:gcp Google Cloud Platform Team:Cloud-Monitoring Label for the Cloud Monitoring team labels Mar 18, 2022
@elasticmachine
Copy link

elasticmachine commented Mar 18, 2022

💔 Tests Failed

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-04-05T15:11:25.141+0000

  • Duration: 92 min 4 sec

Test stats 🧪

Test Results
Failed 1
Passed 4306
Skipped 7
Total 4314

Test errors 1

Expand to view the tests failures

Check integrations / kubernetes / kubernetes: check / system test: default – kubernetes.pod
    Expand to view the error details

     null 
    

    Expand to view the stacktrace

     one or more errors found in documents stored in metrics-kubernetes.pod-ep data stream: [0] field "container.network.egress.bytes" is undefined
    [1] field "container.network.ingress.bytes" is undefined 
    

Steps errors 4

Expand to view the steps failures

Test integration: docker
  • Took 3 min 31 sec . View more details here
  • Description: eval "$(../../build/elastic-package stack shellinit)" ../../build/elastic-package test -v --report-format xUnit --report-output file --test-coverage
Take down the Elastic stack
  • Took 0 min 16 sec . View more details here
  • Description: build/elastic-package stack down -v
Check integration: gcp
  • Took 0 min 3 sec . View more details here
  • Description: ../../build/elastic-package check -v
Test integration: kubernetes
  • Took 30 min 0 sec . View more details here
  • Description: eval "$(../../build/elastic-package stack shellinit)" ../../build/elastic-package test -v --report-format xUnit --report-output file --test-coverage

🤖 GitHub comments

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

  • /test : Re-trigger the build.

@endorama
Copy link
Member Author

CI failed with a permission error on the GCP Service Account:

Error: Error loading zone 'us-central1-a': googleapi: Error 403: Required 'compute.zones.get' permission for 'projects/elastic-obs-integrations-dev/zones/us-central1-a', forbidden

@v1v I'm using the same SA we setup in this PR elastic/elastic-package#701 (see https://github.com/elastic/elastic-package/pull/701/files#diff-ef8b2f5e4d21d81c0eba4754dea3a3dfc2c67d26284f195165b650cf4aff7beaR23). Could it be the SA should be enabled for this repository?

@v1v
Copy link
Member

v1v commented Mar 21, 2022

Could it be the SA should be enabled for this repository?

IIRC, @mtojek created the service account, though I'm inclined to suggest to use another service account with the right permissions instead, to avoid messing up the other pipelines/consumers.

I can provide you some details about how to update the secret in vault if needed

@endorama
Copy link
Member Author

endorama commented Mar 21, 2022

I'm inclined to suggest to use another service account with the right permissions instead, to avoid messing up the other pipelines/consumers.

I think we want this to be the same SA for this reason.

But there was a bug in the code that's why the permissions error showed up, sorry for involving you

@mtojek
Copy link
Contributor

mtojek commented Mar 21, 2022

IIRC, @mtojek created the service account, though I'm inclined to suggest to use another service account with the right permissions instead, to avoid messing up the other pipelines/consumers.

I suggest using the same GCP service account as elastic-package uses for GCP testing (elastic-package-gcp).

elastic-obs-integrations-dev

Shouldn't it be elastic-observability?

@endorama Please try not using the force-push mode as you lose the commit history and we don't know what have you tried and what haven't.

@@ -50,64 +50,6 @@ vars:
required: false
show_user: true
policy_templates:
- name: audit
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we moving these into a separate package?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, but tests are failing with some gcp-pubsub related failures and I wanted to remove that to observe if the issue was being introduced by these changeset.

Failure:

[2022-03-21T17:00:29.474Z] Error: error running package system tests: could not complete test run: could not add data stream config to policy: could not add package to policy; API status code = 500; response body = {"statusCode":500,"error":"Internal Server Error","message":"Input template not found, unable to find input type gcp-pubsub"}

@endorama
Copy link
Member Author

@mtojek

I suggest using the same GCP service account as elastic-package uses for GCP testing (elastic-package-gcp).

That's the plan

Shouldn't it be elastic-observability?

yes, there was a bug and the code didn't use the proper project, fixed in 9b6f981

@endorama Please try not using the force-push mode as you lose the commit history and we don't know what have you tried and what haven't.

You're right, sorry!

@endorama
Copy link
Member Author

Due to the data streams test errors I see on this PR that are unrelated to the changes in this PR I'm pausing the work and ensure the CI is green in gcp-metrics branch, the branch this PR is based on.

@@ -257,6 +259,11 @@ def withCloudTestEnv(Closure body) {
[var: "AWS_ACCESS_KEY_ID", password: aws.access_key],
[var: "AWS_SECRET_ACCESS_KEY", password: aws.secret_key],
])
// GCP
withGCPEnv(secret: env.ELASTIC_PACKAGE_GCP_SECRET) {
Copy link
Contributor

Choose a reason for hiding this comment

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

where is withGCPEnv defined?

Copy link
Contributor

Choose a reason for hiding this comment

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

legoguy1000 and others added 7 commits April 5, 2022 17:07
This commit has been changed to remove changes to README included in
 #2141 to allow documentation changes from #2842

Changes to  packages/gcp/data_stream/audit/manifest.yml has been removed
too.
This commit has been changed to remove changes to README included in
 #2141 to allow documentation changes from #2842
This reverts commit fe54af3.

`alternative_host` was a input level variable that is not shared by all
inputs but used only in log related inputs. It was moved to data stream
level but was not implemented for all data streams.
legoguy1000 and others added 4 commits April 5, 2022 17:10
This commit has been changed to remove changes to README included in
 #2141 to allow documentation changes from #2842

Changes to  packages/gcp/data_stream/audit/manifest.yml has been removed
too.
@endorama endorama force-pushed the gcp-metrics branch 2 times, most recently from edc3905 to 826b985 Compare July 13, 2022 07:54
@endorama endorama deleted the branch elastic:gcp-metrics July 14, 2022 08:49
@endorama endorama closed this Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integration:gcp Google Cloud Platform Team:Cloud-Monitoring Label for the Cloud Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants