-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9434611
commit a041098
Showing
12 changed files
with
307 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Microbench Build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: "Git reference to checkout (head or base commit)" | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: [self-hosted, basic_runner_group] | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout HEAD commit for scripts | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha || github.ref }} | ||
|
||
- name: Copy build script | ||
run: cp build/github/microbenchmarks-build.sh ${RUNNER_TEMP}/ | ||
|
||
- run: ./build/github/get-engflow-keys.sh | ||
|
||
- name: Checkout build commit | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
|
||
- name: Build tests | ||
run: ${RUNNER_TEMP}/microbenchmarks-build.sh | ||
env: | ||
BUILD_SHA: ${{ inputs.ref }} | ||
|
||
- name: Clean up | ||
run: ./build/github/cleanup-engflow-keys.sh | ||
if: always() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Microbenchmarks CI | ||
on: | ||
pull_request: | ||
types: [ opened, reopened, synchronize ] | ||
branches: [ master ] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
microbench-build-head: | ||
if: false # This will always skip this job | ||
name: Head Binaries | ||
uses: ./.github/workflows/microbenchmarks-build.yaml | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha || github.ref }} | ||
|
||
microbench-build-base: | ||
if: false # This will always skip this job | ||
name: Base Binaries | ||
uses: ./.github/workflows/microbenchmarks-build.yaml | ||
with: | ||
ref: ${{ github.event.pull_request.base.sha }} | ||
|
||
compare: | ||
if: false # This will always skip this job | ||
name: compare | ||
runs-on: [self-hosted, basic_big_runner_group] | ||
timeout-minutes: 30 | ||
needs: [microbench-build-head, microbench-build-base] | ||
steps: | ||
- name: Checkout HEAD commit | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha || github.ref }} | ||
|
||
- name: compare tests | ||
run: build/github/microbenchmarks-compare.sh | ||
env: | ||
BASE_SHA: ${{ github.event.pull_request.base.sha }} | ||
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.ref }} | ||
|
||
comment: | ||
name: compare | ||
runs-on: [self-hosted, basic_runner_group] | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout HEAD commit | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha || github.ref }} | ||
|
||
- run: ./build/github/get-engflow-keys.sh | ||
|
||
- name: Summary | ||
run: ./build/github/microbenchmarks-summary.sh | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} | ||
GITHUB_REPOSITORY: ${{ github.repository }} | ||
|
||
- name: Clean up | ||
run: ./build/github/cleanup-engflow-keys.sh | ||
if: always() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2025 The Cockroach Authors. | ||
# | ||
# Use of this software is governed by the CockroachDB Software License | ||
# included in the /LICENSE file. | ||
|
||
set -euxo pipefail | ||
|
||
storage_bucket="cockroach-microbench-ci" | ||
output_url="gs://${storage_bucket}/builds/${BUILD_SHA}/pkg/sql/tests/tests_test_/tests_test" | ||
|
||
# Disable parallel uploads, as it requires specific permissions | ||
gcloud config set storage/parallel_composite_upload_enabled False | ||
|
||
if gcloud storage ls "${output_url}" &>/dev/null; then | ||
echo "Build for $BUILD_SHA already exists. Skipping..." | ||
exit 0 | ||
fi | ||
|
||
bazel build //pkg/sql/tests:tests_test \ | ||
--jobs 100 \ | ||
--crdb_test_off \ | ||
--bes_keywords integration-test-artifact-build \ | ||
--config=crosslinux \ | ||
--remote_download_minimal \ | ||
$(./build/github/engflow-args.sh) | ||
|
||
# Copy the binary to a GCS cache | ||
bazel_bin=$(bazel info bazel-bin --config=crosslinux) | ||
gcloud storage cp "${bazel_bin}/pkg/sql/tests/tests_test_/tests_test" "${output_url}" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2025 The Cockroach Authors. | ||
# | ||
# Use of this software is governed by the CockroachDB Software License | ||
# included in the /LICENSE file. | ||
|
||
set -euxo pipefail | ||
|
||
storage_bucket="cockroach-microbench-ci" | ||
base_url="gs://${storage_bucket}/builds/${BASE_SHA}/pkg/sql/tests/tests_test_/tests_test" | ||
head_url="gs://${storage_bucket}/builds/${HEAD_SHA}/pkg/sql/tests/tests_test_/tests_test" | ||
|
||
mkdir -p base head | ||
gcloud storage cp "${base_url}" base/tests_test | ||
gcloud storage cp "${head_url}" head/tests_test | ||
chmod +x base/tests_test head/tests_test | ||
|
||
export COCKROACH_RANDOM_SEED=1 | ||
# Run the benchmarks for 10 loops | ||
for _ in {1..10}; do | ||
./base/tests_test -test.run=^$ -test.v -test.benchmem -test.bench=BenchmarkSysbench/SQL/3node/oltp_read_write -test.count=1 -test.benchtime=2000x | ||
./head/tests_test -test.run=^$ -test.v -test.benchmem -test.bench=BenchmarkSysbench/SQL/3node/oltp_read_write -test.count=1 -test.benchtime=2000x | ||
done |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2025 The Cockroach Authors. | ||
# | ||
# Use of this software is governed by the CockroachDB Software License | ||
# included in the /LICENSE file. | ||
|
||
bazel build --config=crosslinux $(./build/github/engflow-args.sh) \ | ||
--jobs 100 \ | ||
--bes_keywords integration-test-artifact-build \ | ||
//pkg/cmd/microbench-ci \ | ||
|
||
bazel_bin=$(bazel info bazel-bin --config=crosslinux) | ||
|
||
$bazel_bin/pkg/cmd/microbench-ci/microbench-ci_/microbench-ci |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") | ||
|
||
go_library( | ||
name = "microbench-ci_lib", | ||
srcs = ["main.go"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/cmd/microbench-ci", | ||
visibility = ["//visibility:private"], | ||
deps = [ | ||
"@com_github_google_go_github_v61//github", | ||
"@org_golang_x_oauth2//:oauth2", | ||
], | ||
) | ||
|
||
go_binary( | ||
name = "microbench-ci", | ||
embed = [":microbench-ci_lib"], | ||
visibility = ["//visibility:public"], | ||
) |
Oops, something went wrong.