Skip to content

Commit

Permalink
Replace znly wit buf
Browse files Browse the repository at this point in the history
  • Loading branch information
shivas1516 committed Mar 28, 2024
1 parent 250e9d1 commit 499e654
Show file tree
Hide file tree
Showing 23 changed files with 4,451 additions and 4,735 deletions.
2 changes: 2 additions & 0 deletions cmd/db-manager/v1beta1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const (
var dbIf common.KatibDBInterface

type server struct {
health_pb.HealthServer
api_pb.DBManagerServer
}

// Report a log of Observations for a Trial.
Expand Down
4 changes: 3 additions & 1 deletion cmd/suggestion/goptuna/v1beta1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
)

type healthService struct {
health_pb.HealthServer
}

func (s *healthService) Check(ctx context.Context, in *health_pb.HealthCheckRequest) (*health_pb.HealthCheckResponse, error) {
Expand All @@ -46,7 +47,8 @@ func main() {
klog.Fatalf("Failed to listen: %v", err)
}
srv := grpc.NewServer()
api_v1_beta1.RegisterSuggestionServer(srv, suggestion.NewSuggestionService())
api_v1_beta1.RegisterSuggestionServer(srv, &suggestion.SuggestionService{}) // Updated code

health_pb.RegisterHealthServer(srv, &healthService{})

klog.Infof("Start Goptuna suggestion service: %s", address)
Expand Down
10 changes: 10 additions & 0 deletions pkg/apis/manager/health/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: v1
plugins:
- plugin: buf.build/protocolbuffers/python:v26.0
out: python
- plugin: buf.build/grpc/python:v1.62.1
out: python
- plugin: buf.build/protocolbuffers/go:v1.33.0
out: ./
- plugin: buf.build/grpc/go
out: ./
7 changes: 7 additions & 0 deletions pkg/apis/manager/health/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: v1
breaking:
use:
- FILE
lint:
use:
- DEFAULT
3 changes: 1 addition & 2 deletions pkg/apis/manager/health/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ set -e
cd "$(dirname "$0")"

proto="health.proto"
docker run -i --rm -v "$PWD:$PWD" -w "$PWD" znly/protoc --python_out=plugins=grpc:./python --go_out=plugins=grpc:. -I. $proto
docker run -i --rm -v "$PWD:$PWD" -w "$PWD" znly/protoc --plugin=protoc-gen-grpc=/usr/bin/grpc_python_plugin --python_out=./python --grpc_out=./python -I. $proto
buf generate --template=buf.gen.yaml $proto
Loading

0 comments on commit 499e654

Please sign in to comment.