|
| 1 | +name: large oltp benchmark |
| 2 | + |
| 3 | +on: |
| 4 | + # uncomment to run on push for debugging your PR |
| 5 | + push: |
| 6 | + branches: [ bodobolero/synthetic_oltp_workload ] |
| 7 | + |
| 8 | + schedule: |
| 9 | + # * is a special character in YAML so you have to quote this string |
| 10 | + # ┌───────────── minute (0 - 59) |
| 11 | + # │ ┌───────────── hour (0 - 23) |
| 12 | + # │ │ ┌───────────── day of the month (1 - 31) |
| 13 | + # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) |
| 14 | + # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) |
| 15 | + - cron: '0 15 * * *' # run once a day, timezone is utc, avoid conflict with other benchmarks |
| 16 | + workflow_dispatch: # adds ability to run this manually |
| 17 | + |
| 18 | +defaults: |
| 19 | + run: |
| 20 | + shell: bash -euxo pipefail {0} |
| 21 | + |
| 22 | +concurrency: |
| 23 | + # Allow only one workflow globally because we need dedicated resources which only exist once |
| 24 | + group: large-oltp-bench-workflow |
| 25 | + cancel-in-progress: true |
| 26 | + |
| 27 | +jobs: |
| 28 | + oltp: |
| 29 | + strategy: |
| 30 | + fail-fast: false # allow other variants to continue even if one fails |
| 31 | + matrix: |
| 32 | + include: |
| 33 | + - target: new_branch |
| 34 | + custom_scripts: insert_webhooks.sql@2 select_any_webhook_with_skew.sql@4 select_recent_webhook.sql@4 |
| 35 | + - target: reuse_branch |
| 36 | + custom_scripts: insert_webhooks.sql@2 select_any_webhook_with_skew.sql@4 select_recent_webhook.sql@4 |
| 37 | + max-parallel: 1 # we want to run each stripe size sequentially to be able to compare the results |
| 38 | + permissions: |
| 39 | + contents: write |
| 40 | + statuses: write |
| 41 | + id-token: write # aws-actions/configure-aws-credentials |
| 42 | + env: |
| 43 | + TEST_PG_BENCH_DURATIONS_MATRIX: "1h" # todo update to > 1 h |
| 44 | + TEST_PGBENCH_CUSTOM_SCRIPTS: ${{ matrix.custom_scripts }} |
| 45 | + POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install |
| 46 | + PG_VERSION: 16 # pre-determined by pre-determined project |
| 47 | + TEST_OUTPUT: /tmp/test_output |
| 48 | + BUILD_TYPE: remote |
| 49 | + SAVE_PERF_REPORT: ${{ github.ref_name == 'main' }} |
| 50 | + PLATFORM: ${{ matrix.target }} |
| 51 | + |
| 52 | + runs-on: [ self-hosted, us-east-2, x64 ] |
| 53 | + container: |
| 54 | + image: neondatabase/build-tools:pinned-bookworm |
| 55 | + credentials: |
| 56 | + username: ${{ secrets.NEON_DOCKERHUB_USERNAME }} |
| 57 | + password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }} |
| 58 | + options: --init |
| 59 | + |
| 60 | + # Increase timeout to 8h, default timeout is 6h |
| 61 | + timeout-minutes: 480 |
| 62 | + |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v4 |
| 65 | + |
| 66 | + - name: Configure AWS credentials # necessary to download artefacts |
| 67 | + uses: aws-actions/configure-aws-credentials@v4 |
| 68 | + with: |
| 69 | + aws-region: eu-central-1 |
| 70 | + role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }} |
| 71 | + role-duration-seconds: 18000 # 5 hours is currently max associated with IAM role |
| 72 | + |
| 73 | + - name: Download Neon artifact |
| 74 | + uses: ./.github/actions/download |
| 75 | + with: |
| 76 | + name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact |
| 77 | + path: /tmp/neon/ |
| 78 | + prefix: latest |
| 79 | + aws-oicd-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }} |
| 80 | + |
| 81 | + - name: Create Neon Branch for large tenant |
| 82 | + if: ${{ matrix.target == 'new_branch' }} |
| 83 | + id: create-neon-branch-oltp-target |
| 84 | + uses: ./.github/actions/neon-branch-create |
| 85 | + with: |
| 86 | + project_id: ${{ vars.BENCHMARK_LARGE_OLTP_PROJECTID }} |
| 87 | + api_key: ${{ secrets.NEON_STAGING_API_KEY }} |
| 88 | + |
| 89 | + - name: Set up Connection String |
| 90 | + id: set-up-connstr |
| 91 | + run: | |
| 92 | + case "${{ matrix.target }}" in |
| 93 | + new_branch) |
| 94 | + CONNSTR=${{ steps.create-neon-branch-oltp-target.outputs.dsn }} |
| 95 | + ;; |
| 96 | + reuse_branch) |
| 97 | + CONNSTR=${{ secrets.BENCHMARK_LARGE_OLTP_REUSE_CONNSTR }} |
| 98 | + ;; |
| 99 | + *) |
| 100 | + echo >&2 "Unknown target=${{ matrix.target }}" |
| 101 | + exit 1 |
| 102 | + ;; |
| 103 | + esac |
| 104 | +
|
| 105 | + echo "connstr=${CONNSTR}" >> $GITHUB_OUTPUT |
| 106 | +
|
| 107 | + - name: Benchmark pgbench with custom-scripts |
| 108 | + uses: ./.github/actions/run-python-test-set |
| 109 | + with: |
| 110 | + build_type: ${{ env.BUILD_TYPE }} |
| 111 | + test_selection: performance |
| 112 | + run_in_parallel: false |
| 113 | + save_perf_report: ${{ env.SAVE_PERF_REPORT }} |
| 114 | + extra_params: -m remote_cluster --timeout 21600 -k test_perf_oltp_large_tenant |
| 115 | + pg_version: ${{ env.PG_VERSION }} |
| 116 | + aws-oicd-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }} |
| 117 | + env: |
| 118 | + BENCHMARK_CONNSTR: ${{ steps.set-up-connstr.outputs.connstr }} |
| 119 | + VIP_VAP_ACCESS_TOKEN: "${{ secrets.VIP_VAP_ACCESS_TOKEN }}" |
| 120 | + PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}" |
| 121 | + |
| 122 | + - name: Delete Neon Branch for large tenant |
| 123 | + if: ${{ always() && matrix.target == 'new_branch' }} |
| 124 | + uses: ./.github/actions/neon-branch-delete |
| 125 | + with: |
| 126 | + project_id: ${{ vars.BENCHMARK_LARGE_OLTP_PROJECTID }} |
| 127 | + branch_id: ${{ steps.create-neon-branch-oltp-target.outputs.branch_id }} |
| 128 | + api_key: ${{ secrets.NEON_STAGING_API_KEY }} |
| 129 | + |
| 130 | + - name: Create Allure report |
| 131 | + id: create-allure-report |
| 132 | + if: ${{ !cancelled() }} |
| 133 | + uses: ./.github/actions/allure-report-generate |
| 134 | + with: |
| 135 | + aws-oicd-role-arn: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }} |
| 136 | + |
| 137 | + - name: Post to a Slack channel |
| 138 | + if: ${{ github.event.schedule && failure() }} |
| 139 | + uses: slackapi/slack-github-action@v1 |
| 140 | + with: |
| 141 | + channel-id: "C06KHQVQ7U3" # on-call-qa-staging-stream |
| 142 | + slack-message: | |
| 143 | + Periodic large oltp perf testing: ${{ job.status }} |
| 144 | + <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run> |
| 145 | + <${{ steps.create-allure-report.outputs.report-url }}|Allure report> |
| 146 | + env: |
| 147 | + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
0 commit comments