Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/build/cmd/coordinator: hard to run locally/outside of GCE #19828

Closed
kevinburke opened this issue Apr 3, 2017 · 3 comments
Closed

x/build/cmd/coordinator: hard to run locally/outside of GCE #19828

kevinburke opened this issue Apr 3, 2017 · 3 comments
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge
Milestone

Comments

@kevinburke
Copy link
Contributor

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.

@gopherbot gopherbot added this to the Unreleased milestone Apr 3, 2017
@gopherbot gopherbot added the Builders x/build issues (builders, bots, dashboards) label Apr 3, 2017
@bradfitz
Copy link
Contributor

bradfitz commented Apr 3, 2017

It's worked locally at various times, but it generally rots, as you've found. Generally we use the staging server for development & testing, since it's not easy to test something that integrates with a dozen misc APIs (all themselves changing often). Any fakes or mocks are just lies if your dependent APIs keep changing underfoot.

But changes to make it work again would be welcome.

@gopherbot
Copy link

CL https://golang.org/cl/39297 mentions this issue.

@kevinburke
Copy link
Contributor Author

Ah, this is a dupe of #18291. Closing.

gopherbot pushed a commit to golang/build that referenced this issue Apr 3, 2017
Previously the server would fail to start if a valid token could not
be found. The local development environment still doesn't do much, but
it should let you view and edit the HTML and confirm that the server
starts, so ignore the error if we are running in dev mode.

Add a short README explaining how to start and view the coordinator
server locally.

Fixes golang/go#19828.
Fixes golang/go#18291.

Change-Id: I91a3ce49e1e9ea18ca19f3867edb2c71fc1b5124
Reviewed-on: https://go-review.googlesource.com/39297
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@golang golang locked and limited conversation to collaborators Apr 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

3 participants