Skip to content

Commit

Permalink
Merge pull request #238 from bitcoin-sv/feature/mtm-health
Browse files Browse the repository at this point in the history
Feature/mtm health
  • Loading branch information
boecklim authored Jan 9, 2024
2 parents c6a8ab2 + fdd0f26 commit 7b3c411
Show file tree
Hide file tree
Showing 7 changed files with 528 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
FROM ubuntu:latest

RUN apt-get update && apt-get install ca-certificates -y && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install ca-certificates wget -y && apt-get clean && rm -rf /var/lib/apt/lists/*

COPY ./build/arc_linux_amd64 /service/arc

WORKDIR /service

# Add grpc_health_probe
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.24 && \
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /bin/grpc_health_probe

RUN chmod +x arc

EXPOSE 9090

CMD ["/service/arc"]
CMD ["/service/arc"]
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ gen:
--go-grpc_opt=paths=source_relative \
metamorph/metamorph_api/metamorph_api.proto

protoc \
--proto_path=. \
--go_out=. \
--go_opt=paths=source_relative \
--go-grpc_out=. \
--go-grpc_opt=paths=source_relative \
metamorph/health/grpc_health_check.proto

protoc \
--proto_path=. \
--go_out=. \
Expand Down
287 changes: 287 additions & 0 deletions metamorph/health/grpc_health_check.pb.go

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

25 changes: 25 additions & 0 deletions metamorph/health/grpc_health_check.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
syntax = "proto3";

option go_package = ".;healthcheck";

package grpc.health.v1;

message HealthCheckRequest {
string service = 1;
}

message HealthCheckResponse {
enum ServingStatus {
UNKNOWN = 0;
SERVING = 1;
NOT_SERVING = 2;
SERVICE_UNKNOWN = 3; // Used only by the Watch method.
}
ServingStatus status = 1;
}

service Health {
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);

rpc Watch(HealthCheckRequest) returns (stream HealthCheckResponse);
}
Loading

0 comments on commit 7b3c411

Please sign in to comment.