When errgroup is used in the rate limiter, a canceled context is
passed to the next method in the interceptor. A context is canceled
once the Wait() method returns. This change uses the same context
throughout the method instead of creating a new one just for the
errgroup.
For golang/go#40950
Change-Id: I64462394298a6b849187c288e5f76e92630572f9
Reviewed-on: https://go-review.googlesource.com/c/build/+/268697
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
This change adds an optional rate limiter which implements both rate
and resource limits. This change should enable the coordinator to add
additional builders hosted on EC2. This change will reduce the chance
that we encounter one of the limits.
The rate limiter is essential for any calls which mutate cloud
resources. While the EC2 client.DefaultRetryer should be sufficient
enough to handle the non-mutating requests, it would implement a best
practice in having client side rate limiting for those types of requests.
Amazon EC2 throttles requests EC2 API requests
https://docs.aws.amazon.com/AWSEC2/latest/APIReference/throttling.htmlFixesgolang/go#40950
Change-Id: Ib80bcf7c5ab0b0483d5beb11f3581cdb1d0174fe
Reviewed-on: https://go-review.googlesource.com/c/build/+/267901
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
This change adds a quota function to the AWS client. It enables
the caller to call the AWS API in order to retrieve quota (soon
to be called limits) on resource limits for caller. This will be used
to set the resource limits on how many vCPU's will be allowed to
reserved for use in the buildlet pool.
The InstanceTypesArm function has been added which will call the AWS
API and retrieve all instance types which support the arm64
architecture. Adding this allows us to store the instance types which
could possibly be called by the buildlet pool and know how many
vCPU's would be reseved for each instance that has been requested.
Updates golang/go#36841
Change-Id: Ib280a41c72f9859876fe03ee2a0d8d5eaf12cc9b
Reviewed-on: https://go-review.googlesource.com/c/build/+/243198
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This creates an AWS client libary which contains a subset of the
AWS client library. This package provides a fake implementation of
the client library facilitating testing throughout the repository.
Updates golang/go#36841
Change-Id: Id91cd778ee794a6e38a3273c250505a97c6a0b02
Reviewed-on: https://go-review.googlesource.com/c/build/+/236299
Run-TryBot: Carlos Amedee <carlos@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>