-
Notifications
You must be signed in to change notification settings - Fork 445
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][terraform][aws] tags with metadata #3126
[ci][terraform][aws] tags with metadata #3126
Conversation
💔 Build Failed
Expand to view the summary
Build stats
Test stats 🧪
Steps errorsExpand to view the steps failures
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm setting a blocker on this to merge the elastic/elastic-package#792 first, then iterate on this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this PR changed the implementation of elastic-package, let's first release a new version. It's just about Git tagging the latest commit in the main branch.
I just merged the PR for the |
Version bump PR here: #3182 |
/test |
.ci/Jenkinsfile
Outdated
@@ -258,7 +259,13 @@ def withCloudTestEnv(Closure body) { | |||
[var: "AWS_SECRET_ACCESS_KEY", password: aws.secret_key], | |||
]) | |||
withEnvMask(vars: maskedVars) { | |||
body() | |||
withEnv(["TF_VAR_BRANCH=${env.BRANCH_NAME.toLowerCase()}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason these changes are not consumed:
terraform_1 | + tags = {
terraform_1 | + "Name" = "elastic-package-test-33598"
terraform_1 | }
terraform_1 | + tags_all = {
terraform_1 | + "Name" = "elastic-package-test-33598"
terraform_1 | + "branch" = "unknown-branch"
terraform_1 | + "build" = "unknown-build"
terraform_1 | + "created_date" = "unknown-date"
terraform_1 | + "environment" = "unknown-environment"
terraform_1 | + "repo" = "unknown-repo-name"
terraform_1 | }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow some env variables are not populated from the CI:
terraform_1 | + tags = {
terraform_1 | + "Name" = "elastic-package-test-17719"
terraform_1 | }
terraform_1 | + tags_all = {
terraform_1 | + "Name" = "elastic-package-test-17719"
terraform_1 | + "branch" = "unknown"
terraform_1 | + "build" = "6"
terraform_1 | + "created_date" = "unknown"
terraform_1 | + "environment" = "unknown"
terraform_1 | + "repo" = "integrations"
I guess, the elastic-packages has a higher precendence:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would start with investigating why the releasing job for v0.47.0 failed: https://beats-ci.elastic.co/job/Ingest-manager/job/elastic-package/job/v0.47.0/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v1v It looks like we need a fix:
terraform_1 | Plan: 1 to add, 0 to change, 0 to destroy.
terraform_1 | google_compute_instance.default: Creating...
terraform_1 |
terraform_1 | Error: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.labels': ''. Label value 'v0.47.0' violates format constraints. The value can only contain lowercase letters, numeric characters, underscores and dashes. The value can be at most 63 characters long. International characters are allowed., invalid
terraform_1 |
terraform_1 | with google_compute_instance.default,
terraform_1 | on compute.tf line 7, in resource "google_compute_instance" "default":
terraform_1 | 7: resource "google_compute_instance" "default" {
terraform_1 |
terraform_1 | + echo 'Terraform definitions applied.'
terraform_1 | Terraform definitions applied.
terraform_1 | + set +x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed already added to the elastic-package and also here, so the new metadata is populated now
terraform_1 | + tags = {
terraform_1 | + "Name" = "elastic-package-test-73355"
terraform_1 | }
terraform_1 | + tags_all = {
terraform_1 | + "Name" = "elastic-package-test-73355"
terraform_1 | + "branch" = "pr-3126"
terraform_1 | + "build" = "8"
terraform_1 | + "created_date" = "1650891241341"
terraform_1 | + "environment" = "ci"
terraform_1 | + "repo" = "integrations"
terraform_1 | }
@v1v Please merge the main branch, so that this PR will pick the last bumped version. Part of the implementation is in elastic-package and that PR was merged seconds ago. |
@Mergifyio rebase |
✅ Branch has been successfully rebased |
48cae03
to
811a011
Compare
…ations into feature/labels-cloud-ephemeral-components * 'feature/labels-cloud-ephemeral-components' of github.com:v1v/integrations: (23 commits) use branch standardise labels/tags Update .ci/Jenkinsfile [ci][terraform][aws] tags with metadata Bump github.com/elastic/elastic-package from 0.46.0 to 0.47.0 (elastic#3182) Spring boot package [Memory - data stream] (elastic#2979) [cisco_ise] Add Cisco ISE package (elastic#2855) [apache_spark][executor] Add Apache Spark package with Executor data stream (elastic#2943) [apache_spark][driver] Add Apache Spark package with Driver data stream (elastic#2945) cisco_duo: simplify grok expression for handling ports (elastic#3170) cisco_duo: fix handling of IP addresses with port numbers (elastic#3117) [sophos] Various improvements and log samples from 18.5 (elastic#3127) [cisco_asa] fix visualizations (elastic#3146) [apache_spark][application] Add Apache Spark package with Application data stream (elastic#2941) Fix pagination bug that skipped events when more than one page is present. (elastic#3140) Cis k8s name migration (elastic#3113) remove exported fields; these will be added to Kibana docs instead (elastic#3093) Exclude ecosystem as owner of subdirectories of packages (elastic#3132) [awsfargate] bump package version (elastic#3130) add first csp rule template (elastic#3081) ...
Co-authored-by: Marcin Tojek <mtojek@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just double-checking, system tests for GCP are not there yet, right?
I could not find any other references to terraform but only in the |
I checked these errors and they're unrelated. I guess that you can merge this PR. |
What does this PR do?
Standardise the below tags/labels in the terraform resources for AWS/GCP:
environment
=> static valuerepo
. => static valuebranch
=> dynamic valuebuild
=> dynamic valuecreated_date
=> dynamic valueWhy is it important?
Help with tearing down any of the ephemeral resources which were not successfully removed as part of the system tests.
Implementation details
environment=CI
will allow to filter all those cloud resources which were created in the CIcreated_date
will help to filter those which were older than X days or X hours, since it's Unix epoch time based.branch
andbuild
will help to identify what build in the CI and what PR, Branch or Tag created those resources.Further details
Test
Issues
Requires elastic/elastic-package#792