Skip to content

Commit 3ddd139

Browse files
committed
build: update Dockerfiles and CMakeLists for currency service, adjust generated files handling
Signed-off-by: Charlie Le <[email protected]>
1 parent 5159d02 commit 3ddd139

28 files changed

+29218
-39
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
*~
42
*.iml
53
*.ipr
@@ -58,3 +56,5 @@ test/tracetesting/tracetesting-vars.yaml
5856

5957
# Android
6058
*.apk
59+
60+
!src/currency/build

.licenserc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"/src/accounting/src/protos/",
4242
"src/cart/src/obj/",
4343
"src/cart/tests/obj/",
44-
"src/currency/generated/",
44+
"src/currency/build/",
4545
"src/checkoutservice/genproto/",
4646
"src/featureflagservice/assets/vendor/",
4747
"src/featureflagservice/priv/",

docker-gen-proto.sh

+17-13
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ gen_proto_cpp() {
2020
echo "Generating Cpp protobuf files for $1"
2121
docker build --build-arg OPENTELEMETRY_CPP_VERSION=${OPENTELEMETRY_CPP_VERSION} -f "src/$1/genproto/Dockerfile" -t "$1-genproto" .
2222
docker run --rm -v $(pwd):/build "$1-genproto" \
23-
cp -r "/$1/build/generated" "/build/src/$1/"
23+
cp -r "/$1/build/generated/" "/build/src/$1/build/generated/"
2424
}
2525

2626
gen_proto_python() {
@@ -30,15 +30,19 @@ gen_proto_python() {
3030
python -m grpc_tools.protoc -I /build/pb/ --python_out="./src/$1/" --grpc_python_out="./src/$1/" /build/pb/demo.proto
3131
}
3232

33-
#gen_proto_dotnet accounting
34-
#gen_proto_java ad
35-
#gen_proto_dotnet cart
36-
gen_proto_go checkoutservice
37-
gen_proto_cpp currency
38-
#gen_proto_ruby email
39-
#gen_proto_ts frontend
40-
#gen_proto_js payment
41-
gen_proto_go productcatalogservice
42-
#gen_proto_php quote
43-
gen_proto_python recommendation
44-
#gen_proto_rust shipping
33+
if [ -z "$1" ]; then
34+
#gen_proto_dotnet accounting
35+
#gen_proto_java ad
36+
#gen_proto_dotnet cart
37+
gen_proto_go checkoutservice
38+
gen_proto_cpp currency
39+
#gen_proto_ruby email
40+
#gen_proto_ts frontend
41+
#gen_proto_js payment
42+
gen_proto_go productcatalogservice
43+
#gen_proto_php quote
44+
gen_proto_python recommendation
45+
#gen_proto_rust shipping
46+
else
47+
"gen_proto_$1" "$2"
48+
fi

src/currency/.dockerignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
client.js
22
node_modules/
3-
build/
43
out/

src/currency/CMakeLists.txt

+1-5
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ add_custom_command(
3939
${HEALTH_GRPC_PB_H_FILE}
4040

4141
COMMAND
42-
${PROTOBUF_PROTOC_EXECUTABLE} ARGS "--experimental_allow_proto3_optional"
43-
"--proto_path=${PROTO_PATH}" ${PROTOBUF_INCLUDE_FLAGS}
44-
"--cpp_out=${GENERATED_PROTOBUF_PATH}"
45-
"--grpc_out=generate_mock_code=true:${GENERATED_PROTOBUF_PATH}"
46-
--plugin=protoc-gen-grpc="${gRPC_CPP_PLUGIN_EXECUTABLE}" ${DEMO_PROTO} ${HEALTH_PROTO})
42+
echo)
4743

4844
message(STATUS "gRPC_CPP_PLUGIN_EXECUTABLE=${gRPC_CPP_PLUGIN_EXECUTABLE}")
4945

src/currency/Dockerfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ RUN apk update && apk add git cmake make g++ grpc-dev protobuf-dev linux-headers
2020

2121
ARG OPENTELEMETRY_CPP_VERSION
2222

23-
RUN git clone https://github.com/open-telemetry/opentelemetry-cpp \
24-
&& cd opentelemetry-cpp/ \
25-
&& git checkout tags/v${OPENTELEMETRY_CPP_VERSION} -b v${OPENTELEMETRY_CPP_VERSION} \
23+
RUN git clone --depth 1 --branch v${OPENTELEMETRY_CPP_VERSION} https://github.com/open-telemetry/opentelemetry-cpp \
24+
&& cd opentelemetry-cpp/ \
2625
&& mkdir build \
2726
&& cd build \
2827
&& cmake .. -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON \

src/currency/build/generated/proto/demo.grpc.pb.cc

+1,055
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/currency/build/generated/proto/demo.grpc.pb.h

+3,708
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)