Skip to content

Commit

Permalink
share one grpc-health-probe (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
hougangliu authored and k8s-ci-robot committed Apr 29, 2019
1 parent 6f5c5c7 commit 2b55c69
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 617 deletions.
2 changes: 1 addition & 1 deletion cmd/manager/v1alpha1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

api_pb "github.com/kubeflow/katib/pkg/api/v1alpha1"
health_pb "github.com/kubeflow/katib/pkg/api/v1alpha1/health"
health_pb "github.com/kubeflow/katib/pkg/api/health"
kdb "github.com/kubeflow/katib/pkg/db/v1alpha1"
"github.com/kubeflow/katib/pkg/manager/modelstore"

Expand Down
2 changes: 1 addition & 1 deletion cmd/manager/v1alpha2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net"

api_pb "github.com/kubeflow/katib/pkg/api/v1alpha2"
health_pb "github.com/kubeflow/katib/pkg/api/v1alpha2/health"
health_pb "github.com/kubeflow/katib/pkg/api/health"
kdb "github.com/kubeflow/katib/pkg/db/v1alpha2"

"google.golang.org/grpc"
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/health/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
health.pb.go: health/health.proto
protoc -I. health/health.proto --go_out=plugins=grpc:.
7 changes: 7 additions & 0 deletions pkg/api/health/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set -x
set -e
proto="health.proto"
docker run -it --rm -v $PWD:$(pwd) -w $(pwd) znly/protoc --python_out=plugins=grpc:./python --go_out=plugins=grpc:. -I. $proto
docker run -it --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
docker run -it --rm -v $PWD:$(pwd) -w $(pwd) znly/protoc --grpc-gateway_out=logtostderr=true:. -I. $proto
docker run -it --rm -v $PWD:$(pwd) -w $(pwd) znly/protoc --swagger_out=logtostderr=true:. -I. $proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"swagger": "2.0",
"info": {
"title": "health/health.proto",
"title": "health.proto",
"version": "version not set"
},
"schemes": [
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from health import health_pb2 as health_dot_health__pb2
import health_pb2 as health__pb2


class HealthStub(object):
Expand All @@ -16,8 +16,8 @@ def __init__(self, channel):
"""
self.Check = channel.unary_unary(
'/grpc.health.v1.Health/Check',
request_serializer=health_dot_health__pb2.HealthCheckRequest.SerializeToString,
response_deserializer=health_dot_health__pb2.HealthCheckResponse.FromString,
request_serializer=health__pb2.HealthCheckRequest.SerializeToString,
response_deserializer=health__pb2.HealthCheckResponse.FromString,
)


Expand All @@ -37,8 +37,8 @@ def add_HealthServicer_to_server(servicer, server):
rpc_method_handlers = {
'Check': grpc.unary_unary_rpc_method_handler(
servicer.Check,
request_deserializer=health_dot_health__pb2.HealthCheckRequest.FromString,
response_serializer=health_dot_health__pb2.HealthCheckResponse.SerializeToString,
request_deserializer=health__pb2.HealthCheckRequest.FromString,
response_serializer=health__pb2.HealthCheckResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
Expand Down
2 changes: 0 additions & 2 deletions pkg/api/v1alpha1/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
api.pb.go: api.proto
protoc -I. api.proto --go_out=plugins=grpc:.
health.pb.go: health/health.proto
protoc -I. health/health.proto --go_out=plugins=grpc:.
2 changes: 1 addition & 1 deletion pkg/api/v1alpha1/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -x
set -e
for proto in api.proto health/health.proto; do
for proto in api.proto; do
docker run -it --rm -v $PWD:$(pwd) -w $(pwd) znly/protoc --python_out=plugins=grpc:./python --go_out=plugins=grpc:. -I. $proto
docker run -it --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
docker run -it --rm -v $PWD:$(pwd) -w $(pwd) znly/protoc --grpc-gateway_out=logtostderr=true:. -I. $proto
Expand Down
2 changes: 0 additions & 2 deletions pkg/api/v1alpha2/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
api.pb.go: api.proto
protoc -I. api.proto --go_out=plugins=grpc:.
health.pb.go: health/health.proto
protoc -I. health/health.proto --go_out=plugins=grpc:.
2 changes: 1 addition & 1 deletion pkg/api/v1alpha2/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -x
set -e
for proto in api.proto health/health.proto; do
for proto in api.proto; do
docker run -it --rm -v $PWD:$(pwd) -w $(pwd) znly/protoc --python_out=plugins=grpc:./python --go_out=plugins=grpc:. -I. $proto
docker run -it --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
docker run -it --rm -v $PWD:$(pwd) -w $(pwd) znly/protoc --grpc-gateway_out=logtostderr=true:. -I. $proto
Expand Down
Loading

0 comments on commit 2b55c69

Please sign in to comment.