File tree 4 files changed +53
-3
lines changed
4 files changed +53
-3
lines changed Original file line number Diff line number Diff line change
1
+ name : Main
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+
7
+ jobs :
8
+ dev :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - name : Checkout code
12
+ uses : actions/checkout@v3
13
+ with :
14
+ fetch-depth : 0
15
+ - name : Set up Go
16
+ uses : actions/setup-go@v4
17
+ with :
18
+ go-version : " 1.20"
19
+ - name : Login to DockerHub
20
+ uses : docker/login-action@v1
21
+ with :
22
+ registry : docker.io
23
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
24
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
25
+ - name : Publish dev image
26
+ id : docker_dev_build
27
+ uses : docker/build-push-action@v2
28
+ with :
29
+ push : true
30
+ file : " ./Dockerfile.dev"
31
+ tags : raystack/compass:dev
Original file line number Diff line number Diff line change
1
+ FROM golang:1.20-alpine3.17 as builder
2
+ RUN apk add make
3
+ WORKDIR /build/
4
+ COPY . .
5
+ RUN make build
6
+
7
+ FROM alpine:3.17
8
+
9
+ COPY --from=builder /build/compass /usr/bin/compass
10
+ RUN apk update
11
+ RUN apk add ca-certificates
12
+
13
+ # glibc compatibility library, since go binaries
14
+ # don't work well with musl libc that alpine uses
15
+ RUN apk add libc6-compat
16
+
17
+ ENTRYPOINT ["compass"]
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ coverage: test ## Print the code coverage
41
41
42
42
build : # # Build the compass binary
43
43
@echo " Building guardian version ${VERSION} ..."
44
- go build -ldflags " -X ${NAME} /cli.Version=${VERSION} "
44
+ CGO_ENABLED=0 go build -ldflags " -X ${NAME} /cli.Version=${VERSION} "
45
45
@echo " Build complete"
46
46
47
47
buildr : setup
Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ func Serve(
90
90
91
91
// init grpc
92
92
grpcServer := grpc .NewServer (
93
+ grpc .MaxRecvMsgSize (config .GRPC .MaxRecvMsgSize ),
94
+ grpc .MaxSendMsgSize (config .GRPC .MaxSendMsgSize ),
93
95
grpc .UnaryInterceptor (grpc_middleware .ChainUnaryServer (
94
96
grpc_recovery .UnaryServerInterceptor (),
95
97
grpc_ctxtags .UnaryServerInterceptor (),
@@ -160,8 +162,8 @@ func Serve(
160
162
ctx ,
161
163
mux .WithHTTPTarget (config .addr (), & http.Server {
162
164
Handler : gwmux ,
163
- ReadTimeout : 5 * time .Second ,
164
- WriteTimeout : 10 * time .Second ,
165
+ ReadTimeout : 60 * time .Second ,
166
+ WriteTimeout : 60 * time .Second ,
165
167
IdleTimeout : 120 * time .Second ,
166
168
}),
167
169
mux .WithGRPCTarget (config .grpcAddr (), grpcServer ),
You can’t perform that action at this time.
0 commit comments