-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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/playground: easily runs into build timeouts by downloading modules #56977
Comments
Worth noting that, since |
We discussed this in the tools call yesterday, and I feel like I may have prematurely determined that this problem is not easily solvable. If timeouts are during the build, not the download, we should consider increasing the size of the playground app engine instances: Right now, they appear to be at the minimum number of CPU: It may be worth just 2x'ing or 4x'ing the instance shape to see if it improves anything. CC @golang/release |
Two CPUs and two gigabytes of memory don't sound like enough to build some non-trivial examples with dependencies in a reasonable amount of time :) I would agree with that. Though I would also like to see better caching and longer build timeouts. |
Change https://go.dev/cl/461795 mentions this issue: |
Experiment whether increasing instance shape can help mitigate build timeouts. For golang/go#56977 Change-Id: Ib516b97b9729151542331f8bae8ad5725914d2f2 Reviewed-on: https://go-review.googlesource.com/c/playground/+/461795 Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
For what it's worth, the higher resources don't seem to get us out of the timeouts. Relatively light examples like https://go.dev/play/p/qPDCgnJgO39 still trigger a timeout. Some dependencies like x/text and x/tools still weigh megabytes, but surely that shouldn't be out of the norm :) |
The Go playground is an important tool for the Go community as it allows to easily publish reproducers for issues in the Go project, but also beyond on Go modules that are publicly available. We were relying on this capability for the maintenance of the Testify testing framework, as it is easier to reproduce old issues if a reproducer is directly available on go.dev/play: Testify has a long queue of old issues and easy access to a reproducer in an uptodate environment is key for maintainers' limited time. However nowadays playground code that uses Testify always fails with a "timeout running go build". Example: https://go.dev/play/p/GWnpcyJSw5T |
For example, see https://go.dev/play/p/b4S-VWK-yWR, which needs to download https://pkg.go.dev/cuelang.org/go@v0.5.0-beta.1 and its dependencies. It currently times out at build time, presumably while still downloading the module zips:
It appears that the timeout happens after about ten seconds.
I wrote a small program a while ago to estimate how big all the zips in
go list -m all
are. The results, starting with the largest in bytes, are as follows:So a clean
go build
does download a fair bit - at least 15MiB or so. The total number of modules is 32, pergo list -m all | wc -l
. I think the playground should be able to download these modules by doing any of:Talking to a fast
GOPROXY
.GOMODCACHE=$PWD/tmp time go build
reports a total runtime of about 3s on my laptop, with a 500Mb ethernet connection and a 11ms ping to proxy.golang.org. I'm sure that a playground server could do better.Reusing a
GOMODCACHE
on a best-effort basis. The same could be said aboutGOCACHE
for build caching for compile timeouts.Increasing the timeout for multi-file playground inputs with
go.mod
andgo.sum
files. For example, given the number of lines in either go.mod or go.sum, we could estimate that this example needs a 20s timeout rather than 10s. Presumably this shouldn't be too harmful, as the playground should cache the result once it runs without a timeout.Implementing a more sophisticated timeout. For example, the playground could have very generous timeouts for downloading modules, given that network traffic is presumably cheap. The timeout for compiling and linking could similarly be more generous than the timeout for running the program, as there's no chance for running arbitrary code to burn CPU or abusing free compute.
cc @toothrot per https://dev.golang.org/owners
The text was updated successfully, but these errors were encountered: