-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move proto stuff to aks-node-controller folder
- Loading branch information
Showing
6 changed files
with
43 additions
and
47 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
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,4 +1,12 @@ | ||
.PHONY: proto-generate | ||
.PHONY: proto-generate lint-proto-files | ||
proto-generate: | ||
docker build -t protoc-docker - < protoc.Dockerfile | ||
docker run --rm -v $(shell pwd):/$(shell pwd) --workdir=$(shell pwd) protoc-docker protoc --go_opt=module=github.com/Azure/agentbaker/aks-node-controller --go_out=./ --proto_path=proto $(shell find proto/aksnodeconfig/v1 -name '*.proto') | ||
docker build --platform $(shell uname -m) -t protoc-docker - < protoc.Dockerfile | ||
docker run --rm -v $(shell pwd):/$(shell pwd) --workdir=$(shell pwd) protoc-docker protoc --go_opt=module=github.com/Azure/agentbaker/aks-node-controller --go_out=./ --proto_path=proto $(shell find proto/aksnodeconfig/v1 -name '*.proto') | ||
$(MAKE) proto-lint | ||
|
||
|
||
BUF = docker run --volume "$(CURDIR)/../:$(CURDIR)/../" --workdir $(CURDIR) bufbuild/buf:1.47.2 | ||
|
||
proto-lint: | ||
@($(BUF) lint) | ||
@($(BUF) breaking --against '../.git#branch=dev,subdir=aks-node-controller') # TODO: change to master |
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,6 +1,6 @@ | ||
version: v2 | ||
modules: | ||
- path: aks-node-controller/proto | ||
- path: proto | ||
lint: | ||
use: | ||
- STANDARD | ||
|
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,14 +1,32 @@ | ||
# Use a multi-stage build to handle different architectures | ||
FROM golang:1.23.3-alpine3.20 | ||
|
||
ARG TARGETARCH | ||
RUN if [ "${TARGETARCH}" = "amd64" ]; then \ | ||
wget -O protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip; \ | ||
# Define build-time arguments for the protobuf and gRPC versions | ||
ARG PROTOC_VERSION=28.3 | ||
ARG PROTOC_GEN_GO_VERSION=1.35.2 | ||
|
||
# Determine architecture and set appropriate URLs | ||
RUN set -e; \ | ||
ARCH=`uname -m`; \ | ||
apk add --no-cache wget unzip; \ | ||
if [ "$ARCH" = "x86_64" ]; then \ | ||
PROTOC_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip"; \ | ||
PROTOC_GEN_GO_URL="https://github.com/protocolbuffers/protobuf-go/releases/download/v${PROTOC_GEN_GO_VERSION}/protoc-gen-go.v${PROTOC_GEN_GO_VERSION}.linux.amd64.tar.gz"; \ | ||
elif [ "$ARCH" = "aarch64" ]; then \ | ||
PROTOC_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-aarch_64.zip"; \ | ||
PROTOC_GEN_GO_URL="https://github.com/protocolbuffers/protobuf-go/releases/download/v${PROTOC_GEN_GO_VERSION}/protoc-gen-go.v${PROTOC_GEN_GO_VERSION}.linux.arm64.tar.gz"; \ | ||
else \ | ||
wget -O protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-aarch_64.zip; \ | ||
fi && \ | ||
unzip protoc.zip -d /usr/local && \ | ||
rm protoc.zip | ||
RUN go install google.golang.org/protobuf/cmd/[email protected] | ||
echo "Unsupported architecture: $ARCH" && exit 1; \ | ||
fi; \ | ||
\ | ||
# Download and install protobuf compiler | ||
wget -O protoc.zip $PROTOC_URL; \ | ||
unzip protoc.zip -d /usr/local; \ | ||
rm protoc.zip; \ | ||
\ | ||
# Download and install protobuf Go plugin | ||
wget -O protoc-gen-go.tar.gz $PROTOC_GEN_GO_URL; \ | ||
tar -xzf protoc-gen-go.tar.gz -C /usr/local/bin; \ | ||
rm protoc-gen-go.tar.gz | ||
|
||
# Default command | ||
CMD ["protoc"] |
This file was deleted.
Oops, something went wrong.