diff --git a/.ci/scripts/push-pgo-pr.sh b/.ci/scripts/push-pgo-pr.sh new file mode 100644 index 00000000000..44896247340 --- /dev/null +++ b/.ci/scripts/push-pgo-pr.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -eo pipefail + +PGO_BRANCH="update-pgo-$(date +%s)" +cd $WORKSPACE_PATH +git fetch origin main +git checkout main +git checkout -b $PGO_BRANCH +mv $PROFILE_PATH x-pack/apm-server/default.pgo +git add x-pack/apm-server/default.pgo +git commit -m "PGO: Update default.pgo from benchmarks $WORKFLOW." +git push -u origin $PGO_BRANCH +gh pr create -B main -H $(PGO_BRANCH) -t "PGO: Update default.pgo" -b "Update default.pgo CPU profile from the benchmarks [workflow]($WORKFLOW)." -R elastic/apm-server +gh pr merge --auto --delete-branch --squash $PGO_BRANCH \ No newline at end of file diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index d7835aeb491..a064afe22c6 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -227,7 +227,7 @@ jobs: - name: Open PGO PR if: ${{ env.RUN_STANDALONE == 'true' && github.ref == 'refs/heads/main' }} - run: make push-pgo-pr + run: ${{ github.workspace }}/.ci/scripts/push_pgo_pr.sh env: WORKSPACE_PATH: ${{ github.workspace }} PROFILE_PATH: ${{ env.WORKING_DIRECTORY }}/${{ env.BENCHMARK_CPU_OUT }} diff --git a/testing/benchmark/Makefile b/testing/benchmark/Makefile index 8382e67ba3b..3344de04c04 100644 --- a/testing/benchmark/Makefile +++ b/testing/benchmark/Makefile @@ -178,20 +178,6 @@ cleanup-elasticsearch: @ echo "-> Deleting APM Server data streams..." @ curl -u $(ELASTICSEARCH_USER):$(ELASTICSEARCH_PASS) -XDELETE $(ELASTICSEARCH_URL)/_data_stream/$(APM_DATA_STREAMS) -# This target is intended to be run from CI to create a PGO update PR. -PGO_BRANCH = update-pgo-$(shell date +%s) -.PHONY: push-pgo-pr -push-pgo-pr: - @cd $(WORKSPACE_PATH); \ - git fetch origin main; \ - git checkout main; \ - git checkout -b $(PGO_BRANCH); \ - mv $(PROFILE_PATH) x-pack/apm-server/default.pgo; \ - git add x-pack/apm-server/default.pgo; \ - git commit -m "PGO: Update default.pgo from benchmarks $(WORKFLOW)."; \ - git push -u origin $(PGO_BRANCH); \ - gh pr create -B main -H $(PGO_BRANCH) -t "PGO: Update default.pgo" -b "Update default.pgo CPU profile from the benchmarks [workflow]($(WORKFLOW))." -R elastic/apm-server - ############################################################################## # Target for creating a .tfvars file, defining the custom Docker images to # use in the deployment. diff --git a/testing/benchmark/main.tf b/testing/benchmark/main.tf index 637d492bf0e..4b888e7a78a 100644 --- a/testing/benchmark/main.tf +++ b/testing/benchmark/main.tf @@ -33,7 +33,6 @@ module "tags" { # use the convention for team/shared owned resources if we are running in CI. # assume this is an individually owned resource otherwise. project = startswith(var.user_name, "benchci") ? "benchmarks" : var.user_name - build = var.BUILD_ID } provider "ec" {} diff --git a/testing/benchmark/outputs.tf b/testing/benchmark/outputs.tf index 64f9ab7e106..2cad7994126 100644 --- a/testing/benchmark/outputs.tf +++ b/testing/benchmark/outputs.tf @@ -40,7 +40,6 @@ output "apm_server_url" { output "apm_server_ip" { value = var.run_standalone ? module.standalone_apm_server[0].apm_server_ip : "" description = "The APM Server EC2 IP address" - sensitive = true } output "admin_console_url" { diff --git a/testing/benchmark/variables.tf b/testing/benchmark/variables.tf index 8d209fdba12..b06a4d7a6b2 100644 --- a/testing/benchmark/variables.tf +++ b/testing/benchmark/variables.tf @@ -7,7 +7,7 @@ variable "user_name" { variable "run_standalone" { default = false - description = "If set run benchmarks against standalone APM Server conneted to moxy" + description = "If set run benchmarks against standalone APM Server connected to moxy" type = bool } diff --git a/testing/smoke/managed/main.tf b/testing/smoke/managed/main.tf index 3810839ca3f..caf816aa627 100644 --- a/testing/smoke/managed/main.tf +++ b/testing/smoke/managed/main.tf @@ -13,7 +13,6 @@ provider "ec" {} module "tags" { source = "../../infra/terraform/modules/tags" project = "smoke-test-ea-managed" - build = var.BUILD_ID } locals { diff --git a/testing/smoke/supported-os/main.tf b/testing/smoke/supported-os/main.tf index 98741422ec5..9835da198c2 100644 --- a/testing/smoke/supported-os/main.tf +++ b/testing/smoke/supported-os/main.tf @@ -13,7 +13,6 @@ provider "ec" {} module "tags" { source = "../../infra/terraform/modules/tags" project = "smoke-test-supported-os" - build = var.BUILD_ID } locals {