Skip to content
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

Contribute build updates #7

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions Tiltfile
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
# -*- mode: Python -*-
update_settings(suppress_unused_image_warnings=["lreimer/micronaut-beer-grpc", "lreimer/quarkus-beer-grpc"])
update_settings(suppress_unused_image_warnings=["qaware/micronaut-beer-grpc", "qaware/quarkus-beer-grpc"])

# for the Quarkus beer services
# local_resource('quarkus-beer-grpc-build', './gradlew assemble', dir='quarkus-beer-grpc',
# deps=['./quarkus-beer-grpc/build.gradle', './quarkus-beer-grpc/src/'], labels=['Quarkus'])
local_resource('quarkus-beer-grpc-build', './gradlew assemble', dir='quarkus-beer-grpc',
deps=['./quarkus-beer-grpc/build.gradle', './quarkus-beer-grpc/src/'], labels=['Quarkus'])

# docker_build('lreimer/quarkus-beer-grpc', './quarkus-beer-grpc/',
# dockerfile='quarkus-beer-grpc/src/main/docker/Dockerfile.jvm', only=['./build/'])
docker_build('qaware/quarkus-beer-grpc', './quarkus-beer-grpc/',
dockerfile='quarkus-beer-grpc/src/main/docker/Dockerfile.jvm', only=['./build/'])

# k8s_yaml(['quarkus-beer-grpc/k8s/deployment.yaml', 'quarkus-beer-grpc/k8s/service.yaml'])
# k8s_resource(workload='grpc-beer-service', port_forwards=[port_forward(19090, 9090, 'gRPC API')], labels=['Quarkus'])
k8s_yaml(['quarkus-beer-grpc/k8s/deployment.yaml', 'quarkus-beer-grpc/k8s/service.yaml'])
k8s_resource(workload='grpc-beer-service', port_forwards=[port_forward(19090, 9090, 'gRPC API')], labels=['Quarkus'])

# local_resource('quarkus-beer-rest-build', './gradlew assemble', dir='quarkus-beer-rest',
# deps=['./quarkus-beer-rest/build.gradle', './quarkus-beer-rest/src/'], labels=['Quarkus'])
local_resource('quarkus-beer-rest-build', './gradlew assemble', dir='quarkus-beer-rest',
deps=['./quarkus-beer-rest/build.gradle', './quarkus-beer-rest/src/'], labels=['Quarkus'])

# docker_build('lreimer/quarkus-beer-rest', './quarkus-beer-rest/',
# dockerfile='quarkus-beer-rest/src/main/docker/Dockerfile.jvm', only=['./build/'])
docker_build('qaware/quarkus-beer-rest', './quarkus-beer-rest/',
dockerfile='quarkus-beer-rest/src/main/docker/Dockerfile.jvm', only=['./build/'])

# k8s_yaml(['quarkus-beer-rest/k8s/deployment.yaml', 'quarkus-beer-rest/k8s/service.yaml'])
# k8s_resource(workload='rest-beer-service', port_forwards=[port_forward(18080, 8080, 'REST API')], labels=['Quarkus'])
k8s_yaml(['quarkus-beer-rest/k8s/deployment.yaml', 'quarkus-beer-rest/k8s/service.yaml'])
k8s_resource(workload='rest-beer-service', port_forwards=[port_forward(18080, 8080, 'REST API')], labels=['Quarkus'])

# for the Micronaut beer service
custom_build('lreimer/micronaut-beer-grpc', 'cd micronaut-beer-grpc && ./gradlew jibDockerBuild --image $EXPECTED_REF',
['./micronaut-beer-grpc/build.gradle', './micronaut-beer-grpc/src/'])
k8s_yaml(['micronaut-beer-grpc/k8s/deployment.yaml', 'micronaut-beer-grpc/k8s/service.yaml'])
k8s_resource(workload='grpc-beer-service', port_forwards=[port_forward(19090, 9090, 'gRPC API')], labels=['Micronaut'])

