linkdb perf baseline #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ---------------------------------------------------------------------- | |
| # .github/workflows/perf.yml | |
| # linkdb performance baseline CI (Tier 3 of 3-tier CI model). | |
| # | |
| # pgbench Stage 1/3 perf baseline check, completely decoupled from | |
| # the push / tag / nightly path. Per spec-1.23 Q8 B-WARN this is | |
| # *not* a blocking gate (GitHub Actions shared runners exhibit | |
| # 10-20% variance unsuitable for blocking thresholds);output is an | |
| # artifact for manual review. | |
| # | |
| # Pre-3-tier this ran on every push as part of ci.yml. The 60s | |
| # pgbench × 2 platforms cost ~2 min wallclock for warn-only signal | |
| # that nobody read on routine PRs, so it moved here. | |
| # | |
| # Author: SqlRush <sqlrush@gmail.com> | |
| # | |
| # Portions Copyright (c) 2026, pgrac contributors | |
| # | |
| # Triggers: | |
| # - workflow_dispatch (manual) | |
| # - schedule cron Monday 06:00 UTC weekly | |
| # | |
| # Future Stage 6 spec upgrades to blocking gate once self-hosted runner | |
| # / same-run ratio comparison is in place. | |
| # ---------------------------------------------------------------------- | |
| name: linkdb perf baseline | |
| on: | |
| schedule: | |
| - cron: '0 6 * * 1' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| perf-baseline: | |
| name: Stage perf baseline (${{ matrix.os }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| libreadline-dev zlib1g-dev libicu-dev \ | |
| liblz4-dev libzstd-dev libssl-dev libxml2-dev \ | |
| pkg-config | |
| - name: Install macOS dependencies | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install readline icu4c lz4 zstd openssl@3 libxml2 pkg-config || true | |
| { | |
| echo "PKG_CONFIG_PATH=$(brew --prefix icu4c)/lib/pkgconfig:$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix lz4)/lib/pkgconfig:$(brew --prefix zstd)/lib/pkgconfig" | |
| echo "LDFLAGS=-L$(brew --prefix readline)/lib -L$(brew --prefix zstd)/lib -L$(brew --prefix lz4)/lib -L$(brew --prefix openssl@3)/lib -L$(brew --prefix icu4c)/lib" | |
| echo "CPPFLAGS=-I$(brew --prefix readline)/include -I$(brew --prefix zstd)/include -I$(brew --prefix lz4)/include -I$(brew --prefix openssl@3)/include -I$(brew --prefix icu4c)/include" | |
| } >> $GITHUB_ENV | |
| - name: Configure (--disable-cluster baseline) | |
| run: | | |
| ./configure \ | |
| --prefix=$HOME/linkdb-disable-install \ | |
| --enable-cassert --enable-debug \ | |
| --with-openssl --with-icu --with-lz4 --with-zstd \ | |
| --disable-cluster | |
| - name: Build + Install (--disable-cluster baseline) | |
| run: | | |
| if [ "$RUNNER_OS" = "Linux" ]; then | |
| make -j$(getconf _NPROCESSORS_ONLN) | |
| else | |
| make -j$(sysctl -n hw.ncpu) | |
| fi | |
| make install | |
| make distclean | |
| - name: Configure (--enable-cluster candidate) | |
| run: | | |
| ./configure \ | |
| --prefix=$HOME/linkdb-install \ | |
| --enable-cassert --enable-debug \ | |
| --with-openssl --with-icu --with-lz4 --with-zstd \ | |
| --enable-cluster | |
| - name: Build + Install (--enable-cluster candidate) | |
| run: | | |
| if [ "$RUNNER_OS" = "Linux" ]; then | |
| make -j$(getconf _NPROCESSORS_ONLN) | |
| else | |
| make -j$(sysctl -n hw.ncpu) | |
| fi | |
| make install | |
| - name: Stage off/on pgbench baseline (warn-only) | |
| run: | | |
| PGRAC_ENABLE_INSTALL=$HOME/linkdb-install \ | |
| PGRAC_DISABLE_INSTALL=$HOME/linkdb-disable-install \ | |
| scripts/perf/run-baseline.sh \ | |
| --mode=both \ | |
| --scale="${PERF_SCALE:-10}" \ | |
| --duration="${PERF_DURATION:-30}" \ | |
| --clients="${PERF_CLIENTS:-4}" \ | |
| --jobs="${PERF_JOBS:-2}" | |
| - name: Collect perf artifacts | |
| if: always() | |
| run: | | |
| mkdir -p perf-baseline-artifact | |
| cp -R scripts/perf/results perf-baseline-artifact/results 2>/dev/null || true | |
| - name: Upload perf baseline artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: perf-baseline-${{ matrix.os }}-${{ github.run_id }} | |
| path: perf-baseline-artifact/ | |
| if-no-files-found: ignore | |
| retention-days: 60 | |
| # ---------------------------------------------------------------------- | |
| # spec-3.4e D4 — NEW perf-2node-baseline job | |
| # | |
| # 4 workload class via ClusterPair fixture (Perl runner). Per L91 | |
| # tier separation, weekly + manual workflow_dispatch only; | |
| # warn-only artifact upload (not blocking). | |
| # | |
| # macOS gets continue-on-error per spec-3.4e F6 (ClusterPair | |
| # stability on macOS runner not yet verified;Linux primary). | |
| # ---------------------------------------------------------------------- | |
| perf-2node-baseline: | |
| name: Stage 3.4e 2-node perf baseline (${{ matrix.os }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 | |
| continue-on-error: ${{ matrix.os == 'macos-latest' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| libreadline-dev zlib1g-dev libicu-dev \ | |
| liblz4-dev libzstd-dev libssl-dev libxml2-dev \ | |
| pkg-config libipc-run-perl | |
| - name: Install macOS dependencies | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install readline icu4c lz4 zstd openssl@3 libxml2 pkg-config || true | |
| sudo cpan -i IPC::Run || true | |
| { | |
| echo "PKG_CONFIG_PATH=$(brew --prefix icu4c)/lib/pkgconfig:$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix lz4)/lib/pkgconfig:$(brew --prefix zstd)/lib/pkgconfig" | |
| echo "LDFLAGS=-L$(brew --prefix readline)/lib -L$(brew --prefix zstd)/lib -L$(brew --prefix lz4)/lib -L$(brew --prefix openssl@3)/lib -L$(brew --prefix icu4c)/lib" | |
| echo "CPPFLAGS=-I$(brew --prefix readline)/include -I$(brew --prefix zstd)/include -I$(brew --prefix lz4)/include -I$(brew --prefix openssl@3)/include -I$(brew --prefix icu4c)/include" | |
| } >> $GITHUB_ENV | |
| - name: Configure (--enable-cluster + --enable-injection-points) | |
| run: | | |
| ./configure \ | |
| --prefix=$HOME/linkdb-install \ | |
| --enable-cassert --enable-debug \ | |
| --enable-injection-points --enable-tap-tests \ | |
| --with-openssl --with-icu --with-lz4 --with-zstd \ | |
| --enable-cluster | |
| - name: Build + Install | |
| run: | | |
| if [ "$RUNNER_OS" = "Linux" ]; then | |
| make -j$(getconf _NPROCESSORS_ONLN) | |
| else | |
| make -j$(sysctl -n hw.ncpu) | |
| fi | |
| make install | |
| - name: Run 2-node baseline (3 workload classes — warn-only) | |
| run: | | |
| export PGRAC_ENABLE_INSTALL=$HOME/linkdb-install | |
| export PATH=$HOME/linkdb-install/bin:$PATH | |
| # PGRAC: PG TAP framework needs port-reservation directory + pg_regress | |
| # path for ClusterPair --config-auth (spec-3.4e Hardening v1.0.1 fix — | |
| # ubuntu-latest 1st run silently no-op'd class 2/3/4 without these). | |
| mkdir -p /tmp/pgrac-portlock | |
| export PG_TEST_PORT_DIR=/tmp/pgrac-portlock | |
| export PG_REGRESS="$(pwd)/src/test/regress/pg_regress" | |
| # class 2/3/4 via Perl runner (ClusterPair fixture); | |
| # class 1 (single-node-no-peer) covered by existing perf-baseline job above. | |
| for class in 2node-local-affinity 2node-cross-node-visibility 2node-hot-row-lock 2node-subxact-nesting 2node-multixact-shared-lock; do | |
| echo "=== Running $class ===" | |
| rm -rf tmp_check # avoid "File exists" Bail between classes | |
| scripts/perf/run-2node-baseline.sh \ | |
| --mode="$class" \ | |
| --scale="${PERF_SCALE:-10}" \ | |
| --duration="${PERF_DURATION:-30}" \ | |
| --clients="${PERF_CLIENTS:-4}" \ | |
| --jobs="${PERF_JOBS:-2}" | |
| test -n "$(find scripts/perf/results -maxdepth 1 -name "3-4e-${class}-*.json" -print -quit)" | |
| done | |
| - name: Collect 2-node perf artifacts | |
| if: always() | |
| run: | | |
| mkdir -p perf-2node-artifact | |
| cp -R scripts/perf/results perf-2node-artifact/results 2>/dev/null || true | |
| # PGRAC: also upload PG TAP framework regress logs for diagnostics | |
| # (Perl runner redirects STDOUT/STDERR there; without these, CI silent | |
| # failures are invisible). | |
| cp -R log perf-2node-artifact/log 2>/dev/null || true | |
| - name: Upload 2-node perf artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: perf-2node-baseline-${{ matrix.os }}-${{ github.run_id }} | |
| path: perf-2node-artifact/ | |
| if-no-files-found: ignore | |
| retention-days: 60 |