Add server side TLS certificate expiry tracking and INFO telemetry #361
Workflow file for this run
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: On-Demand Labeled Benchmark | |
| on: | |
| pull_request_target: | |
| types: [labeled] | |
| concurrency: | |
| group: ec2-al-2023-pr-benchmarking-arm64 | |
| cancel-in-progress: false | |
| defaults: | |
| run: | |
| shell: "bash -Eeuo pipefail -x {0}" | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| benchmark: | |
| if: | | |
| github.event.action == 'labeled' && github.event.label.name == 'run-benchmark' && | |
| github.repository == 'valkey-io/valkey' | |
| runs-on: ["self-hosted", "ec2-al-2023-pr-benchmarking-arm64"] | |
| timeout-minutes: 7200 | |
| steps: | |
| - name: Checkout valkey | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
| with: | |
| path: valkey | |
| fetch-depth: 0 | |
| ref: ${{ github.event.pull_request.merge_commit_sha }} | |
| persist-credentials: false | |
| - name: Checkout valkey-perf-benchmark | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
| with: | |
| repository: ${{ github.repository_owner }}/valkey-perf-benchmark | |
| path: valkey-perf-benchmark | |
| fetch-depth: 1 | |
| persist-credentials: false | |
| - name: Checkout valkey for latest benchmark. | |
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
| with: | |
| repository: valkey-io/valkey | |
| ref: "unstable" | |
| path: valkey_latest | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: kishaningithub/setup-python-amazon-linux@63dc7bd642c6a564d0a93dd4b1cbe3e448ce3621 # v1.0.18 | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| - name: Install dependencies | |
| working-directory: valkey-perf-benchmark | |
| run: | | |
| sudo dnf groupinstall "Development Tools" -y | |
| sudo dnf install -y gcc gcc-c++ make \ | |
| python3-devel \ | |
| openssl-devel \ | |
| bzip2-devel \ | |
| libffi-devel | |
| pip install -r requirements.txt | |
| - name: Build latest valkey_latest | |
| working-directory: valkey_latest | |
| run: | | |
| echo "Building latest valkey-benchmark for latest benchmark executable..." | |
| make distclean || true | |
| make -j | |
| if [[ -f "src/valkey-benchmark" ]]; then | |
| echo "Successfully built latest valkey-benchmark" | |
| ls -la src/valkey-benchmark | |
| ./src/valkey-benchmark --version || echo "Version check completed" | |
| else | |
| echo "Failed to build valkey-benchmark" | |
| exit 1 | |
| fi | |
| VALKEY_BENCHMARK_PATH="$(pwd)/src/valkey-benchmark" | |
| echo "VALKEY_BENCHMARK_PATH=$VALKEY_BENCHMARK_PATH" >> $GITHUB_ENV | |
| echo "Latest valkey-benchmark path: $VALKEY_BENCHMARK_PATH" | |
| - name: Run benchmarks | |
| working-directory: valkey-perf-benchmark | |
| run: | | |
| CONFIG_FILE="../valkey/.github/benchmark_configs/benchmark-config-arm.json" | |
| # Base benchmark arguments | |
| BENCHMARK_ARGS=( | |
| --config "$CONFIG_FILE" | |
| --commits "${{ github.event.pull_request.merge_commit_sha }}" | |
| --baseline "${{ github.event.pull_request.base.ref }}" | |
| --valkey-benchmark-path "$VALKEY_BENCHMARK_PATH" | |
| --target-ip ${{ secrets.EC2_ARM64_IP }} | |
| --valkey-path "../valkey" | |
| --results-dir "results" | |
| --runs 5 | |
| ) | |
| # Run benchmark | |
| python ./benchmark.py "${BENCHMARK_ARGS[@]}" | |
| - name: Compare results | |
| working-directory: valkey-perf-benchmark | |
| run: | | |
| python ./utils/compare_benchmark_results.py \ | |
| --baseline ./results/${{ github.event.pull_request.base.ref }}/metrics.json \ | |
| --new ./results/${{ github.event.pull_request.merge_commit_sha }}/metrics.json \ | |
| --output ../comparison.md \ | |
| --metrics rps | |
| - name: Upload artifacts | |
| if: always() | |
| continue-on-error: true | |
| uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 | |
| with: | |
| name: benchmark-results | |
| path: | | |
| ./valkey-perf-benchmark/results/${{ github.event.pull_request.merge_commit_sha }}/metrics.json | |
| ./valkey-perf-benchmark/results/${{ github.event.pull_request.base.ref }}/metrics.json | |
| comparison.md | |
| - name: Comment PR with results | |
| uses: actions/github-script@5c56fde4671bc2d3592fb0f2c5b5bab9ddae03b1 # v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const fs = require('fs'); | |
| const body = fs.readFileSync('comparison.md', 'utf8'); | |
| const {owner, repo} = context.repo; | |
| const sha = '${{ github.event.pull_request.head.sha }}'; | |
| const short = sha.slice(0,7); | |
| const link = `[\`${short}\`](https://github.com/${owner}/${repo}/commit/${sha})` | |
| await github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner, | |
| repo, | |
| body: `**Benchmark ran on this commit:** ${link}\n\n${body}` | |
| }); | |
| - name: Cleanup any running valkey processes | |
| if: always() | |
| continue-on-error: true | |
| run: | | |
| rm -rf comparison.md valkey* | |
| pkill -f valkey | |
| exit_code=$? | |
| if [ $exit_code -eq 0 ]; then | |
| echo "Killed running valkey processes" | |
| elif [ $exit_code -eq 1 ]; then | |
| echo "No valkey processes found to kill" | |
| else | |
| echo "Warning: pkill failed with exit code $exit_code" | |
| fi | |
| - name: Remove ${{ github.event.label.name }} label | |
| if: always() && github.event.label.name == 'run-benchmark' | |
| uses: actions/github-script@5c56fde4671bc2d3592fb0f2c5b5bab9ddae03b1 # v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| await github.rest.issues.removeLabel({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| name: '${{ github.event.label.name }}' | |
| }).catch(err => console.log('label not present', err.message)); |