-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[buildkite] Fix "Codegen" test in buildkite pipeline #4312
base: master
Are you sure you want to change the base?
Changes from all commits
5a31a9a
c2a8cf5
e855a83
54ef73c
94af271
c932a05
ed8762c
35a4ffb
1510ae3
75d9760
f8d305a
79a73dd
b3f0d2b
8aa394d
a931e42
189db61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
FROM golang:1.22-bullseye | ||
|
||
RUN apt-get update && apt-get install -y lsof netcat-openbsd docker.io jq | ||
RUN apt-get update && apt-get install -y lsof netcat-openbsd docker.io jq protobuf-compiler thrift-compiler | ||
|
||
RUN go install github.com/gogo/protobuf/protoc-gen-gogofaster@latest | ||
|
||
ENV GOBIN=/go/bin | ||
ENV PATH=$PATH:/go/bin |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,7 @@ | |
source $(dirname $0)/realpath.sh | ||
|
||
# paranoia, ftw | ||
set -e | ||
|
||
PROTOC_IMAGE_VERSION=${PROTOC_IMAGE_VERSION:-"znly/protoc:0.2.0"} | ||
|
||
# ensure docker is running | ||
docker run --platform linux/amd64 --rm hello-world >/dev/null | ||
|
||
UID_FLAGS="-u $(id -u)" | ||
if [[ -n "$BUILDKITE" ]]; then | ||
UID_FLAGS="-u root" | ||
fi | ||
set -ex | ||
|
||
PROTO_SRC=$1 | ||
for i in "${GOPATH}/src/${PROTO_SRC}"/*; do | ||
|
@@ -23,15 +13,11 @@ for i in "${GOPATH}/src/${PROTO_SRC}"/*; do | |
fi | ||
|
||
if ls $i/*.proto > /dev/null 2>&1; then | ||
proto_files=$(ls $i/*.proto | sed -e "s@${GOPATH}@@g") | ||
proto_files=$(ls $i/*.proto | sed -e "s@${GOPATH}@${GOPATH}@g") | ||
echo "generating from ${proto_files}" | ||
# need the additional m3db_path mount in docker because it's a symlink on the CI. | ||
m3db_path=$(realpath $GOPATH/src/github.com/m3db/m3) | ||
resolve_protos="Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types" | ||
|
||
docker run --platform linux/amd64 --rm -w /src -v $GOPATH/src:/src -v ${m3db_path}:/src/github.com/m3db/m3 \ | ||
$UID_FLAGS $PROTOC_IMAGE_VERSION \ | ||
--gogofaster_out=${resolve_protos},plugins=grpc:/src \ | ||
-I/src -I/src/github.com/m3db/m3/vendor ${proto_files} | ||
protoc --gogofaster_out=${resolve_protos},plugins=grpc:${GOPATH}/src \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should try to stick with the containerized protobuf here ideally--we want to use a consistent protobuf version, rather than whatever the developer has "lying around". |
||
-I${GOPATH}/src -I${GOPATH}/src/github.com/m3db/m3/vendor ${proto_files} | ||
fi | ||
done |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment--we want a consistent set of versions for this.