Skip to content

build: use bazel for roachtest stress#81804

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
nicktrav:nickt.debug
May 25, 2022
Merged

build: use bazel for roachtest stress#81804
craig[bot] merged 1 commit intocockroachdb:masterfrom
nicktrav:nickt.debug

Conversation

@nicktrav
Copy link
Copy Markdown
Collaborator

Currently, the Roachtest Stress TeamCity job uses make (via the
mkrelease.sh script) for building the required binaries. Recently, the
pipeline started hanging while building the binary. Rather than
investigating and fixing the existing make-based pipeline, convert the
job to using Bazel for building the binaries.

Retain the existing entrypoint to the job, converting it to use the
existing pattern
of calling run_bazel with the required
environment variables, invoking an _impl.sh script. The existing logic
is moved into the new _impl.sh script, with some minor additions to
source some additional scripts.

Additionally, the TeamCity job itself was updated to set pass in the
TARGET_CLOUD environment variable (set to gce), and remove the need
to build within a container (instead deferring to Bazel to manage the
build environment). The diff for the TeamCity pipeline is as follows
(for posterity):

18c18
<
---
>       <param name="env.TARGET_CLOUD" value="gce" />
24c24
<           <param name="plugin.docker.imageId" value="%builder.dockerImage%" />
---
>
28,29c28,29
< export BUILD_TAG="$(git describe --abbrev=0 --tags --match=v[0-9]*)"
< ./build/teamcity-roachtest-stress.sh]]></param>
---
> build_tag="$(git describe --abbrev=0 --tags --match=v[0-9]*)"
> CLOUD=${TARGET_CLOUD} BUILD_TAG="${build_tag}" ./build/teamcity-roachtest-stress.sh]]></param>

Release note: None.

Currently, the Roachtest Stress TeamCity job uses `make` (via the
`mkrelease.sh` script) for building the required binaries. Recently, the
pipeline started hanging while building the binary. Rather than
investigating and fixing the existing `make`-based pipeline, convert the
job to using Bazel for building the binaries.

Retain the existing entrypoint to the job, converting it to use [the
existing pattern][1] of calling `run_bazel` with the required
environment variables, invoking an `_impl.sh` script. The existing logic
is moved into the new `_impl.sh` script, with some minor additions to
source some additional scripts.

Additionally, the TeamCity job itself was updated to set pass in the
`TARGET_CLOUD` environment variable (set to `gce`), and remove the need
to build within a container (instead deferring to Bazel to manage the
build environment). The diff for the TeamCity pipeline is as follows
(for posterity):

```diff
18c18
<
---
>       <param name="env.TARGET_CLOUD" value="gce" />
24c24
<           <param name="plugin.docker.imageId" value="%builder.dockerImage%" />
---
>
28,29c28,29
< export BUILD_TAG="$(git describe --abbrev=0 --tags --match=v[0-9]*)"
< ./build/teamcity-roachtest-stress.sh]]></param>
---
> build_tag="$(git describe --abbrev=0 --tags --match=v[0-9]*)"
> CLOUD=${TARGET_CLOUD} BUILD_TAG="${build_tag}" ./build/teamcity-roachtest-stress.sh]]></param>
```

Release note: None.

[1]: https://github.com/cockroachdb/cockroach/blob/12198a51408e7333cd4f96b221e6734239479765/build/teamcity/cockroach/nightlies/roachtest_nightly_gce.sh#L10-L11
@nicktrav nicktrav requested review from rickystewart and tbg May 25, 2022 02:24
@nicktrav nicktrav requested a review from a team as a code owner May 25, 2022 02:24
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@nicktrav
Copy link
Copy Markdown
Collaborator Author

nicktrav commented May 25, 2022

I was able to run this through to completion a couple time (logs, logs), to confirm this still works as intended.

Copy link
Copy Markdown
Collaborator

@rickystewart rickystewart left a comment

Choose a reason for hiding this comment

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

Nice, thank you!

@nicktrav
Copy link
Copy Markdown
Collaborator Author

TFTR!

bors r=rickystewart

@craig
Copy link
Copy Markdown
Contributor

craig bot commented May 25, 2022

Build succeeded:

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.

3 participants