-
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.
teamcity: add build configuration to wrap run-pgo-build
This build configuration wraps `run-pgo-build` to run a roachtest with profiling enabled. The result profile is then uploaded to a GCS bucket. Part of: CRDB-44692 Epic: CRDB-41952 Release note: None
- Loading branch information
1 parent
ce53018
commit b4d5aff
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
build/teamcity/internal/cockroach/build/ci/generate-profile-impl.sh
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,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2024 The Cockroach Authors. | ||
# | ||
# Use of this software is governed by the CockroachDB Software License | ||
# included in the /LICENSE file. | ||
|
||
set -xeuo pipefail | ||
|
||
dir="$(dirname $(dirname $(dirname $(dirname $(dirname $(dirname "${0}"))))))" | ||
|
||
cleanup() { | ||
rm -f ~/.config/gcloud/application_default_credentials.json | ||
} | ||
trap cleanup EXIT | ||
|
||
source "$dir/teamcity-support.sh" | ||
google_credentials="$GOOGLE_CREDENTIALS" | ||
log_into_gcloud | ||
|
||
filename=$(date +"%Y%m%d%H%M%S").pprof | ||
|
||
bazel build --config ci //pkg/cmd/run-pgo-build | ||
_bazel/bin/pkg/cmd/run-pgo-build/run-pgo-build_/run-pgo-build -out "$filename" | ||
|
||
gsutil cp "$filename" "gs://cockroach-profiles/$filename" | ||
rm "$filename" |
16 changes: 16 additions & 0 deletions
16
build/teamcity/internal/cockroach/build/ci/generate-profile.sh
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,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2024 The Cockroach Authors. | ||
# | ||
# Use of this software is governed by the CockroachDB Software License | ||
# included in the /LICENSE file. | ||
|
||
set -xeuo pipefail | ||
|
||
dir="$(dirname $(dirname $(dirname $(dirname $(dirname $(dirname "${0}"))))))" | ||
|
||
source "$dir/teamcity-support.sh" # For $root | ||
source "$dir/teamcity-bazel-support.sh" # For run_bazel | ||
|
||
BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e GOOGLE_CREDENTIALS -e TC_API_PASSWORD -e TC_API_USER -e TC_BUILD_BRANCH -e TC_SERVER_URL" \ | ||
run_bazel build/teamcity/internal/cockroach/build/ci/generate-profile-impl.sh |