Skip to content

Commit 425389d

Browse files
committed
Gomote.md: update some stale information and examples
Change-Id: I52f9e35d2495c8cea3ba47aefd6ccbde61e7ab6d Reviewed-on: https://go-review.googlesource.com/c/wiki/+/658815 Reviewed-by: Carlos Amedee <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent 8bd0c75 commit 425389d

File tree

1 file changed

+46
-53
lines changed

1 file changed

+46
-53
lines changed

Gomote.md

Lines changed: 46 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ The most basic usage of the gomote tool involves just a few steps:
1717
1. Push code to the instance.
1818
1. Run commands on the instance.
1919

20-
Running the `create` command will list available instance types.
20+
Running the `create` command with the `-list` flag will list available instance types.
2121

2222
```
23-
$ gomote create
24-
(list tons of buildlet types)
23+
$ gomote create -list
24+
(list tons of builder types)
2525
```
2626

2727
Then, an instance can be created by specifying an instance type. The instance's name will be printed to stdout, so the result may be stored in an environment variable. (There may be other logging messages, but they will be on stderr and each line will have a '#' prefix.)
2828

2929
```
30-
$ gomote create linux-amd64
31-
# still creating linux-amd64 (1) after 5s; 0 requests ahead of you
32-
user-linux-amd64-0
30+
$ gomote create gotip-linux-amd64
31+
# still creating gotip-linux-amd64 (1) after 5s; 0 requests ahead of you
32+
user-gotip-linux-amd64-0
3333
```
3434

35-
With that instance's name you can now push (more specifically sync the contents of) a local Go repository to the instance and install a bootstrap toolchain. The repository you sync will appear at the `go` subdirectory of `$WORKDIR` (the default directory of all gomote operations). The bootstrap toolchain will always go into the `go1.4` subdirectory (even if the bootstrap toolchain isn't from version 1.4).
35+
With that instance's name you can now push a GOROOT to the instance and install a bootstrap toolchain. The repository you sync will appear at the `go` subdirectory of `$WORKDIR` (the default directory of all gomote operations). The bootstrap toolchain will always go into the `go1.4` subdirectory (even if the bootstrap toolchain isn't from version 1.4).
3636

3737
```
38-
$ GOROOT=/path/to/local/go/repo gomote push user-linux-amd64-0
39-
$ gomote ls user-linux-amd64-0
38+
$ GOROOT=/path/to/local/go/repo gomote push user-gotip-linux-amd64-0
39+
$ gomote ls user-gotip-linux-amd64-0
4040
go
4141
go1.4
4242
```
@@ -46,28 +46,36 @@ Note that `push` really is a "sync" operation, so next time you push the gomote
4646
With a toolchain installed, you can now build it by running commands on the instance. The `run` command allows you to specify an executable to run. The executable must be specified relative to `$WORKDIR` (e.g. `go/bin/go`) or via an absolute path (e.g. `/bin/bash`). That executable will then run with its current working directory set to the directory containing the executable.
4747

4848
```
49-
$ gomote run user-linux-amd64-0 go/src/make.bash
49+
$ gomote run user-gotip-linux-amd64-0 go/src/make.bash
5050
```
5151

5252
To then run the built Go toolchain, use `go/bin/go`.
5353

5454
```
55-
$ gomote run user-linux-amd64-0 go/bin/go test -run="TestSomething" -v runtime
55+
$ gomote run user-gotip-linux-amd64-0 go/bin/go test -run="TestSomething" -v runtime
5656
```
5757

58-
You can additionally specify a working directory and environment variables to `run` that will be applied before the command is executed.
58+
You can additionally specify a working directory and environment variables via flags to `run` that will be applied before the command is executed.
5959

6060
Note that gomote instances will automatically disappear after 30 minutes of inactivity. Use the `list` command to check how long they have left.
6161

6262
```
6363
$ gomote list
64-
user-linux-amd64-0 linux-amd64 host-linux-amd64-bullseye expires in 10m27.339494527s
64+
user-gotip-linux-amd64-0 gotip-linux-amd64 gotip-linux-amd64 expires in 10m27.339494527s
6565
```
6666

6767
The `ping` command can be used to keep an instance alive if no other commands are being run against it.
6868

