-
Notifications
You must be signed in to change notification settings - Fork 17.8k
SlowBots
The Go build system supports "SlowBots", which are a way to configure the TryBots (pre-submit builders) to add additional builders into the set of build configurations that TryBots normally run.
Normally TryBots only run things that are fast and elastically provisioned. That is, TryBots run tests for ports that are available on Google Cloud where we have tons of capacity and can spin up many VMs at will, sharding out test execution widely so the TryBots complete in 5-10 minutes.
But sometimes that's not enough. SlowBots let you say that you're cool waiting a long time until some specific set of builders becomes available. (There is often only one physical machine for some configurations, and often backlogged with work, and that builder might be slow too.)
Click "Choose Tryjobs" under the commit message and a dialog will appear.
The dialog will ask you to click checkboxes for the builds you would like to run against your CL.
Select the builds you would like to run, and click the "Add" button in the dialog. Then, set the Commit-Queue
= +1
label as usual.
Each build's name roughly indicates what it will do, but below is some more detail:
- Builds may start with
x_$REPO
where$REPO
is some module likegolang.org/x/$REPO
(such asx_review-gotip-linux-amd64
). This build will run tests in that repository. - If builds do not start with
x_$REPO
(likegotip-linux-amd64
), they are testing the main Go repository (including the standard library and toolchain). - Builds will then always list a Go version to build against, like
gotip
orgo1.21
. The former builds against themaster
branch of the main Go repository, while the latter builds against theHEAD
of the corresponding release branch. - Builds then list the OS and CPU architecture (specifically, the
GOOS
andGOARCH
) to test against. - Lastly, builds list some modifications, such as
gotip-linux-amd64-longtest-race
. Below is a list of some of the modifications and what they mean:-
longtest
runs the full suite of tests for the corresponding platform and repository. -
race
runs tests under the race detector. -
misccompile
will cross-compile all packages (including test packages) for all supported platforms as a smoke test. The platform for these builds is just the "host" platform for the cross-compilation.
-
There are currently a lot more possible builds listed than what's actually supported or valid.
Here are some general guidelines for which SlowBots will work as expected:
- If you're running SlowBots for a CL for one of the
golang.org/x/$REPO
repositories, then all thex_$REPO-.*
builders will work as expected. Other builds will fail. - If you're running SlowBots for a CL for the main Go repository, then every build that matches the branch the CL is for will work. For example, if you have a CL for the
master
branch, then every build with a name containinggotip
will work as expected (x_tools-gotip-linux-amd64
,gotip-windows-amd64
, etc.). If you have a CL for therelease-branch.go1.21
branch, then every build with a name containinggo1.21
will work as expected (x_tools-go1.21-linux-amd64
,go1.21-windows-amd64
, etc.).
TODO: Apply these guidelines as filters automatically.
We're currently in the middle of a migration to a new open-source CI system created by the Chromium project called LUCI. The above instructions describe how to run SlowBots on LUCI, but not all ports have been migrated to LUCI yet. In the interim, these ports are still available on the old infrastructure. Below are instructions on how to use SlowBots on the old infrastructure.
- Use the Gerrit web UI to reply and select
Run-TryBot
=+1
instead ofCommit-Queue
=+1
. - Before clicking "Send" write a magic comment in the comment section (where it says Say something nice...):
TRY=ppc64le, freebsd, netbsd-386, ios, linux-arm64-packet
... where the terms after TRY=
are either:
-
GOOS
(picks best one) -
GOARCH
(picks best one) -
GOOS-GOARCH
(picks best one) -
specific-builder-name
(you specify it explicitly by its exact name; see the full list at https://farmer.golang.org/builders)
For the main Go repository, the terms after TRY=
can also be:
-
x/repo
, whererepo
is one of the golang.org/x repositories whose tests should be executed. This runs a default builder for the given repo (linux-amd64
as of writing). -
x/repo@builder
, whererepo
is as above, andbuilder
is a builder name from the builder list. This runs the specified builder for the given repo. For example,x/sys@linux-arm64-aws
.
When running TryBots again later, the most recent TRY=
comment on the current patchset is used. To turn it off set TRY=
with an empty string after the equals sign. If the current patchset doesn't have a TRY=
comment, the most recent TRY=
comment is used.
-
TRY=
comments are ignored if they're not on the same comment that started the TryBots - TryBots (and SlowBots) don't run if there's already a TryBot-Result
- The
git-codereview mail
tool's-trybot
flag doesn't support this yet, so use the web UI. - If TryBots are already running, deleting the
Run-TryBot+1
vote and re-doing it won't re-start the TryBot set, so it won't look at your TRY= line, until the next run when it's done. (But you'll need to delete the TryBot-Result somehow: manually, rebasing, uploading new version) - If you select a builder that's offline, it'll currently just wait forever for it to show up. There's no timeout yet.
- If you specify an unknown
TRY=
token, it'll just ignore it and won't report an error. - There's no
all
alias. That's kinda intentional, to prevent overuse that might cause the SlowBots to get even slower for everybody. But we might add it later anyway. See golang.org/issue/34501#issuecomment-544585711.