Check for shape Arm A1 before applying 2x OCPU to vCPU multiplier #70
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: Cluster Autoscaler Benchmark | |
| on: | |
| pull_request: | |
| paths: | |
| - 'cluster-autoscaler/**' | |
| permissions: | |
| contents: read | |
| jobs: | |
| benchmark: | |
| name: Run and Compare Benchmarks | |
| runs-on: ubuntu-latest | |
| # Do not block valid PRs on benchmark issues as we are still stabilizing. | |
| continue-on-error: true | |
| steps: | |
| - name: Checkout PR | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| path: pr | |
| - name: Checkout Base | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: ${{ github.event.pull_request.base.ref }} | |
| path: base | |
| - name: Set up Go | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version-file: pr/cluster-autoscaler/go.mod | |
| cache-dependency-path: pr/cluster-autoscaler/go.sum | |
| - name: Apt-get dependencies | |
| run: sudo apt-get install libseccomp-dev -qq | |
| - name: Run Benchmark (Base) | |
| shell: bash | |
| run: | | |
| cd base/cluster-autoscaler | |
| go test -v -bench=BenchmarkRunOnce -benchmem -count=10 ./core/bench/... -args -gc true | tee ../../base.txt | |
| - name: Run Benchmark (PR) | |
| shell: bash | |
| run: | | |
| cd pr/cluster-autoscaler | |
| go test -v -bench=BenchmarkRunOnce -benchmem -count=10 ./core/bench/... -args -gc true | tee ../../pr.txt | |
| - name: Install benchstat | |
| run: go install golang.org/x/perf/cmd/benchstat@latest | |
| - name: Compare Results | |
| shell: bash | |
| run: | | |
| echo "### Cluster Autoscaler Benchmark Results" >> $GITHUB_STEP_SUMMARY | |
| echo "Comparing PR branch against \`${{ github.event.pull_request.base.ref }}\`" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| if [ -s base.txt ] && [ -s pr.txt ]; then | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| $(go env GOPATH)/bin/benchstat base.txt pr.txt >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "Error: Benchmark results not found or empty." >> $GITHUB_STEP_SUMMARY | |
| exit 1 | |
| fi |