diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 4d332f6f320..d404dcc44fb 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -26,7 +26,8 @@ on: required: false type: string schedule: - - cron: '0 17 * * *' + - cron: '0 17 * * *' # Scheduled regular benchmarks. + - cron: '0 5 */5 * *' # Scheduled PGO benchmarks. env: PNG_REPORT_FILE: out.png @@ -51,7 +52,7 @@ jobs: SSH_KEY: ./id_rsa_terraform TF_VAR_private_key: ./id_rsa_terraform TF_VAR_public_key: ./id_rsa_terraform.pub - TF_VAR_run_standalone: ${{ inputs.runStandalone }} + RUN_STANDALONE: ${{ inputs.runStandalone || github.event.schedule=='0 5 */5 * *' }} TFVARS_SOURCE: ${{ inputs.profile || 'system-profiles/8GBx1zone.tfvars' }} # // Default to use an 8gb profile TF_VAR_BUILD_ID: ${{ github.run_id }} TF_VAR_ENVIRONMENT: ci @@ -109,23 +110,24 @@ jobs: terraform_version: 1.3.7 terraform_wrapper: false - - name: Init TF module + - name: Init terraform module run: | AWS_REGION=${{ env.AWS_REGION }} echo "TF_VAR_worker_region=$AWS_REGION" >> "$GITHUB_ENV" + echo "TF_VAR_run_standalone=$RUN_STANDALONE" >> "$GITHUB_ENV" make init - name: Build apmbench run: make apmbench $SSH_KEY terraform.tfvars - name: Build APM Server and Moxy - if: ${{ inputs.runStandalone }} + if: ${{ env.RUN_STANDALONE }} run: | make apm-server make moxy - name: Override docker committed version - if: ${{ ! inputs.runOnStable && ! inputs.runStandalone}} + if: ${{ ! inputs.runOnStable && ! env.RUN_STANDALONE}} run: make docker-override-committed-version - name: Spin up benchmark environment @@ -145,7 +147,7 @@ jobs: run: make run-benchmark - name: Cat standalone server logs - if: ${{ inputs.runStandalone && failure() }} + if: ${{ env.RUN_STANDALONE && failure() }} run: make cat-apm-server-logs - name: Index benchmarks result @@ -187,11 +189,11 @@ jobs: # via a PR to update default.pgo. - name: Copy CPU profile - if: ${{ inputs.runStandalone && github.ref == 'refs/heads/main' }} + if: ${{ env.RUN_STANDALONE && github.ref == 'refs/heads/main' }} run: make cp-cpuprof - name: Upload CPU profile - if: ${{ inputs.runStandalone && github.ref == 'refs/heads/main' }} + if: ${{ env.RUN_STANDALONE && github.ref == 'refs/heads/main' }} uses: actions/upload-artifact@v4 with: name: cpu-profile @@ -199,7 +201,7 @@ jobs: if-no-files-found: error - name: Open PGO PR - if: ${{ inputs.runStandalone && github.ref == 'refs/heads/main' }} + if: ${{ env.RUN_STANDALONE && github.ref == 'refs/heads/main' }} run: | cd "${{ github.workspace }}" git config user.email "apm@elastic.co"