diff --git a/.gitignore b/.gitignore index 5aaa89db..f4818d8a 100644 --- a/.gitignore +++ b/.gitignore @@ -73,4 +73,4 @@ venv-*/ out/ protos/**/*_pb2* # Generated Go files -docker/go-control-plane/grpc/interop/grpc_testing/xdsconfig/*.pb.go +docker/test-control-plane/grpc/interop/grpc_testing/xdsconfig/*.pb.go diff --git a/docker/go-control-plane/Dockerfile b/docker/test-control-plane/Dockerfile similarity index 77% rename from docker/go-control-plane/Dockerfile rename to docker/test-control-plane/Dockerfile index 94ee7e3b..7fbe9d7a 100644 --- a/docker/go-control-plane/Dockerfile +++ b/docker/test-control-plane/Dockerfile @@ -21,18 +21,21 @@ RUN cp ./proto/bin/protoc ${BASE}/bin/ RUN cp -R ./proto/include/* ${BASE}/include/ # pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change -COPY docker/go-control-plane/go.mod docker/go-control-plane/go.sum ./ +COPY docker/test-control-plane/go.mod docker/test-control-plane/go.sum ./ RUN go mod download && go mod verify COPY protos ./protos +COPY docker/test-control-plane . +# Make sure files generated on machine are not picked up +RUN rm -r grpc RUN protoc -I=. --go_out=. protos/grpc/testing/xdsconfig/*.proto --go-grpc_out=. -COPY docker/go-control-plane . -RUN go build -v -tags osusergo,netgo -o /usr/local/bin/fallback-control-plane . + +RUN go build -v -tags osusergo,netgo -o /usr/local/bin/test-control-plane . # Second stage of the build which copies over only the client binary and skips # the Go compiler and gRPC repo from the earlier stage. This significantly # reduces the docker image size. FROM alpine -COPY --from=build /usr/local/bin/fallback-control-plane /usr/local/bin +COPY --from=build /usr/local/bin/test-control-plane /usr/local/bin -ENTRYPOINT ["fallback-control-plane"] +ENTRYPOINT ["test-control-plane"] diff --git a/docker/go-control-plane/README.md b/docker/test-control-plane/README.md similarity index 60% rename from docker/go-control-plane/README.md rename to docker/test-control-plane/README.md index 41b433eb..46b69ce5 100644 --- a/docker/go-control-plane/README.md +++ b/docker/test-control-plane/README.md @@ -12,7 +12,12 @@ depends on `protos/grpc/testing/xdsconfig`, the build needs to be ran from the root of `grpc/psm-interop` checkout. ``` -docker build . -f docker/go-control-plane/Dockerfile +docker build . -f docker/test-control-plane/Dockerfile \ + -t us-docker.pkg.dev/grpc-testing/psm-interop/test-control-plane:latest +``` +Currently the server build is not automated so it has to be pushed manually: +``` +docker push us-docker.pkg.dev/grpc-testing/psm-interop/test-control-plane:latest ``` ## Local development @@ -20,7 +25,7 @@ docker build . -f docker/go-control-plane/Dockerfile Run the following command from this repository to generate code from the .proto files: ``` -protoc -I=. --go_out=docker/go-control-plane \ +protoc -I=. --go_out=docker/test-control-plane \ protos/grpc/testing/xdsconfig/*.proto \ - --go-grpc_out=docker/go-control-plane/ + --go-grpc_out=docker/test-control-plane/ ``` \ No newline at end of file diff --git a/docker/go-control-plane/go.mod b/docker/test-control-plane/go.mod similarity index 93% rename from docker/go-control-plane/go.mod rename to docker/test-control-plane/go.mod index 5b35ed95..cfcb7df6 100644 --- a/docker/go-control-plane/go.mod +++ b/docker/test-control-plane/go.mod @@ -1,4 +1,4 @@ -module github.com/grpc/psm-interop/docker/go-control-plane +module github.com/grpc/psm-interop/docker/test-control-plane go 1.22 diff --git a/docker/go-control-plane/go.sum b/docker/test-control-plane/go.sum similarity index 100% rename from docker/go-control-plane/go.sum rename to docker/test-control-plane/go.sum diff --git a/docker/go-control-plane/fallback-control-plane.go b/docker/test-control-plane/test-control-plane.go similarity index 98% rename from docker/go-control-plane/fallback-control-plane.go rename to docker/test-control-plane/test-control-plane.go index e15b38ae..711117e9 100644 --- a/docker/go-control-plane/fallback-control-plane.go +++ b/docker/test-control-plane/test-control-plane.go @@ -37,9 +37,8 @@ import ( "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" - xdsconfigpb "github.com/grpc/psm-interop/docker/go-control-plane/grpc/interop/grpc_testing/xdsconfig" - v3discoverypb "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3" + xdsconfigpb "github.com/grpc/psm-interop/docker/test-control-plane/grpc/interop/grpc_testing/xdsconfig" "github.com/envoyproxy/go-control-plane/pkg/cache/types" "github.com/envoyproxy/go-control-plane/pkg/cache/v3" diff --git a/go.work b/go.work index 000cd0e1..80322493 100644 --- a/go.work +++ b/go.work @@ -1,3 +1,3 @@ -go 1.20 +go 1.22 -use ./docker/go-control-plane +use ./docker/test-control-plane diff --git a/tests/fallback_test.py b/tests/fallback_test.py index 042d03df..e7fe0f43 100644 --- a/tests/fallback_test.py +++ b/tests/fallback_test.py @@ -30,7 +30,7 @@ _CONTROL_PLANE_IMAGE = flags.DEFINE_string( "control_plane_image", - "us-docker.pkg.dev/eostroukhov-xds-interop/docker/control-plane", + "us-docker.pkg.dev/grpc-testing/psm-interop/test-control-plane:latest", "Control plane (xDS config) server image", ) _HOST_NAME = flags.DEFINE_string(