Skip to content

Commit 4751177

Browse files
teamcity: add new CI job for PUA
During each release, there is a need to run PUA. This new CI job allows triggering the PUA workflow on an as-needed basis for a specific release. The job generates a JSON file as output, which is consumed by the benchmarking portal to display the results. Epic: none Release note: None
1 parent 8ebacaf commit 4751177

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2025 The Cockroach Authors.
4+
#
5+
# Use of this software is governed by the CockroachDB Software License
6+
# included in the /LICENSE file.
7+
8+
9+
set -exuo pipefail
10+
11+
dir="$(dirname $(dirname $(dirname $(dirname $(dirname "${0}")))))"
12+
13+
source "$dir/teamcity-support.sh" # For $root
14+
source "$dir/teamcity-bazel-support.sh" # For run_bazel
15+
#
16+
BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e LITERAL_ARTIFACTS_DIR=$root/artifacts -e GOOGLE_APPLICATION_CREDENTIALS_CONTENT -e GOOGLE_SERVICE_ACCOUNT" \
17+
run_bazel build/teamcity/internal/cockroach/pua/pua_run_impl.sh
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2025 The Cockroach Authors.
4+
#
5+
# Use of this software is governed by the CockroachDB Software License
6+
# included in the /LICENSE file.
7+
8+
9+
set -exuo pipefail
10+
11+
export ROACHPROD_DISABLED_PROVIDERS=aws,azure,ibm
12+
export ROACHPROD_DISABLE_UPDATE_CHECK=true
13+
export ROACHPROD_GCE_DEFAULT_SERVICE_ACCOUNT=$GOOGLE_SERVICE_ACCOUNT
14+
export ROACHPROD_GCE_DEFAULT_PROJECT=cockroach-ephemeral
15+
16+
# build the binaries - roachprod, roachtest and drtprod
17+
build() {
18+
config="crosslinux"
19+
# Prepare the bin/ and lib/ directories.
20+
mkdir -p bin
21+
chmod o+rwx bin
22+
23+
# Array of arguments to be passed to bazel for the component.
24+
bazel_args=()
25+
26+
# Array of build artifacts. Each item has format "src:dest"; src is relative to
27+
# the bazel-bin directory, dst is relative to cwd.
28+
artifacts=()
29+
30+
bazel_args+=(//pkg/cmd/roachtest)
31+
artifacts+=("pkg/cmd/roachtest/roachtest_/roachtest:bin/roachtest")
32+
33+
bazel_args+=(//pkg/cmd/roachprod)
34+
artifacts+=("pkg/cmd/roachprod/roachprod_/roachprod:bin/roachprod")
35+
36+
bazel_args+=(//pkg/cmd/drtprod)
37+
artifacts+=("pkg/cmd/drtprod/drtprod_/drtprod:bin/drtprod")
38+
39+
bazel build --config $config -c opt "${bazel_args[@]}"
40+
BAZEL_BIN=$(bazel info bazel-bin --config $config -c opt)
41+
for artifact in "${artifacts[@]}"; do
42+
src=${artifact%%:*}
43+
dst=${artifact#*:}
44+
cp "$BAZEL_BIN/$src" "$dst"
45+
# Make files writable to simplify cleanup and copying (e.g., scp retry).
46+
chmod a+w "$dst"
47+
done
48+
49+
# add bin to path
50+
export PATH=$PATH:$(pwd)/bin
51+
}
52+
53+
# Set up Google credentials. Note that we need this for all clouds since we upload
54+
# perf artifacts to Google Storage at the end.
55+
if [[ "$GOOGLE_APPLICATION_CREDENTIALS_CONTENT" ]]; then
56+
echo "$GOOGLE_APPLICATION_CREDENTIALS_CONTENT" > creds.json
57+
gcloud auth activate-service-account --key-file=creds.json
58+
59+
# Set GOOGLE_APPLICATION_CREDENTIALS so that gcp go libraries can find it.
60+
export GOOGLE_APPLICATION_CREDENTIALS="$(pwd)/creds.json"
61+
else
62+
echo 'warning: GOOGLE_EPHEMERAL_CREDENTIALS not set' >&2
63+
exit 1
64+
fi
65+
66+
# Run the build function
67+
build
68+
#
69+
roachprod list
70+
#drtprod list

0 commit comments

Comments
 (0)