Skip to content

Commit

Permalink
ci: fix benchmarks cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
reakaleek committed Oct 10, 2024
1 parent f5dcbf8 commit f043cce
Showing 1 changed file with 96 additions and 96 deletions.
192 changes: 96 additions & 96 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,102 +137,102 @@ jobs:
TF_VAR_worker_region: ${{ env.AWS_REGION }}
TF_VAR_run_standalone: ${{ env.RUN_STANDALONE }}

- name: Run benchmarks autotuned
if: ${{ inputs.benchmarkAgents == '' }}
run: make run-benchmark-autotuned

- name: Run benchmarks self tuned
if: ${{ inputs.benchmarkAgents != '' }}
run: make run-benchmark

- name: Cat standalone server logs
if: ${{ env.RUN_STANDALONE == 'true' && failure() }}
run: make cat-apm-server-logs

- name: Index benchmarks result
run: make index-benchmark-results

- name: Download PNG
run: >-
${{ github.workspace }}/.ci/scripts/download-png-from-kibana.sh
${{ secrets.KIBANA_BENCH_ENDPOINT }}
${{ secrets.KIBANA_BENCH_USERNAME }}
${{ secrets.KIBANA_BENCH_PASSWORD }}
$PNG_REPORT_FILE
- name: Upload PNG
uses: actions/upload-artifact@v4
with:
name: kibana-png-report
path: ${{ env.WORKING_DIRECTORY }}/${{ env.PNG_REPORT_FILE }}
if-no-files-found: error

- name: Upload PNG to AWS S3
id: s3-upload-png
env:
AWS_DEFAULT_REGION: us-east-1
run: |
DEST_NAME="github-run-id-${{ github.run_id }}.png"
aws s3 --debug cp ${{ env.PNG_REPORT_FILE }} s3://elastic-apm-server-benchmark-reports/${DEST_NAME}
echo "png_report_url=https://elastic-apm-server-benchmark-reports.s3.amazonaws.com/${DEST_NAME}" >> "$GITHUB_OUTPUT"
- name: Upload benchmark result
uses: actions/upload-artifact@v4
with:
name: benchmark-result
path: ${{ env.WORKING_DIRECTORY }}/${{ env.BENCHMARK_RESULT }}
if-no-files-found: error

# The next section injects CPU profile collected by apmbench into the build.
# By copying the profile, uploading it to the artifacts and pushing it
# via a PR to update default.pgo.

- name: Copy CPU profile
run: make cp-cpuprof
- name: Upload CPU profile
uses: actions/upload-artifact@v4
with:
name: cpu-profile
path: ${{ env.WORKING_DIRECTORY }}/${{ env.BENCHMARK_CPU_OUT }}
if-no-files-found: error

- name: Get token
id: get_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
permissions: >-
{
"contents": "write",
"pull_requests": "write"
}
# Required to use a service account, otherwise PRs created by
# GitHub bot won't trigger any CI builds.
# See https://github.com/peter-evans/create-pull-request/issues/48#issuecomment-537478081
- name: Configure git user
uses: elastic/oblt-actions/git/setup@v1
with:
github-token: ${{ steps.get_token.outputs.token }}

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
with:
gpg_private_key: ${{ secrets.APM_SERVER_RELEASE_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.APM_SERVER_RELEASE_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true

- name: Open PGO PR
if: ${{ env.RUN_STANDALONE == 'true' }}
run: ${{ github.workspace }}/.ci/scripts/push-pgo-pr.sh
env:
WORKSPACE_PATH: ${{ github.workspace }}
PROFILE_PATH: ${{ env.WORKING_DIRECTORY }}/${{ env.BENCHMARK_CPU_OUT }}
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
WORKFLOW: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}
# - name: Run benchmarks autotuned
# if: ${{ inputs.benchmarkAgents == '' }}
# run: make run-benchmark-autotuned
#
# - name: Run benchmarks self tuned
# if: ${{ inputs.benchmarkAgents != '' }}
# run: make run-benchmark
#
# - name: Cat standalone server logs
# if: ${{ env.RUN_STANDALONE == 'true' && failure() }}
# run: make cat-apm-server-logs
#
# - name: Index benchmarks result
# run: make index-benchmark-results
#
# - name: Download PNG
# run: >-
# ${{ github.workspace }}/.ci/scripts/download-png-from-kibana.sh
# ${{ secrets.KIBANA_BENCH_ENDPOINT }}
# ${{ secrets.KIBANA_BENCH_USERNAME }}
# ${{ secrets.KIBANA_BENCH_PASSWORD }}
# $PNG_REPORT_FILE
#
# - name: Upload PNG
# uses: actions/upload-artifact@v4
# with:
# name: kibana-png-report
# path: ${{ env.WORKING_DIRECTORY }}/${{ env.PNG_REPORT_FILE }}
# if-no-files-found: error
#
# - name: Upload PNG to AWS S3
# id: s3-upload-png
# env:
# AWS_DEFAULT_REGION: us-east-1
# run: |
# DEST_NAME="github-run-id-${{ github.run_id }}.png"
# aws s3 --debug cp ${{ env.PNG_REPORT_FILE }} s3://elastic-apm-server-benchmark-reports/${DEST_NAME}
# echo "png_report_url=https://elastic-apm-server-benchmark-reports.s3.amazonaws.com/${DEST_NAME}" >> "$GITHUB_OUTPUT"
#
# - name: Upload benchmark result
# uses: actions/upload-artifact@v4
# with:
# name: benchmark-result
# path: ${{ env.WORKING_DIRECTORY }}/${{ env.BENCHMARK_RESULT }}
# if-no-files-found: error
#
# # The next section injects CPU profile collected by apmbench into the build.
# # By copying the profile, uploading it to the artifacts and pushing it
# # via a PR to update default.pgo.
#
# - name: Copy CPU profile
# run: make cp-cpuprof
#
# - name: Upload CPU profile
# uses: actions/upload-artifact@v4
# with:
# name: cpu-profile
# path: ${{ env.WORKING_DIRECTORY }}/${{ env.BENCHMARK_CPU_OUT }}
# if-no-files-found: error
#
# - name: Get token
# id: get_token
# uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
# with:
# app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
# private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
# permissions: >-
# {
# "contents": "write",
# "pull_requests": "write"
# }
#
# # Required to use a service account, otherwise PRs created by
# # GitHub bot won't trigger any CI builds.
# # See https://github.com/peter-evans/create-pull-request/issues/48#issuecomment-537478081
# - name: Configure git user
# uses: elastic/oblt-actions/git/setup@v1
# with:
# github-token: ${{ steps.get_token.outputs.token }}
#
# - name: Import GPG key
# uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
# with:
# gpg_private_key: ${{ secrets.APM_SERVER_RELEASE_GPG_PRIVATE_KEY }}
# passphrase: ${{ secrets.APM_SERVER_RELEASE_PASSPHRASE }}
# git_user_signingkey: true
# git_commit_gpgsign: true
#
# - name: Open PGO PR
# if: ${{ env.RUN_STANDALONE == 'true' }}
# run: ${{ github.workspace }}/.ci/scripts/push-pgo-pr.sh
# env:
# WORKSPACE_PATH: ${{ github.workspace }}
# PROFILE_PATH: ${{ env.WORKING_DIRECTORY }}/${{ env.BENCHMARK_CPU_OUT }}
# GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
# WORKFLOW: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}

# Secrets are rotated daily, if the benchmarks run between the rotation window, then
# there is a high chance things will stop working
Expand Down

0 comments on commit f043cce

Please sign in to comment.