custom_build('lreimer/micronaut-beer-rest', 'cd micronaut-beer-rest && ./gradlew jibDockerBuild --image $EXPECTED_REF',
['./micronaut-beer-rest/build.gradle', './micronaut-beer-rest/src/'])
k8s_yaml(['micronaut-beer-rest/k8s/deployment.yaml', 'micronaut-beer-rest/k8s/service.yaml'])
k8s_resource(workload='rest-beer-service', port_forwards=[port_forward(18080, 8080, 'REST API')], labels=['Micronaut'])
# custom_build('qaware/micronaut-beer-grpc', 'cd micronaut-beer-grpc && ./gradlew jibDockerBuild --image $EXPECTED_REF',
# ['./micronaut-beer-grpc/build.gradle', './micronaut-beer-grpc/src/'])
# k8s_yaml(['micronaut-beer-grpc/k8s/deployment.yaml', 'micronaut-beer-grpc/k8s/service.yaml'])
# k8s_resource(workload='grpc-beer-service', port_forwards=[port_forward(19090, 9090, 'gRPC API')], labels=['Micronaut'])
#
# custom_build('qaware/micronaut-beer-rest', 'cd micronaut-beer-rest && ./gradlew jibDockerBuild --image $EXPECTED_REF',
# ['./micronaut-beer-rest/build.gradle', './micronaut-beer-rest/src/'])
# k8s_yaml(['micronaut-beer-rest/k8s/deployment.yaml', 'micronaut-beer-rest/k8s/service.yaml'])
# k8s_resource(workload='rest-beer-service', port_forwards=[port_forward(18080, 8080, 'REST API')], labels=['Micronaut'])

# the gRPC beer Gateway
docker_build('lreimer/grpc-beer-gateway', './grpc-beer-gateway/', dockerfile='grpc-beer-gateway/Dockerfile')
docker_build('qaware/grpc-beer-gateway', './grpc-beer-gateway/', dockerfile='grpc-beer-gateway/Dockerfile')
k8s_yaml(['grpc-beer-gateway/k8s/deployment.yaml', 'grpc-beer-gateway/k8s/service.yaml'])
k8s_resource(workload='grpc-beer-gateway', port_forwards=[port_forward(18090, 8090, 'REST API')], labels=['gRPC'])

# the gRPC beer Envoy
docker_build('lreimer/grpc-beer-envoy', './grpc-beer-envoy/', dockerfile='grpc-beer-envoy/Dockerfile')
docker_build('qaware/grpc-beer-envoy', './grpc-beer-envoy/', dockerfile='grpc-beer-envoy/Dockerfile')
k8s_yaml(['grpc-beer-envoy/k8s/deployment.yaml', 'grpc-beer-envoy/k8s/service.yaml'])
k8s_resource(workload='grpc-beer-envoy', port_forwards=[port_forward(18091, 8091, 'gRPC Web')], labels=['gRPC'])

# the gRPC beer Nginx
docker_build('lreimer/grpc-beer-nginx', './grpc-beer-nginx/', dockerfile='grpc-beer-nginx/Dockerfile')
docker_build('qaware/grpc-beer-nginx', './grpc-beer-nginx/', dockerfile='grpc-beer-nginx/Dockerfile')
k8s_yaml(['grpc-beer-nginx/k8s/deployment.yaml', 'grpc-beer-nginx/k8s/service.yaml'])
k8s_resource(workload='grpc-beer-nginx', port_forwards=[port_forward(18888, 8888, 'gRPC Proxy')], labels=['gRPC'])

Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NAME = grpc-beer-client
default: build

image:
@docker build -t lreimer/$(NAME) .
@docker build -t qaware/$(NAME) .

build:
@buf generate
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-client/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: v1beta1
name: github.com/lreimer/from-rest-to-grpc
name: github.com/qaware/from-rest-to-grpc
deps:
- buf.build/beta/googleapis
build:
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-client/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/lreimer/from-rest-to-grpc/grpc-beer-client
module github.com/qaware/from-rest-to-grpc/grpc-beer-client

go 1.17

Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-client/k8s/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
spec:
containers:
- name: grpc-beer-client
image: lreimer/grpc-beer-client
image: qaware/grpc-beer-client
resources:
requests:
memory: "64Mi"
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"time"

