From 12897ab0fb77662c37c0ced39132a02c69ba4147 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Tue, 27 Feb 2024 08:49:19 -0800 Subject: [PATCH] [Interop] Make C++ xDS Interop Client and Server Responsive to SIGTERM (#34518) This PR adds `tini` to the C++ interop client and server to make them responsive to SIGTERM. Closes #34518 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/34518 from gnossen:ssa_interop_server a762b271788a359e193bafb0e6ad8dcbdd32a44a PiperOrigin-RevId: 610766377 --- .../grpc_interop_cxx_xds/Dockerfile.xds_client | 9 ++++++++- .../grpc_interop_cxx_xds/Dockerfile.xds_server | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client index 0a63231f5c6..a879677bd59 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client +++ b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_client @@ -27,6 +27,10 @@ COPY . . RUN tools/bazel build //test/cpp/interop:xds_interop_client RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_client /artifacts/ +ENV TINI_VERSION v0.19.0 +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +RUN chmod +x /tini + FROM python:3.9-slim-bookworm ENV GRPC_VERBOSITY="DEBUG" @@ -39,4 +43,7 @@ RUN apt-get update \ COPY --from=0 /artifacts ./ -ENTRYPOINT ["/xds_interop_client"] +# tini serves as PID 1 and enables the server to properly respond to signals. +COPY --from=0 /tini /tini + +ENTRYPOINT ["/tini", "-g", "-vv", "--", "/xds_interop_client"] diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server index 14f33be7fc8..a49a587d227 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server +++ b/tools/dockerfile/interoptest/grpc_interop_cxx_xds/Dockerfile.xds_server @@ -27,6 +27,10 @@ COPY . . RUN tools/bazel build //test/cpp/interop:xds_interop_server RUN cp -rL /workdir/bazel-bin/test/cpp/interop/xds_interop_server /artifacts/ +ENV TINI_VERSION v0.19.0 +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +RUN chmod +x /tini + FROM python:3.9-slim-bookworm ENV GRPC_VERBOSITY="DEBUG" @@ -39,4 +43,7 @@ RUN apt-get update \ COPY --from=0 /artifacts ./ -ENTRYPOINT ["/xds_interop_server"] +# tini serves as PID 1 and enables the server to properly respond to signals. +COPY --from=0 /tini /tini + +ENTRYPOINT ["/tini", "-g", "-vv", "--", "/xds_interop_server"]