Closed
Description
I'd like to tweak some of the HTML on farmer.golang.org to make it more consistent with the other Go sites. It's hard to stand up the coordinator server locally.
This snippet of code suggests that it should be possible, or was at one point:
func listenAndServeTLS() {
addr := ":443"
if *mode == "dev" {
addr = "localhost:8119"
}
ln, err := net.Listen("tcp", addr)
if err != nil {
log.Fatalf("net.Listen(%s): %v", addr, err)
}
serveTLS(ln)
}
However running go install golang.org/x/build/cmd/coordinator && coordinator --mode=dev --dev_gce=false
on my Macbook yields the following log:
2017/04/03 09:42:31 coordinator version "" starting
2017/04/03 09:42:31 Loaded configuration "dev" for project "":
{
"ProjectName": "",
"IsProd": false,
"Zone": "",
"ZonesToClean": null,
"StaticIP": "127.0.0.1",
"MachineType": "",
"KubeMinNodes": 0,
"KubeMaxNodes": 0,
"KubeMachineType": "",
"KubeName": "",
"KubePassword": "",
"DashURL": "",
"CoordinatorURL": "",
"CoordinatorName": "",
"BuildletBucket": "",
"LogBucket": "",
"SnapBucket": "",
"MaxBuilds": 0,
"AutoCertCacheBucket": ""
}
2017/04/03 09:42:31 Error creating datastore client: datastore: missing project/dataset id
2017/04/03 09:42:31 failed to get a token source: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
exit status 1
Which suggests we now have a hard dependency on GCE, on this line:
tokenSource, err = google.DefaultTokenSource(ctx, compute.CloudPlatformScope)
if err != nil {
log.Fatalf("failed to get a token source: %v", err)
}
It would be good to either document what GCE settings you need to run the application locally, remove the hard dependency on GCE, or document that the coordinator can't be run outside of GCE.