Skip to content

Commit

Permalink
Add PGO benchmark schedule.
Browse files Browse the repository at this point in the history
  • Loading branch information
1pkg committed Sep 27, 2024
1 parent 6b009aa commit 7c60d53
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -187,19 +189,19 @@ 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
path: ${{ env.WORKING_DIRECTORY }}/${{ env.BENCHMARK_CPU_OUT }}
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 "[email protected]"
Expand Down

0 comments on commit 7c60d53

Please sign in to comment.