Skip to content

Commit cdd5968

Browse files
ravilockCopilot
andauthored
Feat/upscale buildkit if waiting too long (#47)
* feat: upscale directly if wait time for buildkit is long enough * ref: lint and fix * feat: add metrics to upscale buildkit * refactor: lint * Update pkg/build/grpc_build_v1/build_service_grpc.pb.go Co-authored-by: Copilot <[email protected]> * fix: bugs, typos and refactors * Update pkg/build/buildkit/autodiscovery/podNotifier.go Co-authored-by: Copilot <[email protected]> * fix: race on lease release and typos * ref: add timeout time on error message for buildkit discover * fix: handle leasedPodsCh closure by finishing the process * fix: handle pod watcher chan closure * ref: fix identation * fix: exit when metrics server fails * test: fix error message --------- Co-authored-by: Copilot <[email protected]>
1 parent 38cdaaa commit cdd5968

File tree

15 files changed

+1088
-602
lines changed

15 files changed

+1088
-602
lines changed

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ LOCAL_DEV ?= ./misc/local-dev.sh
1414
setup:
1515
@$(LOCAL_DEV) setup-loopback $(TSURU_HOST_IP)
1616
@$(DOCKER_COMPOSE) up -d
17+
@$(GO) install google.golang.org/protobuf/cmd/[email protected]
18+
@$(GO) install google.golang.org/grpc/cmd/[email protected]
1719

1820
.PHONY: cleanup
1921
cleanup:
@@ -30,11 +32,11 @@ test: generate
3032
.PHONY: test/integration
3133
test/integration:
3234
DEPLOY_AGENT_INTEGRATION=true \
33-
DEPLOY_AGENT_INTEGRATION_REGISTRY_HOST=$(INTERNAL_IP):5000 \
34-
DEPLOY_AGENT_INTEGRATION_REGISTRY_HTTP=true \
35-
BUILDKIT_HOST=tcp://0.0.0.0:7777 \
36-
DOCKER_HOST=tcp://0.0.0.0:2375 \
37-
$(GO) test -v github.com/tsuru/deploy-agent/pkg/build/buildkit
35+
DEPLOY_AGENT_INTEGRATION_REGISTRY_HOST=$(INTERNAL_IP):5000 \
36+
DEPLOY_AGENT_INTEGRATION_REGISTRY_HTTP=true \
37+
BUILDKIT_HOST=tcp://0.0.0.0:7777 \
38+
DOCKER_HOST=tcp://0.0.0.0:2375 \
39+
$(GO) test -v github.com/tsuru/deploy-agent/pkg/build/buildkit
3840

3941
.PHONY: lint
4042
lint: generate
@@ -48,4 +50,4 @@ generate:
4850

4951
.PHONY: build/container-image
5052
build/container-image:
51-
$(DOCKER) build -t tsuru/deploy-agent:latest ./
53+
$(DOCKER) build -t tsuru/deploy-agent-local:latest ./

go.mod

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ require (
1212
github.com/google/go-containerregistry v0.12.0
1313
github.com/moby/buildkit v0.11.3
1414
github.com/oracle/oci-go-sdk/v65 v65.73.0
15+
github.com/prometheus/client_golang v1.23.2
1516
github.com/stretchr/testify v1.11.1
16-
golang.org/x/sync v0.12.0
17+
golang.org/x/sync v0.16.0
1718
google.golang.org/grpc v1.65.0
18-
google.golang.org/protobuf v1.34.1
19+
google.golang.org/protobuf v1.36.8
1920
k8s.io/api v0.26.2
2021
k8s.io/apimachinery v0.26.2
2122
k8s.io/client-go v0.26.2
@@ -28,6 +29,8 @@ require (
2829
cloud.google.com/go/compute/metadata v0.3.0 // indirect
2930
github.com/Microsoft/go-winio v0.6.0 // indirect
3031
github.com/Microsoft/hcsshim v0.9.12 // indirect
32+
github.com/beorn7/perks v1.0.1 // indirect
33+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
3134
github.com/containerd/containerd v1.6.38 // indirect
3235
github.com/containerd/continuity v0.3.0 // indirect
3336
github.com/containerd/errdefs v0.1.0 // indirect
@@ -50,16 +53,14 @@ require (
5053
github.com/gogo/protobuf v1.3.2 // indirect
5154
github.com/golang/protobuf v1.5.4 // indirect
5255
github.com/google/gnostic v0.6.9 // indirect
53-
github.com/google/go-cmp v0.6.0 // indirect
56+
github.com/google/go-cmp v0.7.0 // indirect
5457
github.com/google/gofuzz v1.2.0 // indirect
5558
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
5659
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
5760
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
5861
github.com/imdario/mergo v0.3.13 // indirect
5962
github.com/josharian/intern v1.0.0 // indirect
6063
github.com/json-iterator/go v1.1.12 // indirect
61-
github.com/klauspost/compress v1.16.0 // indirect
62-
github.com/kr/pretty v0.3.0 // indirect
6364
github.com/mailru/easyjson v0.7.7 // indirect
6465
github.com/mitchellh/go-homedir v1.1.0 // indirect
6566
github.com/moby/patternmatcher v0.5.0 // indirect
@@ -74,6 +75,9 @@ require (
7475
github.com/opencontainers/selinux v1.11.0 // indirect
7576
github.com/pkg/errors v0.9.1 // indirect
7677
github.com/pmezard/go-difflib v1.0.0 // indirect
78+
github.com/prometheus/client_model v0.6.2 // indirect
79+
github.com/prometheus/common v0.66.1 // indirect
80+
github.com/prometheus/procfs v0.16.1 // indirect
7781
github.com/sirupsen/logrus v1.9.3 // indirect
7882
github.com/sony/gobreaker v0.5.0 // indirect
7983
github.com/spf13/pflag v1.0.5 // indirect
@@ -87,15 +91,16 @@ require (
8791
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
8892
go.opentelemetry.io/otel/trace v1.21.0 // indirect
8993
go.opentelemetry.io/proto/otlp v0.12.0 // indirect
90-
golang.org/x/crypto v0.36.0 // indirect
91-
golang.org/x/mod v0.17.0 // indirect
92-
golang.org/x/net v0.38.0 // indirect
93-
golang.org/x/oauth2 v0.27.0 // indirect
94-
golang.org/x/sys v0.31.0 // indirect
95-
golang.org/x/term v0.30.0 // indirect
96-
golang.org/x/text v0.23.0 // indirect
94+
go.yaml.in/yaml/v2 v2.4.2 // indirect
95+
golang.org/x/crypto v0.41.0 // indirect
96+
golang.org/x/mod v0.26.0 // indirect
97+
golang.org/x/net v0.43.0 // indirect
98+
golang.org/x/oauth2 v0.30.0 // indirect
99+
golang.org/x/sys v0.35.0 // indirect
100+
golang.org/x/term v0.34.0 // indirect
101+
golang.org/x/text v0.28.0 // indirect
97102
golang.org/x/time v0.3.0 // indirect
98-
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
103+
golang.org/x/tools v0.35.0 // indirect
99104
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
100105
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
101106
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect

0 commit comments

Comments
 (0)