6969
For more information on each command run `gomote help <command>`. For more commands, run `gomote help`.
7070

71+
### Builder types
72+
73+
Available builder types follow a certain structure, loosely `$GOBRANCH-($REPO-)?$GOOS-$GOARCH(_$OS)-$EXTRA`.
74+
75+
A few useful notes about these names.
76+
- Different `$GOBRANCH` mainly modify the preinstalled tool versions, like the bootstrap Go toolchain.
77+
- Builder types with `$REPO` will have the specified repository downloaded to the work root at tip-of-tree.
78+
7179
### Debugging buildlets directly
7280

7381
The `create` command contacts the build coordinator (farmer.golang.org) and requests that it create the buildlet on your behalf. All subsequent commands (such as `gomote run` or `gomote ls`) then proxy your request via the coordinator. To access a buildlet directly (for example, when working on the buildlet code), you can skip the `gomote create` step and use the special builder name `<build-config-name>@ip[:port>`, such as `[email protected]`.
@@ -76,7 +84,7 @@ The `create` command contacts the build coordinator (farmer.golang.org) and requ
7684

7785
Instances may be managed in named groups, and commands are broadcast to all instances in the group.
7886

79-
A group is specified either by the -group global flag or through the `GOMOTE_GROUP` environment variable. The -group flag must always specify a valid group, whereas `GOMOTE_GROUP` may contain an invalid group. Instances may be part of more than one group.
87+
A group is specified either by the `-group` global flag or through the `GOMOTE_GROUP` environment variable. The `-group` flag must always specify a valid group, whereas `GOMOTE_GROUP` may contain an invalid group. Instances may be part of more than one group.
8088

8189
Groups may be explicitly managed with the "group" subcommand, but there are several short-cuts that make this unnecessary in most cases:
8290

@@ -88,7 +96,7 @@ As a result, the easiest way to use groups is to just set the `GOMOTE_GROUP` env
8896

8997
```
9098
$ export GOMOTE_GROUP=debug
91-
$ gomote create linux-amd64
99+
$ gomote create gotip-linux-amd64
92100
$ GOROOT=/path/to/goroot gomote push
93101
$ gomote run go/src/make.bash
94102
```
@@ -103,46 +111,46 @@ The `create` command accepts the `-setup` flag which also pushes a `GOROOT` and
103111

104112
Example:
105113
```
106-
$ GOROOT=/path/to/my/goroot gomote create -setup linux-amd64
107-
# Creating user-linux-amd64-0...
108-
# Pushing /path/to/my/goroot to user-linux-amd64-0
109-
# Running make.bash on user-linux-amd64-0...
114+
$ GOROOT=/path/to/my/goroot gomote create -setup gotip-linux-amd64
115+
# Creating user-gotip-linux-amd64-0...
116+
# Pushing /path/to/my/goroot to user-gotip-linux-amd64-0
117+
# Running make.bash on user-gotip-linux-amd64-0...
110118
```
111119

112120
The `create` command accepts the `-count` flag for creating several instances at once.
113121

114122
Example:
115123
```
116-
$ gomote create -count=3 linux-amd64
117-
# Creating user-linux-amd64-0...
118-
# Creating user-linux-amd64-1...
119-
# Creating user-linux-amd64-2...
124+
$ gomote create -count=3 gotip-linux-amd64
125+
# Creating user-gotip-linux-amd64-0...
126+
# Creating user-gotip-linux-amd64-1...
127+
# Creating user-gotip-linux-amd64-2...
120128
```
121129

122130
The `run` command accepts the `-collect` flag for automatically writing the output from the command to a file in the current working directory, as well as a copy of the full file tree from the instance. This command is useful for capturing the output of long-running commands in a set-and-forget manner.
123131

124132
Example:
125133
```
126-
$ gomote run -collect user-linux-amd64-0 /bin/bash -c 'echo hi'
127-
# Writing output to user-linux-amd64-0.stdout...
128-
$ cat user-linux-amd64-0.stdout
134+
$ gomote run -collect user-gotip-linux-amd64-0 /bin/bash -c 'echo hi'
135+
# Writing output to user-gotip-linux-amd64-0.stdout...
136+
$ cat user-gotip-linux-amd64-0.stdout
129137
hi
130-
$ ls user-linux-amd64-0.tar.gz
131-
user-linux-amd64-0.tar.gz
138+
$ ls user-gotip-linux-amd64-0.tar.gz
139+
user-gotip-linux-amd64-0.tar.gz
132140
```
133141

