зеркало из https://github.com/golang/build.git
cmd/coordinator: find work in dev mode
Start the main findWorkLoop in dev mode, to discover work to run from the dashboard. In dev mode, was also replace the linux-amd64 builder config with one using host-linux-amd64-localdev reverse buildlets. This provides a complete lifecycle to test out builds with a local dev coordinator and buildlet. For golang/go#48803 Change-Id: I8ade6c8bccf3bc51437ca9e7d11c232753fe7465 Reviewed-on: https://go-review.googlesource.com/c/build/+/354638 Trust: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
This commit is contained in:
Родитель
d59bfcb8a8
Коммит
3025285794
|
@ -7,7 +7,7 @@ Building, running tests, running locally is supported on Linux and macOS only.
|
|||
Run
|
||||
|
||||
```sh
|
||||
go run golang.org/x/build/cmd/coordinator -mode=dev -env=dev
|
||||
go run golang.org/x/build/cmd/coordinator -mode=dev
|
||||
```
|
||||
|
||||
to start a server on https://localhost:8119. Proceed past the TLS warning and
|
||||
|
@ -15,6 +15,13 @@ you should get the homepage. Some features won't work when running locally,
|
|||
but you should be able to navigate between the homepage, the dashboard,
|
||||
the builders page, and do limited local development and testing.
|
||||
|
||||
To test builds locally, start a `host-linux-amd64-localdev` reverse buildlet,
|
||||
which will run `linux-amd64` tests:
|
||||
|
||||
```sh
|
||||
go run golang.org/x/build/cmd/buildlet -halt=false -reverse-type=host-linux-amd64-localdev
|
||||
```
|
||||
|
||||
#### Render the "Trybot Status" page locally
|
||||
|
||||
To view/modify the "Trybot Status" page locally, you can run the coordinator
|
||||
|
|
|
@ -398,6 +398,16 @@ func main() {
|
|||
defer ec2Pool.Close()
|
||||
}
|
||||
|
||||
if *mode == "dev" {
|
||||
// Replace linux-amd64 with a config using a -localdev reverse
|
||||
// buildlet so it is possible to run local builds by starting a
|
||||
// local reverse buildlet.
|
||||
dashboard.Builders["linux-amd64"] = &dashboard.BuildConfig{
|
||||
Name: "linux-amd64",
|
||||
HostType: "host-linux-amd64-localdev",
|
||||
}
|
||||
}
|
||||
|
||||
go updateInstanceRecord()
|
||||
|
||||
switch *mode {
|
||||
|
@ -466,6 +476,7 @@ func main() {
|
|||
if *mode == "dev" {
|
||||
// TODO(crawshaw): do more in dev mode
|
||||
gce.BuildletPool().SetEnabled(*devEnableGCE)
|
||||
go findWorkLoop()
|
||||
} else {
|
||||
go gce.BuildletPool().CleanUpOldVMs()
|
||||
if pool.KubeErr() == nil {
|
||||
|
|
Загрузка…
Ссылка в новой задаче