Skip to content

Commit 30e8829

Browse files
heschigopherbot
authored andcommitted
cmd/bootstrapswarm,cmd/buildlet/stage0: connect to server specified by $SWARMING
We use multiple swarming servers now. Change-Id: I9bca7aeaef98921030638d679952084024af6b6c Reviewed-on: https://go-review.googlesource.com/c/build/+/520235 Run-TryBot: Heschi Kreinick <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Heschi Kreinick <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent a775ecf commit 30e8829

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cmd/bootstrapswarm/bootstrapswarm.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import (
4848
var (
4949
tokenFilePath = flag.String("token-file-path", defaultTokenLocation(), "Path to the token file (used when not on GCE)")
5050
hostname = flag.String("hostname", os.Getenv("HOSTNAME"), "Hostname of machine to bootstrap (required)")
51+
swarming = flag.String("swarming", "chromium-swarm.appspot.com", "Swarming server to connect to")
5152
)
5253

5354
func main() {
@@ -98,7 +99,7 @@ func bootstrap(ctx context.Context, hostname, tokenPath string) error {
9899
httpHeaders["X-Luci-Machine-Token"] = tok.LuciMachineToken
99100
}
100101
log.Println("Downloading the swarming bot")
101-
req, err := http.NewRequestWithContext(ctx, http.MethodGet, `https://chromium-swarm.appspot.com/bot_code`, nil)
102+
req, err := http.NewRequestWithContext(ctx, http.MethodGet, "https://"+*swarming+"/bot_code", nil)
102103
if err != nil {
103104
return fmt.Errorf("http.NewRequest: %w", err)
104105
}

cmd/buildlet/stage0/run-worker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ SWARM_DIR=/b/swarming
2525
mkdir -p $SWARM_DIR
2626
chown swarming:swarming $SWARM_DIR
2727

28-
su -c "$(dirname $0)/bootstrapswarm" swarming &
28+
su -c "$(dirname $0)/bootstrapswarm --swarming ${SWARMING}.appspot.com" swarming &
2929
wait %1
3030
exit $?

0 commit comments

Comments
 (0)