Skip to content

Commit 06a05a4

Browse files
authored
Merge pull request #2897 from murgatroid99/grpc-js-xds_interop_server
grpc-js-xds: Add interop server implementation
2 parents d2a6dda + 1ed46a1 commit 06a05a4

File tree

12 files changed

+391
-7
lines changed

12 files changed

+391
-7
lines changed

gulpfile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import * as reflection from './packages/grpc-reflection/gulpfile';
2323
import * as protobuf from './packages/proto-loader/gulpfile';
2424
import * as internalTest from './test/gulpfile';
2525

26-
const installAll = gulp.series(protobuf.install, jsCore.install, healthCheck.install, internalTest.install, jsXds.install, reflection.install);
26+
const installAll = gulp.series(protobuf.install, jsCore.install, healthCheck.install, reflection.install, internalTest.install, jsXds.install);
2727

2828
const lint = gulp.parallel(jsCore.lint);
2929

packages/grpc-health-check/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"license": "Apache-2.0",
3636
"devDependencies": {
3737
"@grpc/grpc-js": "file:../grpc-js",
38+
"@types/mocha": "^10.0.10",
3839
"typescript": "^5.2.2"
3940
}
4041
}

packages/grpc-js-xds/interop/Dockerfile renamed to packages/grpc-js-xds/interop/test-client.Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# Dockerfile for building the xDS interop client. To build the image, run the
1616
# following command from grpc-node directory:
17-
# docker build -t <TAG> -f packages/grpc-js-xds/interop/Dockerfile .
17+
# docker build -t <TAG> -f packages/grpc-js-xds/interop/test-client.Dockerfile .
1818

1919
FROM node:18-slim as build
2020

@@ -26,16 +26,23 @@ WORKDIR /node/src/grpc-node/packages/proto-loader
2626
RUN npm install
2727
WORKDIR /node/src/grpc-node/packages/grpc-js
2828
RUN npm install
29+
WORKDIR /node/src/grpc-node/packages/grpc-health-check
30+
RUN npm install
31+
WORKDIR /node/src/grpc-node/packages/grpc-reflection
32+
RUN npm install
2933
WORKDIR /node/src/grpc-node/packages/grpc-js-xds
3034
RUN npm install
3135

3236
FROM gcr.io/distroless/nodejs18-debian11:latest
3337
WORKDIR /node/src/grpc-node
3438
COPY --from=build /node/src/grpc-node/packages/proto-loader ./packages/proto-loader/
39+
COPY --from=build /node/src/grpc-node/packages/grpc-health-check ./packages/grpc-health-check/
40+
COPY --from=build /node/src/grpc-node/packages/grpc-reflection ./packages/grpc-reflection/
3541
COPY --from=build /node/src/grpc-node/packages/grpc-js ./packages/grpc-js/
3642
COPY --from=build /node/src/grpc-node/packages/grpc-js-xds ./packages/grpc-js-xds/
3743

3844
ENV GRPC_VERBOSITY="DEBUG"
3945
ENV GRPC_TRACE=xds_client,xds_resolver,xds_cluster_manager,cds_balancer,xds_cluster_resolver,xds_cluster_impl,priority,weighted_target,round_robin,resolving_load_balancer,subchannel,keepalive,dns_resolver,fault_injection,http_filter,csds,outlier_detection,server,server_call,ring_hash
46+
ENV NODE_XDS_INTEROP_VERBOSITY=1
4047

4148
ENTRYPOINT [ "/nodejs/bin/node", "/node/src/grpc-node/packages/grpc-js-xds/build/interop/xds-interop-client" ]
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright 2022 gRPC authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Dockerfile for building the xDS interop client. To build the image, run the
16+
# following command from grpc-node directory:
17+
# docker build -t <TAG> -f packages/grpc-js-xds/interop/test-server.Dockerfile .
18+
19+
FROM node:18-slim as build
20+
21+
# Make a grpc-node directory and copy the repo into it.
22+
WORKDIR /node/src/grpc-node
23+
COPY . .
24+
25+
WORKDIR /node/src/grpc-node/packages/proto-loader
26+
RUN npm install
27+
WORKDIR /node/src/grpc-node/packages/grpc-js
28+
RUN npm install
29+
WORKDIR /node/src/grpc-node/packages/grpc-health-check
30+
RUN npm install
31+
WORKDIR /node/src/grpc-node/packages/grpc-reflection
32+
RUN npm install
33+
WORKDIR /node/src/grpc-node/packages/grpc-js-xds
34+
RUN npm install
35+
36+
ENV TINI_VERSION v0.19.0
37+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
38+
RUN chmod +x /tini
39+
40+
FROM gcr.io/distroless/nodejs18-debian11:latest
41+
WORKDIR /node/src/grpc-node
42+
COPY --from=build /node/src/grpc-node/packages/proto-loader ./packages/proto-loader/
43+
COPY --from=build /node/src/grpc-node/packages/grpc-health-check ./packages/grpc-health-check/
44+
COPY --from=build /node/src/grpc-node/packages/grpc-reflection ./packages/grpc-reflection/
45+
COPY --from=build /node/src/grpc-node/packages/grpc-js ./packages/grpc-js/
46+
COPY --from=build /node/src/grpc-node/packages/grpc-js-xds ./packages/grpc-js-xds/
47+
48+
ENV GRPC_VERBOSITY="DEBUG"
49+
ENV GRPC_TRACE=xds_client,server,xds_server
50+
51+
# tini serves as PID 1 and enables the server to properly respond to signals.
52+
COPY --from=build /tini /tini
53+
54+
ENTRYPOINT [ "/tini", "-g", "-vv", "--", "/nodejs/bin/node", "/node/src/grpc-node/packages/grpc-js-xds/build/interop/xds-interop-server" ]

0 commit comments

Comments
 (0)