Last active
July 22, 2021 13:06
-
-
Save tbg/fc4409e06b4ddc9abc58838cf5c0fe8b to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
set -euo pipefail | |
# NB: invoke this script with "caffeinate" on OSX and/or linux to | |
# avoid computer going to standby. | |
run=${1-none} | |
sha=$(git rev-parse --short HEAD) | |
abase="artifacts/${sha}" | |
a="${abase}/$(date '+%H%M%S')" | |
mkdir -p "${a}" | |
rt="${abase}/roachtest" | |
rp="${abase}/roachprod" | |
wl="${abase}/workload" | |
cr="${abase}/cockroach" | |
if [ ! -f "${wl}" ]; then | |
make bin/roach{prod,test} | |
mv -f bin/roachprod "${rp}" | |
mv -f bin/roachtest "${rt}" | |
./build/builder.sh mkrelease amd64-linux-gnu bin/workload | |
mv -f bin.docker_amd64/workload "${wl}" | |
fi | |
if [ ! -f "${cr}" ]; then | |
short="" # set to "short" to skip building UI | |
./build/builder.sh mkrelease amd64-linux-gnu "build${short}" | |
mv "cockroach${short}-linux-2.6.32-gnu-amd64" "${cr}" | |
fi | |
# Run roachtest. Use a random port so that multiple | |
# tests can be stressed from the same workstation. | |
"${rt}" run "${run}" \ | |
--port "$((8080+$RANDOM % 1000))" \ | |
--roachprod "${rp}" \ | |
--workload "${wl}" \ | |
--cockroach "${cr}" \ | |
--artifacts "${a}" \ | |
--count 10 # --debug --local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment