Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add microbenchmark script for roachprod-microbench #96723

Merged

Conversation

herkolategan
Copy link
Collaborator

Add a new nightlies teamcity build script that utilises the dev test-binaries and the roachprod-microbench command. The script can be used to store a microbenchmarks checkpoint for a given git revision to a bucket in gcs, by specifying a publish path. A roachprod cluster is created by the script, as specified by environment variables. The clean-up is managed by TeamCity.

Alternatively two binaries can be compared by supplying the related comparison binaries environment variables. This compare directory should be omitted in this case. The script requires a gcs path to download the comparison binaries from. The running time will be considerably longer, but there will be less variance in the results.

Subsequent runs can then be made with the same script to compare against a previous checkpoint, by supplying a compare path. The script takes numerous environment variables to configure the microbenchmarks cluster and arguments. These can be tweaked to configure different run variations and packages to target.

Resolves: #93893
See also: #90837, #91184

Epic: CRDB-20903

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@srosenberg srosenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @herkolategan)


-- commits line 4 at r1:
Should it be weekly?


build/teamcity/cockroach/nightlies/microbenchmark.sh line 21 at r1 (raw file):

"test --test_tmpdir=/tmp/cockroach"
)
printf "%s\n" "${bazelOpts[@]}" > ~/.bazelrc

I forget how/where $HOME is mapped inside the docker container. Could this have a side-effect on reusing the same TC agent with a different CI job?


build/teamcity/cockroach/nightlies/microbenchmark.sh line 51 at r1 (raw file):

  -libdir=./lib \
  -shell="$BENCH_SHELL" \
  ${BENCH_COMPARE_BINARIES:+-compare-binaries="$BENCH_COMPARE_BINARIES"} \

All of these env. vars can be overridden via the CI job? We should document their meaning and default value.

Copy link
Collaborator Author

@herkolategan herkolategan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @srosenberg)


-- commits line 4 at r1:

Previously, srosenberg (Stan Rosenberg) wrote…

Should it be weekly?

True, the parent directory is sometimes confusing as this is where the weekly scripts live as well. I'll add the weekly postfix to the script as well.


build/teamcity/cockroach/nightlies/microbenchmark.sh line 21 at r1 (raw file):

Previously, srosenberg (Stan Rosenberg) wrote…

I forget how/where $HOME is mapped inside the docker container. Could this have a side-effect on reusing the same TC agent with a different CI job?

Good point, for assurance I'll change this to rather use .bazelrc.user in the pwd which should have the same effect.


build/teamcity/cockroach/nightlies/microbenchmark.sh line 51 at r1 (raw file):

Previously, srosenberg (Stan Rosenberg) wrote…

All of these env. vars can be overridden via the CI job? We should document their meaning and default value.

Good idea, I'll add some comments to the script.

@herkolategan herkolategan force-pushed the hbl/build-microbenchmarks-script branch 7 times, most recently from 9cfb80d to 07cd2da Compare March 13, 2023 14:37
@herkolategan herkolategan force-pushed the hbl/build-microbenchmarks-script branch 4 times, most recently from 1c32c20 to 9ae11b8 Compare March 21, 2023 15:55
@herkolategan herkolategan requested a review from srosenberg March 21, 2023 15:56
@herkolategan herkolategan marked this pull request as ready for review March 21, 2023 15:56
@herkolategan herkolategan requested a review from a team as a code owner March 21, 2023 15:56
@herkolategan herkolategan force-pushed the hbl/build-microbenchmarks-script branch 3 times, most recently from 3ea2b44 to b1a3363 Compare April 19, 2023 09:44
@blathers-crl
Copy link

blathers-crl bot commented Apr 19, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Copy link
Member

@srosenberg srosenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@herkolategan herkolategan force-pushed the hbl/build-microbenchmarks-script branch from b1a3363 to 0ac35d8 Compare May 9, 2023 10:07
@herkolategan
Copy link
Collaborator Author

bors r=srosenberg

@craig
Copy link
Contributor

craig bot commented May 9, 2023

Build failed:

@herkolategan
Copy link
Collaborator Author

Don't merge this yet, still need to switch over to the command line docker args vs. env docker args.

Add a new weekly teamcity build script that utilises the `dev test-binaries`
and the `roachprod-microbench` command. The script can be used to store a
microbenchmarks checkpoint for a given `git` revision to a bucket in gcs, by
specifying a publish path. A `roachprod` cluster is created by the script, as
specified by environment variables. The clean-up is managed by TeamCity.

Alternatively two binaries can be compared by supplying the related comparison
binaries environment variables. The compare directory should be omitted in this
case. The script requires a gcs path to download the comparison binaries from.
The running time will be considerably longer, but there will be less variance in
the results.

Subsequent runs can then be made with the same script to compare against a
previous checkpoint, by supplying a compare path. The script takes numerous
environment variables to configure the microbenchmarks cluster and arguments.
These can be tweaked to configure different run variations and packages to
target.

Resolves: cockroachdb#93893
See also: cockroachdb#90837, cockroachdb#91184

Epic: CRDB-20903

Release note: None
@herkolategan
Copy link
Collaborator Author

bors r=srosenberg

@craig
Copy link
Contributor

craig bot commented May 11, 2023

Build succeeded:

@craig craig bot merged commit 0f8e3a0 into cockroachdb:master May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build: add microbenchmark script for roachprod-bench
3 participants