This repository has been archived by the owner on Apr 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from mailgun/PIP-1490-hashring
Improve concurrent request processing
- Loading branch information
Showing
67 changed files
with
3,497 additions
and
573 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
gubernator | ||
gubernator-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ gubernator.egg-info/ | |
.DS_Store | ||
*.iml | ||
googleapis/ | ||
coverage.out | ||
coverage.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
|
||
# These owners will be the default owners for everything in the repo. | ||
* @thrawn01 | ||
* @Baliedge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Build image | ||
FROM golang:1.17 as build | ||
|
||
WORKDIR /go/src | ||
|
||
# This should create cached layer of our dependencies for subsequent builds to use | ||
COPY go.mod /go/src | ||
COPY go.sum /go/src | ||
RUN go mod download | ||
|
||
# Copy the local package files to the container | ||
ADD . /go/src | ||
|
||
ARG VERSION | ||
|
||
# Build the server inside the container | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo \ | ||
-ldflags "-w -s -X main.Version=$VERSION" -o /gubernator-cli /go/src/cmd/gubernator-cli/main.go | ||
|
||
# Create our deploy image | ||
FROM scratch | ||
|
||
# Certs for ssl | ||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
|
||
# Copy our static executable. | ||
COPY --from=build /gubernator-cli /gubernator-cli | ||
|
||
# Run the server | ||
ENTRYPOINT ["/gubernator-cli"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
.PHONY: release docker proto certs | ||
.DEFAULT_GOAL := release | ||
|
||
VERSION=$(shell cat version) | ||
|
||
LDFLAGS="-X main.Version=$(VERSION)" | ||
|
||
.PHONY: test | ||
test: | ||
go test ./... -v -race -p=1 -count=1 | ||
(go test -v -race -p=1 -count=1 -coverprofile coverage.out ./...; ret=$$?; \ | ||
go tool cover -func coverage.out; \ | ||
go tool cover -html coverage.out -o coverage.html; \ | ||
exit $$ret) | ||
|
||
.PHONY: docker | ||
docker: | ||
docker build --build-arg VERSION=$(VERSION) -t ghcr.io/mailgun/gubernator:$(VERSION) . | ||
docker tag ghcr.io/mailgun/gubernator:$(VERSION) ghcr.io/mailgun/gubernator:latest | ||
|
||
.PHONY: release | ||
release: | ||
GOOS=darwin GOARCH=amd64 go build -ldflags $(LDFLAGS) -o gubernator.darwin ./cmd/gubernator/main.go | ||
GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -o gubernator.linux ./cmd/gubernator/main.go | ||
go build -v -ldflags $(LDFLAGS) -o gubernator ./cmd/gubernator/main.go | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f gubernator gubernator-cli | ||
|
||
.PHONY: proto | ||
proto: | ||
scripts/proto.sh | ||
|
||
.PHONY: certs | ||
certs: | ||
rm certs/*.key certs/*.srl certs/*.csr certs/*.pem | ||
openssl genrsa -out certs/ca.key 4096 | ||
|
@@ -32,4 +40,3 @@ certs: | |
openssl req -sha1 -key certs/client-auth.key -new -out certs/client-auth.req -subj "/C=US/ST=TX/O=Mailgun Technologies, Inc./CN=client.com/[email protected]" | ||
openssl x509 -req -days 3650 -in certs/client-auth.req -CA certs/client-auth-ca.pem -CAkey certs/client-auth-ca.key -passin pass:test -out certs/client-auth.pem | ||
openssl x509 -extfile certs/client-auth.conf -extensions ssl_client -req -days 3650 -in certs/client-auth.req -CA certs/client-auth-ca.pem -CAkey certs/client-auth-ca.key -passin pass:test -out certs/client-auth.pem | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.