-
Notifications
You must be signed in to change notification settings - Fork 20
Feat/upscale buildkit if waiting too long #47
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
Feat/upscale buildkit if waiting too long #47
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds a feature to automatically upscale BuildKit when builds are waiting too long for available resources. The implementation includes a new metrics system, refactored pod discovery and leasing logic, and enhanced scaling capabilities.
Key changes:
- Introduced Prometheus metrics to track build waiting times, active builds, and build durations
- Refactored pod discovery logic by splitting it into separate components: podNotifier for watching pods and leaser for managing lease acquisition
- Added metrics server endpoint on port 9090 to expose build-related metrics
- Updated protobuf generated code to newer versions (protoc-gen-go v1.36.6, protoc-gen-go-grpc v1.5.1)
- Changed UnimplementedBuildServer embedding from pointer to value to prevent nil pointer dereferences
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/build/server.go | Changed UnimplementedBuildServer from pointer to value embedding per new protobuf guidelines |
| pkg/build/grpc_build_v1/build_service_grpc.pb.go | Regenerated gRPC service code with v1.5.1, includes new generic stream types and lease validation |
| pkg/build/grpc_build_v1/build_service.pb.go | Regenerated protobuf message code with v1.36.6, includes memory optimizations |
| pkg/build/buildkit/scaler/downscaler_test.go | Updated test calls from RunDownscaler to runDownscaler (function made private) |
| pkg/build/buildkit/scaler/downscaler.go | Made runDownscaler private and removed unnecessary blank lines |
| pkg/build/buildkit/metrics/metrics.go | New file defining Prometheus metrics for tracking builds |
| pkg/build/buildkit/build.go | Integrated metrics tracking for build operations and namespace detection |
| pkg/build/buildkit/autodiscovery/podNotifier.go | New component to watch and filter pod events before lease acquisition |
| pkg/build/buildkit/autodiscovery/leaser.go | New component to manage distributed leases across BuildKit pods |
| pkg/build/buildkit/autodiscovery/k8s_test.go | Expanded tests for namespace discovery, pod readiness, and upscaling logic |
| pkg/build/buildkit/autodiscovery/k8s.go | Refactored discovery to use new notifier/leaser pattern with metrics support |
| main.go | Added metrics server startup on configurable port (default 9090) |
| go.sum | Updated checksums for new and upgraded dependencies |
| go.mod | Added prometheus client library and updated protobuf, sync, and other dependencies |
| Makefile | Added protoc plugin installation commands to setup target |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravilock Nice MR, let's do a progressive rollout, please bump the minor and let's find a possible bug in the whole deploy process
No description provided.