-
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.
71770: bazel: run acceptance tests under Bazel r=rickystewart a=rail This patch makes the acceptance test work under Bazel. * Add `AbsCertsDir()` in order to keep track of certificate path for cases when tests change the working directory. * docker-compose tests to use interpolation and environment variables in order to override `CERTS_DIR` and `COCKROACH_BINARY`. * Add `copyRunfiles()` in order to copy Bazel-generated symlinked runfiles as regular files to make them available in docker mounted volumes. Related: #71932, #71930 Fixes: #59446 Release note: None 72574: ci: add bazel roachtest gce teamcity job r=rail a=rickystewart Release note: None 73055: ui: prevent undefined axis label on custom chart r=zachlite a=zachlite Release note (bug fix): Y-axis labels on custom charts no longer display 'undefined'. @thtruo, this fix addresses the issue as described in #72115. Now, when the user selects a new unit from the dropdown, the user will experience up to a 10 second delay before the axis label refreshes. @nathanstilwell and I investigated this last week, and we'd need more time to think of a solution that doesn't create long term maintenance headaches. The benefit of this PR as it stands is that the Y-axis label is noticeably less broken. FYI. 73080: bazel: don't shard `kvserver` test r=rail a=rickystewart The `exclusive` tag here prevents the shards from running concurrently. See #65407, #65582. Release note: None Co-authored-by: Rail Aliiev <[email protected]> Co-authored-by: Ricky Stewart <[email protected]> Co-authored-by: Zach Lite <[email protected]>
- Loading branch information
Showing
26 changed files
with
367 additions
and
121 deletions.
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
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,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -xeuo pipefail | ||
|
||
dir="$(dirname $(dirname $(dirname $(dirname $(dirname "${0}")))))" | ||
source "$dir/teamcity-support.sh" | ||
|
||
tc_prepare | ||
|
||
export ARTIFACTSDIR=$PWD/artifacts/acceptance | ||
mkdir -p "$ARTIFACTSDIR" | ||
|
||
tc_start_block "Run acceptance tests" | ||
bazel run \ | ||
//pkg/acceptance:acceptance_test \ | ||
--config=crosslinux --config=test \ | ||
--test_arg=-l="$ARTIFACTSDIR" \ | ||
--test_env=TZ=America/New_York \ | ||
--test_timeout=1800 | ||
tc_end_block "Run acceptance tests" |
11 changes: 11 additions & 0 deletions
11
build/teamcity/cockroach/nightlies/roachtest_nightly_gce.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,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -exuo pipefail | ||
|
||
dir="$(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 LITERAL_ARTIFACTS_DIR=$root/artifacts -e BUILD_TAG -e CLOUD -e COCKROACH_DEV_LICENSE -e COUNT -e GOOGLE_EPHEMERAL_CREDENTIALS -e SLACK_TOKEN -e TC_BUILD_BRANCH -e TC_BUILD_ID" \ | ||
run_bazel build/teamcity/cockroach/nightlies/roachtest_nightly_impl.sh |
46 changes: 46 additions & 0 deletions
46
build/teamcity/cockroach/nightlies/roachtest_nightly_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,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -exuo pipefail | ||
|
||
dir="$(dirname $(dirname $(dirname $(dirname "${0}"))))" | ||
|
||
source "$dir/teamcity-support.sh" | ||
|
||
if [[ ! -f ~/.ssh/id_rsa.pub ]]; then | ||
ssh-keygen -q -C "roachtest-nightly-bazel $(date)" -N "" -f ~/.ssh/id_rsa | ||
fi | ||
|
||
bazel build --config crosslinux --config ci --config with_ui -c opt \ | ||
//pkg/cmd/cockroach //pkg/cmd/workload //pkg/cmd/roachtest \ | ||
//pkg/cmd/roachprod //c-deps:libgeos | ||
BAZEL_BIN=$(bazel info bazel-bin --config crosslinux --config ci --config with_ui -c opt) | ||
# Move this stuff to bin for simplicity. | ||
mkdir -p bin | ||
chmod o+rwx bin | ||
cp $BAZEL_BIN/pkg/cmd/cockroach/cockroach_/cockroach bin | ||
cp $BAZEL_BIN/pkg/cmd/roachprod/roachprod_/roachprod bin | ||
cp $BAZEL_BIN/pkg/cmd/roachtest/roachtest_/roachtest bin | ||
cp $BAZEL_BIN/pkg/cmd/workload/workload_/workload bin | ||
chmod a+w bin/cockroach bin/roachprod bin/roachtest bin/workload | ||
# Stage the geos libs in the appropriate spot. | ||
mkdir -p lib.docker_amd64 | ||
chmod o+rwx lib.docker_amd64 | ||
cp $BAZEL_BIN/c-deps/libgeos/lib/libgeos.so lib.docker_amd64 | ||
cp $BAZEL_BIN/c-deps/libgeos/lib/libgeos_c.so lib.docker_amd64 | ||
chmod a+w lib.docker_amd64/libgeos.so lib.docker_amd64/libgeos_c.so | ||
|
||
artifacts=/artifacts | ||
source $root/build/teamcity/util/roachtest_util.sh | ||
|
||
build/teamcity-roachtest-invoke.sh \ | ||
--cloud="${CLOUD}" \ | ||
--count="${COUNT-1}" \ | ||
--parallelism="${PARALLELISM}" \ | ||
--cpu-quota="${CPUQUOTA}" \ | ||
--cluster-id="${TC_BUILD_ID}" \ | ||
--build-tag="${BUILD_TAG}" \ | ||
--cockroach="${PWD}/bin/cockroach" \ | ||
--artifacts=/artifacts \ | ||
--artifacts-literal="${LITERAL_ARTIFACTS_DIR:-}" \ | ||
--slack-token="${SLACK_TOKEN}" \ | ||
"${TESTS}" |
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,75 @@ | ||
# Common logic used by the nightly roachtest scripts (Bazel and non-Bazel). | ||
|
||
# Set up Google credentials. Note that we need this for all clouds since we upload | ||
# perf artifacts to Google Storage at the end. | ||
if [[ "$GOOGLE_EPHEMERAL_CREDENTIALS" ]]; then | ||
echo "$GOOGLE_EPHEMERAL_CREDENTIALS" > creds.json | ||
gcloud auth activate-service-account --key-file=creds.json | ||
export ROACHPROD_USER=teamcity | ||
else | ||
echo 'warning: GOOGLE_EPHEMERAL_CREDENTIALS not set' >&2 | ||
echo "Assuming that you've run \`gcloud auth login\` from inside the builder." >&2 | ||
fi | ||
|
||
# Early bind the stats dir. Roachtest invocations can take ages, and we want the | ||
# date at the time of the start of the run (which identifies the version of the | ||
# code run best). | ||
stats_dir="$(date +"%Y%m%d")-${TC_BUILD_ID}" | ||
|
||
# Set up a function we'll invoke at the end. | ||
function upload_stats { | ||
if tc_release_branch; then | ||
bucket="cockroach-nightly-${CLOUD}" | ||
if [[ "${CLOUD}" == "gce" ]]; then | ||
# GCE, having been there first, gets an exemption. | ||
bucket="cockroach-nightly" | ||
fi | ||
|
||
remote_artifacts_dir="artifacts-${TC_BUILD_BRANCH}" | ||
if [[ "${TC_BUILD_BRANCH}" == "master" ]]; then | ||
# The master branch is special, as roachperf hard-codes | ||
# the location. | ||
remote_artifacts_dir="artifacts" | ||
fi | ||
|
||
# The stats.json files need some path translation: | ||
# ${artifacts}/path/to/test/stats.json | ||
# to | ||
# gs://${bucket}/artifacts/${stats_dir}/path/to/test/stats.json | ||
# | ||
# `find` below will expand "{}" as ./path/to/test/stats.json. We need | ||
# to bend over backwards to remove the `./` prefix or gsutil will have | ||
# a `.` folder in ${stats_dir}, which we don't want. | ||
(cd "${artifacts}" && \ | ||
while IFS= read -r f; do | ||
if [[ -n "${f}" ]]; then | ||
gsutil cp "${f}" "gs://${bucket}/${remote_artifacts_dir}/${stats_dir}/${f}" | ||
fi | ||
done <<< "$(find . -name stats.json | sed 's/^\.\///')") | ||
fi | ||
} | ||
|
||
# Upload any stats.json we can find, no matter what happens. | ||
trap upload_stats EXIT | ||
|
||
# Set up the parameters for the roachtest invocation. | ||
PARALLELISM=16 | ||
CPUQUOTA=1024 | ||
TESTS="" | ||
case "${CLOUD}" in | ||
gce) | ||
;; | ||
aws) | ||
PARALLELISM=3 | ||
CPUQUOTA=384 | ||
if [ -z "${TESTS}" ]; then | ||
# NB: anchor ycsb to beginning of line to avoid matching `zfs/ycsb/*` which | ||
# isn't supported on AWS at time of writing. | ||
TESTS="kv(0|95)|^ycsb|tpcc/(headroom/n4cpu16)|tpccbench/(nodes=3/cpu=16)|scbench/randomload/(nodes=3/ops=2000/conc=1)|backup/(KMS/n3cpu4)" | ||
fi | ||
;; | ||
*) | ||
echo "unknown cloud ${CLOUD}" | ||
exit 1 | ||
;; | ||
esac |
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
Oops, something went wrong.