Skip to content

Commit

Permalink
cmd/bootstrapswarm,cmd/buildlet/stage0: connect to server specified b…
Browse files Browse the repository at this point in the history
…y $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]>
  • Loading branch information
heschi authored and gopherbot committed Aug 16, 2023
1 parent a775ecf commit 30e8829
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/bootstrapswarm/bootstrapswarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import (
var (
tokenFilePath = flag.String("token-file-path", defaultTokenLocation(), "Path to the token file (used when not on GCE)")
hostname = flag.String("hostname", os.Getenv("HOSTNAME"), "Hostname of machine to bootstrap (required)")
swarming = flag.String("swarming", "chromium-swarm.appspot.com", "Swarming server to connect to")
)

func main() {
Expand Down Expand Up @@ -98,7 +99,7 @@ func bootstrap(ctx context.Context, hostname, tokenPath string) error {
httpHeaders["X-Luci-Machine-Token"] = tok.LuciMachineToken
}
log.Println("Downloading the swarming bot")
req, err := http.NewRequestWithContext(ctx, http.MethodGet, `https://chromium-swarm.appspot.com/bot_code`, nil)
req, err := http.NewRequestWithContext(ctx, http.MethodGet, "https://"+*swarming+"/bot_code", nil)
if err != nil {
return fmt.Errorf("http.NewRequest: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/buildlet/stage0/run-worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ SWARM_DIR=/b/swarming
mkdir -p $SWARM_DIR
chown swarming:swarming $SWARM_DIR

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

0 comments on commit 30e8829

Please sign in to comment.