Skip to content

Commit

Permalink
neat cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
feuyeux committed Oct 3, 2024
1 parent 5606aad commit cca6de6
Show file tree
Hide file tree
Showing 57 changed files with 380 additions and 1,295 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,9 @@ updates:
interval: "daily"
- package-ecosystem: "pub"
directory: "hello_grpc_flutter"
schedule:
interval: "daily"
- package-ecosystem: "bazel"
directory: "hello-grpc-cpp"
schedule:
interval: "daily"
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ docker/glog
docker/gflags
docker/Catch2
bazel-*
hello_grpc_flutter/build/*
.clwb

# flutter
hello_grpc_flutter/build/*
# kotlin
hello-grpc-kotlin/client/build
hello-grpc-kotlin/server/build
hello-grpc-kotlin/stub/build
hello-grpc-kotlin/protos/build

Binary file modified diagram/build_tools.zip
Binary file not shown.
Binary file modified diagram/operation_system_logo.zip
Binary file not shown.
Binary file modified diagram/program_language_logo.zip
Binary file not shown.
1 change: 0 additions & 1 deletion docker/build_cpp.sh

This file was deleted.

42 changes: 0 additions & 42 deletions docker/build_cpp_cmake.sh

This file was deleted.

44 changes: 0 additions & 44 deletions docker/build_cpp_get_src.sh

This file was deleted.

14 changes: 7 additions & 7 deletions docker/build_cpp_bazel.sh → docker/cpp_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ cd "$(
# https://github.com/npclaudiu/grpc-cpp-docker.git

set -e

docker images | grep debian
cd ..
rm -rf docker/hello-grpc-cpp-bazel
cd hello-grpc-cpp-bazel
rm -rf docker/hello-grpc-cpp
cd hello-grpc-cpp
bazel clean
cd ..
cp -r hello-grpc-cpp-bazel docker/
cp -r hello-grpc-cpp docker/
cd docker
echo "1 build builder"
# --progress=plain
docker build -f grpc-cpp-bazel.dockerfile --target build -t feuyeux/grpc_cpp:1.0.0 .
docker build -f cpp_grpc.dockerfile --target build -t feuyeux/grpc_cpp:1.0.0 .

# docker run --rm -it --entrypoint=bash feuyeux/grpc_cpp:1.0.0

echo "2 build server"
docker build -f grpc-cpp-bazel.dockerfile --target server -t feuyeux/grpc_server_cpp:1.0.0 .
docker build -f cpp_grpc.dockerfile --target server -t feuyeux/grpc_server_cpp:1.0.0 .
echo "3 build client"
docker build -f grpc-cpp-bazel.dockerfile --target client -t feuyeux/grpc_client_cpp:1.0.0 .
docker build -f cpp_grpc.dockerfile --target client -t feuyeux/grpc_client_cpp:1.0.0 .

docker run --rm -it --entrypoint=bash feuyeux/grpc_server_cpp:1.0.0

Expand Down
12 changes: 8 additions & 4 deletions docker/grpc-cpp-bazel.dockerfile → docker/cpp_grpc.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,26 @@ RUN apt-get update && apt-get install -y \
&& apt-get clean

COPY bazel-7.0.2-installer-linux-x86_64.sh /source/bazel-installer.sh
COPY hello-grpc-cpp-bazel /source/hello-grpc-cpp-bazel
COPY hello-grpc-cpp /source/hello-grpc-cpp
WORKDIR /source
RUN chmod +x bazel-installer.sh && ./bazel-installer.sh && export PATH="$PATH:$/source/bin"
RUN cd hello-grpc-cpp-bazel && bazel build //:hello_server //:hello_client
WORKDIR /source/hello-grpc-cpp
RUN bazel build --jobs=8 //protos:hello_cc_grpc
RUN bazel build --jobs=8 //common:hello_utils
RUN bazel build --jobs=8 //common:hello_conn
RUN bazel build --jobs=8 //:hello_server //:hello_client

FROM debian:12-slim AS server
WORKDIR /opt/hello-grpc/
COPY --from=build /source/hello-grpc-cpp-bazel/bazel-bin/hello_server .
COPY --from=build /source/hello-grpc-cpp/bazel-bin/hello_server .
COPY tls/server_certs /var/hello_grpc/server_certs
COPY tls/client_certs /var/hello_grpc/client_certs
RUN /sbin/ldconfig -v
CMD ["./hello_server"]

FROM debian:12-slim AS client
WORKDIR /opt/hello-grpc/
COPY --from=build /source/hello-grpc-cpp-bazel/bazel-bin/hello_client .
COPY --from=build /source/hello-grpc-cpp/bazel-bin/hello_client .
COPY tls/client_certs /var/hello_grpc/client_certs
RUN /sbin/ldconfig -v
CMD ["./hello_client"]
59 changes: 0 additions & 59 deletions hello-grpc-cpp-bazel/BUILD.bazel

This file was deleted.

22 changes: 0 additions & 22 deletions hello-grpc-cpp-bazel/MODULE.bazel

This file was deleted.

55 changes: 0 additions & 55 deletions hello-grpc-cpp-bazel/README.md

This file was deleted.

17 changes: 0 additions & 17 deletions hello-grpc-cpp-bazel/WORKSPACE.bk

This file was deleted.

24 changes: 0 additions & 24 deletions hello-grpc-cpp-bazel/build.sh

This file was deleted.

Loading

0 comments on commit cca6de6

Please sign in to comment.