зеркало из https://github.com/golang/build.git
56 строки
1.7 KiB
Plaintext
56 строки
1.7 KiB
Plaintext
A remote buildlet is a buildlet created or assigned by the
|
|
coordinator, on request of a client (such as cmd/gomote or
|
|
cmd/relui). The client must occasionally refresh the buildlet to
|
|
keep it alive, and the coordinator proxies all requests to it.
|
|
Currently, if the coordinator dies or restarts, all buildlets are lost.
|
|
|
|
The permission to do this is controlled by a special type of build key
|
|
starting with "user-" instead of a GOOS. The form will be of
|
|
"user-USERNAME". The user-$username and key
|
|
(via https://build.golang.org/key?builder=user-WHO) are sent via
|
|
HTTP Basic authentication.
|
|
|
|
Flow:
|
|
|
|
*) Client (e.g. pkg buildlet, via cmd/gomote or cmd/relui) makes a
|
|
POST request over key-pinned TLS to the well-known TLS cert of
|
|
farmer.golang.org
|
|
|
|
POST https://farmer.golang.org/buildlet/create HTTP/1.1
|
|
Authentication: Basic user-$username userkey
|
|
Content-Type: www/form-url-encoded
|
|
|
|
type=darwin-amd64
|
|
|
|
HTTP/1.1 200 OK
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"Name": "user-adg-darwin-amd64-0",
|
|
"Type": "darwin-amd64",
|
|
"Created": "..",
|
|
"Expires": "..",
|
|
}
|
|
|
|
*) Client may list open buildlets like:
|
|
|
|
GET https://farmer.golang.org/buildlet/list HTTP/1.1
|
|
Authentication: Basic user-$username userkey
|
|
|
|
HTTP/1.1 200 OK
|
|
Content-Type: application/json
|
|
|
|
[ {"Name": ...}, {"Name": ...}]
|
|
|
|
*) Client makes requests like:
|
|
|
|
(buildlet method) https://farmer.golang.org/(normal buildlet paths) HTTP/1.1
|
|
X-Buildlet-Proxy: adg-darwin-amd64-1
|
|
Authentication: Basic buildlet-$username $buildkey
|
|
|
|
If buildlet is missing, 502 Bad Gateway.
|
|
If auth is bad, 401.
|
|
|
|
*) Client may release it by doing the normal buildlet.Client.Destroy call
|
|
to its /halt method.
|