-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update repo to more modern tooling (#19)
- Remove `bin/dep` and other unused scripts - Update how Go protobuf bindings are generated - Switch Deployments in example configs to `apps/v1` - Update Dockerfile to build with go modules - Fix failing http-egress test - Fix malformed GET requests in http-egress - Add http-egress example config for testing - Update README.md Signed-off-by: Kevin Ingelman <ki@buoyant.io>
- Loading branch information
Showing
21 changed files
with
514 additions
and
321 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
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,2 +1,2 @@ | ||
.dep | ||
vendor | ||
vendor | ||
target |
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,5 +1,2 @@ | ||
vendor | ||
target | ||
.idea | ||
.protoc | ||
.dep* |
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,13 +1,22 @@ | ||
FROM golang:1.11.6-stretch as golang | ||
WORKDIR /go/src/github.com/buoyantio/bb | ||
ADD . /go/src/github.com/buoyantio/bb | ||
# cache go modules in a separate image | ||
FROM --platform=$BUILDPLATFORM golang:1.22.3-alpine as go-deps | ||
WORKDIR /bb-build | ||
COPY go.mod go.sum main.go ./ | ||
COPY cmd cmd | ||
COPY gen gen | ||
COPY protocols protocols | ||
COPY service service | ||
COPY strategies strategies | ||
RUN go mod vendor | ||
|
||
RUN mkdir -p /out | ||
RUN ./bin/dep ensure | ||
RUN go build -o /out/bb . | ||
# build the bb binary | ||
FROM --platform=$BUILDPLATFORM go-deps as golang | ||
WORKDIR /bb-build | ||
RUN CGO_ENABLED=0 go build -o /out/bb -mod=vendor . | ||
|
||
FROM gcr.io/linkerd-io/base:2019-02-19.01 | ||
RUN apt-get update | ||
RUN apt-get install -y ca-certificates | ||
COPY --from=golang /out /out | ||
# package a runtime image | ||
FROM scratch | ||
LABEL org.opencontainers.image.source=https://github.com/buoyantio/bb | ||
COPY --from=golang /out/bb /out/bb | ||
COPY --from=golang /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
ENTRYPOINT ["/out/bb"] |
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,12 +1,25 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
generated_src_dir=./gen | ||
# keep in sync with google.golang.org/protobuf in go.mod | ||
protoc_gen_go_version=v1.33.0 | ||
# keep in sync with google.golang.org/grpc/cmd/protoc-gen-go-grpc in go.mod | ||
protoc_gen_go_grpc_version=v1.3.0 | ||
|
||
go install ./vendor/github.com/golang/protobuf/protoc-gen-go | ||
# fetch tools and dependencies | ||
go install google.golang.org/protobuf/cmd/protoc-gen-go@$protoc_gen_go_version | ||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@$protoc_gen_go_grpc_version | ||
|
||
rm -rf $generated_src_dir | ||
mkdir $generated_src_dir | ||
bin/protoc -I . --go_out=plugins=grpc:$generated_src_dir ./api.proto | ||
basedir=$(cd "$(dirname "$0")"/..; pwd) | ||
outdir="$basedir"/gen | ||
rm -rf "$outdir" | ||
mkdir "$outdir" | ||
|
||
"$basedir"/bin/protoc \ | ||
--proto_path="$basedir" \ | ||
--go_out="$outdir" \ | ||
--go_opt=paths=source_relative \ | ||
--go-grpc_out="$outdir" \ | ||
--go-grpc_opt=paths=source_relative \ | ||
"$basedir"/api.proto |
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.