Compare ToplingDB bench #16
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
| name: Compare ToplingDB bench | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| rocksdb_image: | |
| description: GHCR image for official rocksdb standalone (empty = ghcr.io/<owner>/nebula-standalone-rocksdb:latest) | |
| required: false | |
| default: "" | |
| topling_image: | |
| description: GHCR image for topling standalone (empty = ghcr.io/<owner>/nebula-standalone-topling:latest) | |
| required: false | |
| default: "" | |
| scale_factor: | |
| description: LDBC scale factor | |
| required: false | |
| default: "1" | |
| stress_args: | |
| description: Args passed to run.py stress run --args= | |
| required: false | |
| default: "-d 30s" | |
| permissions: | |
| contents: read | |
| packages: read | |
| concurrency: | |
| group: compare-toplingdb-${{ github.ref }} | |
| cancel-in-progress: false | |
| env: | |
| BENCH_ROOT: ${{ github.workspace }} | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| bench: | |
| name: ${{ matrix.profile }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 120 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| profile: [rocksdb, conservative, enterprise] | |
| steps: | |
| - name: Checkout nebula-bench | |
| uses: actions/checkout@v5 | |
| - name: Cache Maven | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('scripts/vendor/**', 'scripts/ci/bootstrap-dsol-xml-maven.sh') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.8" | |
| - name: Set up JDK 1.8 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: "8" | |
| - name: Set up Maven | |
| uses: stCarolas/setup-maven@v5.1 | |
| with: | |
| maven-version: 3.5.4 | |
| - name: Bootstrap LDBC datagen Maven deps | |
| run: bash scripts/ci/bootstrap-dsol-xml-maven.sh | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.20.3" | |
| - name: Cache Hadoop | |
| uses: actions/cache@v5 | |
| with: | |
| path: target/data/hadoop-3.2.1.tar.gz | |
| key: ${{ runner.os }}-hadoop-${{ hashFiles('scripts/generate-data.sh') }} | |
| - name: Install bench deps (importer + k6) | |
| env: | |
| CGO_ENABLED: "0" | |
| INSTALL_SYSTEM_DEPS: "1" | |
| run: bash scripts/ci/install-bench-deps.sh | |
| - name: Login to GHCR | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Pull image and run profile bench | |
| env: | |
| ROCKSDB_IMAGE: ${{ inputs.rocksdb_image != '' && inputs.rocksdb_image || format('ghcr.io/{0}/nebula-standalone-rocksdb:latest', github.repository_owner) }} | |
| TOPLING_IMAGE: ${{ inputs.topling_image != '' && inputs.topling_image || format('ghcr.io/{0}/nebula-standalone-topling:latest', github.repository_owner) }} | |
| SCALE_FACTOR: ${{ inputs.scale_factor }} | |
| STRESS_ARGS: ${{ inputs.stress_args }} | |
| # enterprise image default write_buffer_size=2G OOMs GH runners under INSERT; CI overrides to 128M | |
| ENTERPRISE_WRITE_BUFFER_SIZE: "128M" | |
| run: | | |
| set -euo pipefail | |
| echo "ROCKSDB_IMAGE=${ROCKSDB_IMAGE}" | |
| echo "TOPLING_IMAGE=${TOPLING_IMAGE}" | |
| # Guard: no nebula compile in this workflow | |
| if grep -RInE 'cmake|make build|docker build' scripts/ci/run-profile-bench.sh >/dev/null; then | |
| echo "unexpected compile hooks in run-profile-bench.sh" >&2 | |
| exit 1 | |
| fi | |
| bash scripts/ci/run-profile-bench.sh "${{ matrix.profile }}" | |
| - name: Upload profile output | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: bench-${{ matrix.profile }} | |
| path: output/${{ matrix.profile }}-* | |
| if-no-files-found: warn | |
| - name: Bench job summary | |
| if: always() | |
| run: | | |
| { | |
| echo "## bench-${{ matrix.profile }}" | |
| echo | |
| echo "Workflow run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| echo | |
| echo "Download artifact **bench-${{ matrix.profile }}** from the run Artifacts section." | |
| } >> "${GITHUB_STEP_SUMMARY}" | |
| report: | |
| name: comparison-report | |
| needs: bench | |
| if: ${{ !cancelled() && needs.bench.result == 'success' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| concurrency: | |
| group: compare-toplingdb-pages | |
| cancel-in-progress: false | |
| steps: | |
| - name: Checkout nebula-bench | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.8" | |
| - name: Install report deps | |
| run: python3 -m pip install --upgrade pip && python3 -m pip install -r requirements.txt | |
| - name: Download bench artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: output | |
| pattern: bench-* | |
| merge-multiple: true | |
| - name: Generate comparison report | |
| run: bash scripts/ci/generate-comparison-report.sh | |
| - name: Upload comparison report artifact | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: comparison-report | |
| path: output/comparison-report/ | |
| if-no-files-found: error | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: output/comparison-report | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 | |
| - name: Publish report links | |
| if: always() | |
| env: | |
| PAGE_URL: ${{ steps.deployment.outputs.page_url }} | |
| run: | | |
| set -euo pipefail | |
| run_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| { | |
| echo "## ToplingDB Benchmark Comparison" | |
| echo | |
| echo "**Workflow run:** ${run_url}" | |
| echo | |
| echo "**Artifact:** 下载 \`comparison-report\` → 打开 \`comparison.html\`" | |
| echo | |
| } >> "${GITHUB_STEP_SUMMARY}" | |
| if [[ "${{ steps.deployment.outcome }}" == "success" && -n "${PAGE_URL}" ]]; then | |
| base="${PAGE_URL%/}/" | |
| { | |
| echo "**Pages 报告:** ${base}" | |
| echo | |
| echo "| 报告 | URL |" | |
| echo "| --- | --- |" | |
| echo "| 三方案对比 | ${base}comparison.html |" | |
| echo "| 索引 | ${base} |" | |
| } >> "${GITHUB_STEP_SUMMARY}" | |
| fi |