From d24a45a696f5162444950657c02e00796d1d45d4 Mon Sep 17 00:00:00 2001
From: Pavol Loffay
Date: Tue, 29 Jun 2021 15:07:45 +0200
Subject: [PATCH 1/3] Test api_v3 query service
Signed-off-by: Pavol Loffay
---
.github/workflows/ci-unit-tests.yml | 3 +++
.gitmodules | 3 +++
Makefile | 28 +++++++++++++++++++++++-----
opentelemetry-proto | 1 +
4 files changed, 30 insertions(+), 5 deletions(-)
create mode 100644 .gitmodules
create mode 160000 opentelemetry-proto
diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml
index 4141e292..c060acf6 100644
--- a/.github/workflows/ci-unit-tests.yml
+++ b/.github/workflows/ci-unit-tests.yml
@@ -12,5 +12,8 @@ jobs:
steps:
- uses: actions/checkout@v2
+ - name: Init git submodules
+ run: make init-submodules
+
- name: Run unit tests
run: make test-ci
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..ba86d9f3
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "opentelemetry-proto"]
+ path = opentelemetry-proto
+ url = https://github.com/open-telemetry/opentelemetry-proto.git
diff --git a/Makefile b/Makefile
index a2009388..a3b7c261 100644
--- a/Makefile
+++ b/Makefile
@@ -11,9 +11,9 @@ PROTOTOOL_VER=1.8.0
PROTOTOOL_IMAGE=uber/prototool:$(PROTOTOOL_VER)
PROTOTOOL=docker run --rm -u ${shell id -u} -v "${PWD}:/go/src/${PROJECT_ROOT}" -w /go/src/${PROJECT_ROOT} $(PROTOTOOL_IMAGE)
-PROTOC_VER=0.2.0
+PROTOC_VER=0.3.0
PROTOC_IMAGE=jaegertracing/protobuf:$(PROTOC_VER)
-PROTOC=docker run --rm -u ${shell id -u} -v "${PWD}:${PWD}" -w ${PWD} ${PROTOC_IMAGE} --proto_path=${PWD}
+PROTOC=docker run --rm -u ${shell id -u} -e LD_LIBRARY_PATH='/usr/lib:/usr/lib64:/usr/lib/local' -v "${PWD}:${PWD}" -w ${PWD} ${PROTOC_IMAGE} --proto_path=${PWD}
THRIFT_GO_ARGS=thrift_import="github.com/apache/thrift/lib/go/thrift"
THRIFT_PY_ARGS=new_style,tornado
@@ -50,7 +50,8 @@ protocompile:
PROTO_INCLUDES := \
-Iproto/api_v2 \
-Iproto \
- -I/usr/include/github.com/gogo/protobuf
+ -I/usr/include/github.com/gogo/protobuf \
+ -Iopentelemetry-proto
# Remapping of std types to gogo types (must not contain spaces)
PROTO_GOGO_MAPPINGS := $(shell echo \
Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/types, \
@@ -71,7 +72,6 @@ PROTO_GEN_CSHARP_DIR ?= proto-gen-csharp
PROTOC_WITHOUT_GRPC := $(PROTOC) \
$(PROTO_INCLUDES) \
--gogo_out=plugins=grpc,$(PROTO_GOGO_MAPPINGS):$(PWD)/${PROTO_GEN_GO_DIR} \
- --java_out=${PROTO_GEN_JAVA_DIR} \
--python_out=${PROTO_GEN_PYTHON_DIR} \
--js_out=${PROTO_GEN_JS_DIR} \
--cpp_out=${PROTO_GEN_CPP_DIR} \
@@ -105,6 +105,20 @@ proto:
proto/api_v2/collector.proto \
proto/api_v2/sampling.proto
+ # API v3
+ $(PROTOC_WITH_GRPC) \
+ proto/api_v3/query_service.proto
+ # GRPC gateway
+ $(PROTOC) \
+ $(PROTO_INCLUDES) \
+ --grpc-gateway_out=logtostderr=true,grpc_api_configuration=proto/api_v3/query_service_http.yaml,$(PROTO_GOGO_MAPPINGS):${PROTO_GEN_GO_DIR} \
+ proto/api_v3/query_service.proto
+ # Swagger
+ $(PROTOC) \
+ $(PROTO_INCLUDES) \
+ --swagger_out=disable_default_errors=true,logtostderr=true,grpc_api_configuration=proto/api_v3/query_service_http.yaml:${PROTO_GEN_GO_DIR} \
+ proto/api_v3/query_service.proto
+
$(PROTOC_INTERNAL) \
google/api/annotations.proto \
google/api/http.proto \
@@ -116,4 +130,8 @@ proto-zipkin:
$(PROTOC_WITHOUT_GRPC) \
proto/zipkin.proto
-.PHONY: test-ci clean thrift thrift-image $(THRIFT_FILES) swagger-validate protocompile proto proto-zipkin
+idl-submodule:
+ git submodule init
+ git submodule update
+
+.PHONY: test-ci clean thrift thrift-image $(THRIFT_FILES) swagger-validate protocompile proto proto-zipkin idl-submodule
diff --git a/opentelemetry-proto b/opentelemetry-proto
new file mode 160000
index 00000000..f3b0ee08
--- /dev/null
+++ b/opentelemetry-proto
@@ -0,0 +1 @@
+Subproject commit f3b0ee0861d304f8f3126686ba9b01c106069cb0
From f762e98f4226ee74306bc53dce8cc9d66ace664b Mon Sep 17 00:00:00 2001
From: Pavol Loffay
Date: Tue, 29 Jun 2021 15:09:31 +0200
Subject: [PATCH 2/3] revert
Signed-off-by: Pavol Loffay
---
Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index a3b7c261..65e5387a 100644
--- a/Makefile
+++ b/Makefile
@@ -72,6 +72,7 @@ PROTO_GEN_CSHARP_DIR ?= proto-gen-csharp
PROTOC_WITHOUT_GRPC := $(PROTOC) \
$(PROTO_INCLUDES) \
--gogo_out=plugins=grpc,$(PROTO_GOGO_MAPPINGS):$(PWD)/${PROTO_GEN_GO_DIR} \
+ --java_out=${PROTO_GEN_JAVA_DIR} \
--python_out=${PROTO_GEN_PYTHON_DIR} \
--js_out=${PROTO_GEN_JS_DIR} \
--cpp_out=${PROTO_GEN_CPP_DIR} \
From 3e1a871fb38e7f41e20532adbdc44d4ceb77e510 Mon Sep 17 00:00:00 2001
From: Pavol Loffay
Date: Tue, 29 Jun 2021 15:58:38 +0200
Subject: [PATCH 3/3] Init submodules
Signed-off-by: Pavol Loffay
---
.github/workflows/ci-unit-tests.yml | 2 +-
Makefile | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/ci-unit-tests.yml b/.github/workflows/ci-unit-tests.yml
index c060acf6..f39198b2 100644
--- a/.github/workflows/ci-unit-tests.yml
+++ b/.github/workflows/ci-unit-tests.yml
@@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2
- name: Init git submodules
- run: make init-submodules
+ run: make init-submodule
- name: Run unit tests
run: make test-ci
diff --git a/Makefile b/Makefile
index 65e5387a..7f80f65f 100644
--- a/Makefile
+++ b/Makefile
@@ -131,8 +131,8 @@ proto-zipkin:
$(PROTOC_WITHOUT_GRPC) \
proto/zipkin.proto
-idl-submodule:
+init-submodule:
git submodule init
git submodule update
-.PHONY: test-ci clean thrift thrift-image $(THRIFT_FILES) swagger-validate protocompile proto proto-zipkin idl-submodule
+.PHONY: test-ci clean thrift thrift-image $(THRIFT_FILES) swagger-validate protocompile proto proto-zipkin init-submodule