-
Notifications
You must be signed in to change notification settings - Fork 109
SRE-231: Enable self-hosted benchmark runners #8212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c8a7532
32f7273
9ffc0c5
fcf8524
cef80ba
4ce6451
5cd5b26
6feff20
72bb54d
70599a0
d0521c6
ca61d81
62b47c3
0ee7103
710264b
6230ed8
dc5e703
967931f
b06cad1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,8 +32,12 @@ jobs: | |
|
|
||
| setup: | ||
| needs: [optimize-ci] | ||
| if: needs.optimize-ci.outputs.skip == 'false' | ||
| runs-on: ubuntu-24.04 | ||
| if: | | ||
| needs.optimize-ci.outputs.skip == 'false' && ( | ||
| github.event_name == 'push' || | ||
| github.event.pull_request.head.repo.full_name == github.repository | ||
| ) | ||
| runs-on: [self-hosted, bench-lg] | ||
| permissions: | ||
| id-token: write | ||
| outputs: | ||
|
|
@@ -75,19 +79,19 @@ jobs: | |
| strategy: | ||
| matrix: ${{ fromJSON(needs.setup.outputs.unit) }} | ||
| fail-fast: false | ||
| if: needs.setup.outputs.unit != '{"name":[],"include":[]}' | ||
| runs-on: ubuntu-24.04 | ||
| if: | | ||
| needs.setup.outputs.unit != '{"name":[],"include":[]}' && ( | ||
| github.event_name == 'push' || | ||
| github.event.pull_request.head.repo.full_name == github.repository | ||
| ) | ||
| runs-on: [self-hosted, bench-lg] | ||
| steps: | ||
| - name: Checkout base branch | ||
| if: github.event_name == 'pull_request' | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| ref: ${{ github.event.pull_request.base.sha }} | ||
|
|
||
| - name: Clean up disk | ||
| if: github.event_name == 'pull_request' | ||
| uses: ./.github/actions/clean-up-disk | ||
|
|
||
| - name: Install tools | ||
| if: github.event_name == 'pull_request' | ||
| uses: ./.github/actions/install-tools | ||
|
|
@@ -125,10 +129,6 @@ jobs: | |
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
|
|
||
| - name: Clean up disk | ||
| if: github.event_name != 'pull_request' | ||
| uses: ./.github/actions/clean-up-disk | ||
|
|
||
| - name: Install tools | ||
| uses: ./.github/actions/install-tools | ||
| with: | ||
|
|
@@ -196,19 +196,19 @@ jobs: | |
| fail-fast: false | ||
| env: | ||
| HASH_GRAPH_PG_DATABASE: graph | ||
| if: needs.setup.outputs.integration != '{"name":[],"include":[]}' | ||
| runs-on: ubuntu-24.04 | ||
| if: | | ||
| needs.setup.outputs.integration != '{"name":[],"include":[]}' && ( | ||
| github.event_name == 'push' || | ||
| github.event.pull_request.head.repo.full_name == github.repository | ||
| ) | ||
| runs-on: [self-hosted, bench-lg] | ||
| steps: | ||
| - name: Checkout base branch | ||
| if: github.event_name == 'pull_request' | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||
| with: | ||
| ref: ${{ github.event.pull_request.base.sha }} | ||
|
|
||
| - name: Clean up disk | ||
| if: github.event_name == 'pull_request' | ||
| uses: ./.github/actions/clean-up-disk | ||
|
|
||
| - name: Install tools | ||
| if: github.event_name == 'pull_request' | ||
| uses: ./.github/actions/install-tools | ||
|
|
@@ -238,8 +238,23 @@ jobs: | |
| touch .env.local | ||
|
|
||
| echo 'HASH_GRAPH_PG_DATABASE=graph' > .env.local | ||
|
|
||
| cp .env.local .env.test.local | ||
|
|
||
| # Tune Postgres for benchmarks | ||
| cat >> apps/hash-external-services/postgres/postgresql.conf << 'EOF' | ||
| # Benchmark optimizations | ||
| shared_buffers = 4GB | ||
| effective_cache_size = 8GB | ||
| work_mem = 256MB | ||
| maintenance_work_mem = 1GB | ||
| wal_buffers = 64MB | ||
| random_page_cost = 1.1 | ||
| effective_io_concurrency = 200 | ||
| synchronous_commit = off | ||
| EOF | ||
|
|
||
| sed -i 's/shm_size: 1GB/shm_size: 4GB/' apps/hash-external-services/docker-compose.yml | ||
|
|
||
| yarn external-services:test up --wait | ||
|
|
||
| - name: Start background tasks | ||
|
|
@@ -288,10 +303,6 @@ jobs: | |
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
|
|
||
| - name: Clean up disk | ||
| if: github.event_name != 'pull_request' | ||
| uses: ./.github/actions/clean-up-disk | ||
|
|
||
| - name: Install tools | ||
| uses: ./.github/actions/install-tools | ||
| with: | ||
|
|
@@ -318,8 +329,23 @@ jobs: | |
| touch .env.local | ||
|
|
||
| echo 'HASH_GRAPH_PG_DATABASE=graph' > .env.local | ||
|
|
||
| cp .env.local .env.test.local | ||
|
|
||
| # Tune Postgres for benchmarks | ||
| cat >> apps/hash-external-services/postgres/postgresql.conf << 'EOF' | ||
| # Benchmark optimizations | ||
| shared_buffers = 4GB | ||
| effective_cache_size = 8GB | ||
| work_mem = 256MB | ||
| maintenance_work_mem = 1GB | ||
| wal_buffers = 64MB | ||
| random_page_cost = 1.1 | ||
| effective_io_concurrency = 200 | ||
| synchronous_commit = off | ||
| EOF | ||
|
|
||
| sed -i 's/shm_size: 1GB/shm_size: 4GB/' apps/hash-external-services/docker-compose.yml | ||
|
|
||
| yarn external-services:test up --wait | ||
|
|
||
| - name: Start background tasks | ||
|
|
@@ -389,6 +415,10 @@ jobs: | |
| if: ${{ success() || failure() }} | ||
| run: yarn workspace @apps/hash-external-services deploy logs --timestamps | ||
|
|
||
| - name: Tear down external services | ||
| if: ${{ success() || failure() }} | ||
| run: yarn workspace @apps/hash-external-services deploy:test down | ||
indietyp marked this conversation as resolved.
Show resolved
Hide resolved
indietyp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Upload background tasks logs | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| if: success() || failure() | ||
|
|
@@ -397,11 +427,21 @@ jobs: | |
| path: | | ||
| var/logs | ||
|
|
||
| - name: Remove log files | ||
| if: ${{ success() || failure() }} | ||
| run: rm -rf var/logs | ||
|
|
||
| passed: | ||
| name: Benches passed | ||
| needs: [setup, unit-benches, integration-benches, optimize-ci] | ||
| if: always() && needs.optimize-ci.outputs.skip == 'false' | ||
| runs-on: ubuntu-latest | ||
| if: | | ||
| always() && | ||
| needs.optimize-ci.outputs.skip == 'false' && | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This guard prevents π€ Was this useful? React with π or π |
||
| ( | ||
| github.event_name == 'push' || | ||
| github.event.pull_request.head.repo.full_name == github.repository | ||
| ) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fork check on passed job blocks fork PR statusThe fork check added to the |
||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| pull-requests: write | ||
| steps: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| services: | ||
| postgres: | ||
| shm_size: 4GB | ||
|
|
||
| volumes: | ||
| - ./postgres/postgresql.bench.conf:/etc/postgresql/postgresql.conf:ro |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Allow connections from all addresses | ||
| listen_addresses = '*' | ||
| log_min_messages = warning | ||
|
|
||
| max_connections = 300 | ||
|
|
||
| shared_buffers = 4GB | ||
| effective_cache_size = 8GB | ||
| work_mem = 256MB | ||
| maintenance_work_mem = 1GB | ||
| wal_buffers = 64MB | ||
| random_page_cost = 1.1 | ||
| effective_io_concurrency = 200 | ||
| synchronous_commit = off |
Uh oh!
There was an error while loading. Please reload this page.