pb "github.com/lreimer/from-rest-to-grpc/grpc-beer-client/proto"
pb "github.com/qaware/from-rest-to-grpc/grpc-beer-client/proto"
"google.golang.org/grpc"
"google.golang.org/protobuf/types/known/emptypb"
)
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-client/proto/beer.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

option go_package = "github.com/lreimer/from-rest-to-grpc/grpc-beer-client/proto";
option go_package = "github.com/qaware/from-rest-to-grpc/grpc-beer-client/proto";

import "google/protobuf/empty.proto";
package beer;
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-envoy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ NAME = grpc-beer-envoy
default: image

image:
@docker build -t lreimer/$(NAME) .
@docker build -t qaware/$(NAME) .
2 changes: 1 addition & 1 deletion grpc-beer-envoy/k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: grpc-beer-envoy
image: lreimer/grpc-beer-envoy
image: qaware/grpc-beer-envoy
resources:
requests:
memory: "64Mi"
Expand Down
33 changes: 28 additions & 5 deletions grpc-beer-gateway/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
NAME = grpc-beer-gateway

# This requires Bash version >= 4
SHELL:= /usr/bin/env bash -O globstar
# This will work with legacy versions of Bash without globstar
# SHELL:= /usr/bin/env bash

default: build

.PHONY: image
image:
@docker build -t lreimer/$(NAME) .
docker build -t $(NAME) .

.PHONY: build
build: $(NAME)

$(NAME): proto/beer.pb.go
go build

proto/beer.pb.go:
buf generate

build:
@buf generate
@go build
.PHONY: install-grpc-gateway
install-grpc-gateway:
go install \ main !12 ?3
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
google.golang.org/protobuf/cmd/protoc-gen-go \
google.golang.org/grpc/cmd/protoc-gen-go-grpc

.PHONY: clean
clean:
@rm -f $(NAME)
rm -f proto/**/*.pb.go
rm -f proto/**/*.pb.gw.go
rm -rf openapiv2
rm -f $(NAME)
2 changes: 1 addition & 1 deletion grpc-beer-gateway/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: v1beta1
name: github.com/lreimer/from-rest-to-grpc
name: github.com/qaware/from-rest-to-grpc
deps:
- buf.build/beta/googleapis
- buf.build/grpc-ecosystem/grpc-gateway
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-gateway/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/lreimer/from-rest-to-grpc/grpc-beer-gateway
module github.com/qaware/from-rest-to-grpc/grpc-beer-gateway

go 1.17

Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-gateway/k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: grpc-beer-gateway
image: lreimer/grpc-beer-gateway
image: qaware/grpc-beer-gateway
resources:
requests:
memory: "64Mi"
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-gateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"google.golang.org/grpc"

gw "github.com/lreimer/from-rest-to-grpc/grpc-beer-gateway/proto"
gw "github.com/qaware/from-rest-to-grpc/grpc-beer-gateway/proto"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions grpc-beer-gateway/openapiv2/beer.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"license": {
"name": "MIT",
"url": "https://github.com/lreimer/from-rest-to-grpc/blob/master/LICENSE"
"url": "https://github.com/qaware/from-rest-to-grpc/blob/master/LICENSE"
}
},
"tags": [
Expand Down Expand Up @@ -275,6 +275,6 @@
},
"externalDocs": {
"description": "Beer Service gRPC Gateway",
"url": "https://github.com/lreimer/from-rest-to-grpc/grpc-beer-gateway"
"url": "https://github.com/qaware/from-rest-to-grpc/grpc-beer-gateway"
}
}
6 changes: 3 additions & 3 deletions grpc-beer-gateway/proto/beer.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

option go_package = "github.com/lreimer/from-rest-to-grpc/grpc-beer-gateway/proto";
option go_package = "github.com/qaware/from-rest-to-grpc/grpc-beer-gateway/proto";