134142
The `run` command accepts the `-until` flag for continuously executing a command until the output of the command matches some pattern. This is useful for reproducing rare issues, and especially useful when used together with `-collect`.
135143

136144
Example:
137145
```
138-
$ gomote run -collect -until 'FAIL' user-linux-amd64-0 go/bin/go test -run 'TestFlaky' -count=1000 runtime
139-
# Writing output to user-linux-amd64-0.stdout...
140-
$ cat user-linux-amd64-0.stdout
146+
$ gomote run -until 'FAIL' -collect user-gotip-linux-amd64-0 go/bin/go test -run 'TestFlaky' -count=1000 runtime
147+
# Writing output to user-gotip-linux-amd64-0.stdout...
148+
$ cat user-gotip-linux-amd64-0.stdout
141149
...
142150
--- FAIL: TestFlaky ---
143151
...
144-
$ ls user-linux-amd64-0.tar.gz
145-
user-linux-amd64-0.tar.gz
152+
$ ls user-gotip-linux-amd64-0.tar.gz
153+
user-gotip-linux-amd64-0.tar.gz
146154
```
147155

148156
Note that the `run` command always streams output to a temporary file regardless of any additional flags to avoid losing output due to terminal scrollback. It always prints the location of the file.
@@ -153,29 +161,14 @@ Putting together some of the tricks above and making use of groups, it's much ea
153161

154162
```
155163
$ export GOMOTE_GROUP=debug
156-
$ GOROOT=/path/to/goroot gomote create -setup -count=10 linux-amd64
164+
$ GOROOT=/path/to/goroot gomote create -setup -count=10 gotip-linux-amd64
157165
$ gomote run -until='unexpected return pc' -collect go/bin/go run -run="TestFlaky" -count=100 runtime
158166
```
159167

160168
### Darwin
161169

162-
Darwin gomotes hosted on LUCI do not have Xcode pre-installed.
163-
Without Xcode, they cannot do cgo builds.
164-
You can build with cgo disabled:
165-
166-
```
167-
$ gomote run -e 'CGO_ENABLED=0' $MOTE go/src/make.bash
168-
```
169-
170-
Or install Xcode like so:
171-
172-
```
173-
$ gomote run $MOTE /bin/mkdir /tmp/xcode
174-
$ gomote run $MOTE /Users/swarming/.swarming/w/ir/tools/bin/mac_toolchain install -xcode-version 15a240d -output-dir /tmp/xcode/Xcode.app
175-
$ gomote run $MOTE /usr/bin/sudo xcode-select --switch /tmp/xcode/Xcode.app
176-
```
177-
178-
Note: Depending on which machine you get, the `mac_toolchain` binary referenced may alternatively be at either `/Volumes/Work/s/w/ir/tools/bin/mac_toolchain`.
170+
Darwin gomotes are known to take a few minutes to set up, even if there are machines available.
171+
This is due to the extra time necessary to set up Xcode.
179172

180173
### Windows
181174

@@ -219,7 +212,7 @@ export MOTE=`gomote create android-arm64-wikofever`
219212
gomote push $MOTE
220213
gomote run $MOTE go/src/make.bash
221214
```
222-
PATH must contain the exec wrapper, go_android_*_exec, built by make.bash.
215+
PATH must contain the exec wrapper, `go_android_*_exec`, built by make.bash.
223216

224217
```
225218
gomote run -path '$PATH,$WORKDIR/go/bin' $MOTE go/bin/go test math/big
@@ -241,7 +234,7 @@ To request access to the gomote service, file a new issue (https://go.dev/issue/
241234
Authentication is triggered with the first invocation of a command:
242235

243236
```
244-
$ gomote create linux-amd64
237+
$ gomote create gotip-linux-amd64
245238
Please visit https://www.google.com/device in your browser and enter verification code:
246239
ABCD-4567
247240
...

0 commit comments

Comments
 (0)