Skip to content

Commit

Permalink
compile protobuf stub code while building
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaiba committed Feb 14, 2023
1 parent 69ce43d commit 9ecf648
Show file tree
Hide file tree
Showing 29 changed files with 31 additions and 7,020 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/deploy-ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.KWIL_MACH_SECRET }}

- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.KWIL_MACH_SECRET }}

# Setup Go
- name: Setup Go
uses: actions/setup-go@v3
with:
Expand All @@ -26,6 +34,17 @@ jobs:
run: |
go version
go get -u golang.org/x/lint/golint
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2
go install google.golang.org/protobuf/cmd/protoc-gen-go
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
- name: Install Task
uses: arduino/setup-task@v1

- name: Compile Protobufs
run: |
task pb:compile:all
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -52,7 +71,6 @@ jobs:
id: vers
run: echo "val=$(git describe)" >> $GITHUB_OUTPUT


- name: Build(KD), tag, and push docker image to Amazon ECR (used with ECS Fargate)
env:
DOCKER_BUILDKIT: 1
Expand All @@ -65,8 +83,8 @@ jobs:
IMAGE_TAG: latest
run: |
# Build a docker container and push it to ECR
#docker build -f ./docker/kwild.dockerfile -t $ECR_REGISTRY/$ECR_REPOSITORY1:kd$IMAGE_HASH_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY1:$IMAGE_TAG .
docker build -f ./docker/kwild.dockerfile -t $ECR_REGISTRY/$ECR_REPOSITORY1:$IMAGE_TAG .
#docker build -f ./build/package/docker/kwild.dockerfile -t $ECR_REGISTRY/$ECR_REPOSITORY1:kd$IMAGE_HASH_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY1:$IMAGE_TAG .
docker build -f ./build/package/docker/kwild.dockerfile -t $ECR_REGISTRY/$ECR_REPOSITORY1:$IMAGE_TAG .
echo "Pushing images to ECR..."
docker push $ECR_REGISTRY/$ECR_REPOSITORY1 --all-tags
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY1 --all-tags" >> $GITHUB_OUTPUT
Expand All @@ -83,7 +101,7 @@ jobs:
IMAGE_TAG: latest
run: |
# Build a docker container and push it to ECR
docker build -f ./docker/kwil-gateway.dockerfile -t $ECR_REGISTRY/$ECR_REPOSITORY2:$IMAGE_TAG .
docker build -f ./build/package/docker/kwil-gateway.dockerfile -t $ECR_REGISTRY/$ECR_REPOSITORY2:$IMAGE_TAG .
echo "Pushing images to ECR..."
docker push $ECR_REGISTRY/$ECR_REPOSITORY2 --all-tags
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY2 --all-tags" >> $GITHUB_OUTPUT
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ cmd/cmd
_ignore
.env
proto
api/protobuf
api/openapi-spec/v0/api.swagger.json

# helm charts deps
deployments/helm/hasura/charts/
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "proto"]
path = proto
url = https://github.com/kwilteam/proto.git
url = https://github.com/kwilteam/proto
8 changes: 5 additions & 3 deletions api/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ tasks:
## Compile all protobufs
compile:all:
desc: Compiles all protobufs
preconditions:
- sh: a="libprotoc 3.21.12";b=`protoc --version`;test "$a" = "$b"
msg: "Protobuf compiler version is not 3.21.12, please install the correct version"
# TODO: enforce after github action supprort new versionning scheme
# version above 3.21 is not supported by github actions,
# preconditions:
# - sh: a="libprotoc 3.21.12";b=`protoc --version`;test "$a" = "$b"
# msg: "Protobuf compiler version is not 3.21.12, please install the correct version"
cmds:
- |
protoc -I ./proto \
Expand Down
227 changes: 0 additions & 227 deletions api/protobuf/accounts/v0/service.pb.go

This file was deleted.

Loading

0 comments on commit 9ecf648

Please sign in to comment.