import "google/protobuf/empty.proto";
import "google/api/annotations.proto";
Expand Down Expand Up @@ -55,11 +55,11 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
};
license: {
name: "MIT";
url: "https://github.com/lreimer/from-rest-to-grpc/blob/master/LICENSE";
url: "https://github.com/qaware/from-rest-to-grpc/blob/master/LICENSE";
};
};
external_docs: {
url: "https://github.com/lreimer/from-rest-to-grpc/grpc-beer-gateway";
url: "https://github.com/qaware/from-rest-to-grpc/grpc-beer-gateway";
description: "Beer Service gRPC Gateway";
}
schemes: HTTP;
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-javascript/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: v1beta1
name: github.com/lreimer/from-rest-to-grpc
name: github.com/qaware/from-rest-to-grpc
deps:
- buf.build/beta/googleapis
build:
Expand Down
6 changes: 3 additions & 3 deletions grpc-beer-javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/lreimer/from-rest-to-grpc.git"
"url": "git+https://github.com/qaware/from-rest-to-grpc.git"
},
"keywords": [
"grpc-web"
],
"author": "M.-Leander Reimer",
"license": "MIT",
"bugs": {
"url": "https://github.com/lreimer/from-rest-to-grpc/issues"
"url": "https://github.com/qaware/from-rest-to-grpc/issues"
},
"homepage": "https://github.com/lreimer/from-rest-to-grpc",
"homepage": "https://github.com/qaware/from-rest-to-grpc",
"dependencies": {
"google-protobuf": "^3.20.1",
"grpc-web": "^1.3.0"
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-javascript/proto/beer.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

option go_package = "github.com/lreimer/from-rest-to-grpc/grpc-beer-service/proto";
option go_package = "github.com/qaware/from-rest-to-grpc/grpc-beer-service/proto";

import "google/protobuf/empty.proto";
package beer;
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-nginx/k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: grpc-beer-nginx
image: lreimer/grpc-beer-nginx
image: qaware/grpc-beer-nginx
resources:
requests:
memory: "32Mi"
Expand Down
22 changes: 17 additions & 5 deletions grpc-beer-service/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@ NAME = grpc-beer-service

default: build

.PHONY: run
run:
HOST=127.0.0.1 PORT=9090 ./grpc-beer-service

.PHONY: image
image:
@docker build -t lreimer/$(NAME) .
docker build -t qaware/$(NAME) .

.PHONY: build
build: grpc-beer-service

grpc-beer-service: proto/beer.pb.go
go build

build:
@buf generate
@go build
proto/beer.pb.go:
buf generate

.PHONY: clean
clean:
@rm -f $(NAME)
rm proto/*.pb.go
rm -f $(NAME)
2 changes: 1 addition & 1 deletion grpc-beer-service/beer.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
pb "github.com/lreimer/from-rest-to-grpc/grpc-beer-service/proto"
pb "github.com/qaware/from-rest-to-grpc/grpc-beer-service/proto"
)

var beers = map[string]*pb.Beer{
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-service/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: v1beta1
name: github.com/lreimer/from-rest-to-grpc
name: github.com/qaware/from-rest-to-grpc
deps:
- buf.build/beta/googleapis
build:
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-service/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/lreimer/from-rest-to-grpc/grpc-beer-service
module github.com/qaware/from-rest-to-grpc/grpc-beer-service

go 1.17

Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-service/k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: grpc-beer-service
image: lreimer/grpc-beer-service
image: qaware/grpc-beer-service
resources:
requests:
memory: "64Mi"
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net"
"os"

pb "github.com/lreimer/from-rest-to-grpc/grpc-beer-service/proto"
pb "github.com/qaware/from-rest-to-grpc/grpc-beer-service/proto"
"google.golang.org/grpc"
)

Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-service/proto/beer.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

option go_package = "github.com/lreimer/from-rest-to-grpc/grpc-beer-service/proto";
option go_package = "github.com/qaware/from-rest-to-grpc/grpc-beer-service/proto";

import "google/protobuf/empty.proto";
package beer;
Expand Down
2 changes: 1 addition & 1 deletion grpc-beer-service/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"log"

pb "github.com/lreimer/from-rest-to-grpc/grpc-beer-service/proto"
pb "github.com/qaware/from-rest-to-grpc/grpc-beer-service/proto"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
Expand Down
Loading