-
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.
roachtest: update CI to enable metamorphic arm64 and fips
Support for metamorphic arm64 and fips roachtests has been added in [1]. This change refactors the CI wrapper script to add the missing arm64 and fips builds for the required binaries and libs. We also change roachtest's CLI arg. `--cockroach-short` to `cockroach-ea` which better captures the fact that this binary is compiled with _enabled assertions_, i.e., crdb_test using crdb_test build tag. The fact that it's a "short" variant, i.e., without UI, is immaterial at this time. In future, we might explore roachtests which involve the UI, in which case `--cockroach-ea` might be replaced by the ("long") crdb binary. Small additional fixes are also included to correctly strip libgeos arch suffix and skip roachtests which aren't currently supported on arm64. [1] #103710 Epic: none Release note: None
- Loading branch information
1 parent
b250d9c
commit 1e3101e
Showing
11 changed files
with
162 additions
and
103 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
82 changes: 59 additions & 23 deletions
82
build/teamcity/cockroach/nightlies/roachtest_compile_bits.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 |
---|---|---|
@@ -1,27 +1,63 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Builds all bits needed for roachtests, stages them in bin/ and lib.docker_amd64/. | ||
platform=${1:-crosslinux} | ||
|
||
bazel build --config $platform --config ci --config with_ui -c opt --config force_build_cdeps \ | ||
//pkg/cmd/cockroach //pkg/cmd/workload //pkg/cmd/roachtest \ | ||
//c-deps:libgeos | ||
bazel build --config $platform --config ci -c opt //pkg/cmd/cockroach-short --crdb_test | ||
BAZEL_BIN=$(bazel info bazel-bin --config $platform --config ci --config with_ui -c opt) | ||
# Move this stuff to bin for simplicity. | ||
# Builds all bits needed for roachtests, stages them in bin/ and lib/. | ||
cross_builds=(crosslinux crosslinuxarm crosslinuxfips) | ||
|
||
# Prepare the bin/ and lib/ directories. | ||
mkdir -p bin | ||
chmod o+rwx bin | ||
cp $BAZEL_BIN/pkg/cmd/cockroach/cockroach_/cockroach bin | ||
# Copy the binary with enabled assertions while adding "-ea" suffix (which | ||
# stands for "enabled assertions"). | ||
cp $BAZEL_BIN/pkg/cmd/cockroach-short/cockroach-short_/cockroach-short bin/cockroach-short-ea | ||
cp $BAZEL_BIN/pkg/cmd/roachtest/roachtest_/roachtest bin | ||
cp $BAZEL_BIN/pkg/cmd/workload/workload_/workload bin | ||
chmod a+w bin/cockroach bin/cockroach-short-ea 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_foreign/lib/libgeos.so lib.docker_amd64 | ||
cp $BAZEL_BIN/c-deps/libgeos_foreign/lib/libgeos_c.so lib.docker_amd64 | ||
chmod a+w lib.docker_amd64/libgeos.so lib.docker_amd64/libgeos_c.so | ||
ln -s lib.docker_amd64 lib | ||
mkdir -p lib | ||
chmod o+rwx lib | ||
|
||
for platform in "${cross_builds[@]}"; do | ||
if [[ $platform == crosslinux ]]; then | ||
os=linux | ||
arch=amd64 | ||
elif [[ $platform == crosslinuxarm ]]; then | ||
os=linux | ||
arch=arm64 | ||
elif [[ $platform == crosslinuxfips ]]; then | ||
os=linux | ||
arch=amd64-fips | ||
else | ||
echo "unknown or unsupported platform $platform" | ||
exit 1 | ||
fi | ||
|
||
echo "Building $platform, os=$os, arch=$arch..." | ||
# Build cockroach, workload and geos libs. | ||
bazel build --config $platform --config ci --config with_ui -c opt --config force_build_cdeps \ | ||
//pkg/cmd/cockroach //pkg/cmd/workload \ | ||
//c-deps:libgeos | ||
# N.B. roachtest is currently executed only on a TC agent running linux/amd64, so we build it once. | ||
if [[ $os == "linux" && $arch == "amd64" ]]; then | ||
bazel build --config $platform --config ci -c opt //pkg/cmd/roachtest | ||
fi | ||
# Build cockroach-short with assertions enabled. | ||
bazel build --config $platform --config ci -c opt //pkg/cmd/cockroach-short --crdb_test | ||
# Copy the binaries. | ||
BAZEL_BIN=$(bazel info bazel-bin --config $platform --config ci --config with_ui -c opt) | ||
# N.B. currently, we support only one roachtest binary, so elide the suffix. | ||
if [[ $os == "linux" && $arch == "amd64" ]]; then | ||
cp $BAZEL_BIN/pkg/cmd/roachtest/roachtest_/roachtest bin/roachtest | ||
# Make it writable to simplify cleanup and copying (e.g., scp retry). | ||
chmod a+w bin/roachtest | ||
fi | ||
cp $BAZEL_BIN/pkg/cmd/cockroach/cockroach_/cockroach bin/cockroach.$os-$arch | ||
cp $BAZEL_BIN/pkg/cmd/workload/workload_/workload bin/workload.$os-$arch | ||
# N.B. "-ea" suffix stands for enabled-assertions. | ||
cp $BAZEL_BIN/pkg/cmd/cockroach-short/cockroach-short_/cockroach-short bin/cockroach-ea.$os-$arch | ||
# Make it writable to simplify cleanup and copying (e.g., scp retry). | ||
chmod a+w bin/cockroach.$os-$arch bin/workload.$os-$arch bin/cockroach-ea.$os-$arch | ||
|
||
# Copy geos libs. | ||
cp $BAZEL_BIN/c-deps/libgeos_foreign/lib/libgeos.so lib/libgeos.$os-$arch.so | ||
cp $BAZEL_BIN/c-deps/libgeos_foreign/lib/libgeos_c.so lib/libgeos_c.$os-$arch.so | ||
# Make it writable to simplify cleanup and copying (e.g., scp retry). | ||
chmod a+w lib/libgeos.$os-$arch.so lib/libgeos_c.$os-$arch.so | ||
|
||
done | ||
|
||
ls -l bin | ||
ls -l lib | ||
|
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
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.