Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multi-module releases in go-control-plane #714

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test:

.PHONY: cover
cover:
@build/coverage.sh
@scripts/coverage.sh

.PHONY: format
format:
Expand Down Expand Up @@ -62,22 +62,22 @@ $(BINDIR)/test:
integration: integration.xds integration.ads integration.rest integration.xds.mux integration.xds.delta integration.ads.delta

integration.ads: $(BINDIR)/test $(BINDIR)/upstream
env XDS=ads build/integration.sh
env XDS=ads scripts/integration.sh

integration.xds: $(BINDIR)/test $(BINDIR)/upstream
env XDS=xds build/integration.sh
env XDS=xds scripts/integration.sh

integration.rest: $(BINDIR)/test $(BINDIR)/upstream
env XDS=rest build/integration.sh
env XDS=rest scripts/integration.sh

integration.xds.mux: $(BINDIR)/test $(BINDIR)/upstream
env XDS=xds build/integration.sh -mux
env XDS=xds scripts/integration.sh -mux

integration.xds.delta: $(BINDIR)/test $(BINDIR)/upstream
env XDS=delta build/integration.sh
env XDS=delta scripts/integration.sh

integration.ads.delta: $(BINDIR)/test $(BINDIR)/upstream
env XDS=delta-ads build/integration.sh
env XDS=delta-ads scripts/integration.sh

#--------------------------------------
#-- example xDS control plane server
Expand All @@ -88,12 +88,12 @@ $(BINDIR)/example:
@go build -race -o $@ internal/example/main/main.go

example: $(BINDIR)/example
@build/example.sh
@scripts/example.sh

.PHONY: docker_tests
docker_tests:
docker build --pull -f Dockerfile.ci . -t gcp_ci && \
docker run -v $$(pwd):/go-control-plane $$(tty -s && echo "-it" || echo) gcp_ci /bin/bash -c /go-control-plane/build/do_ci.sh
docker run -v $$(pwd):/go-control-plane $$(tty -s && echo "-it" || echo) gcp_ci /bin/bash -c /go-control-plane/scripts/do_ci.sh

.PHONY: tidy-all
tidy-all:
Expand Down
23 changes: 23 additions & 0 deletions contrib/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module github.com/envoyproxy/go-control-plane/contrib

go 1.21

replace github.com/envoyproxy/go-control-plane/envoy => ../envoy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding from go.work is that it should no longer be needed to add those replace commands
Is that actually not the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually couldn't get go mod tidy to play nice without them. I can mess around with it a bit more but figured this was fine for now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to drop the replace from ./envoy but that one still complained so I left it in.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is an indication that we don't have the right structure? Since the "envoy" and "contrib" protobufs are bound to the same Envoy release, does it make sense to allow the possibility for a program to import different versions of them?

How hard would it be to move the contrib protobufs to "envoy/contrib"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I suppose that a similar question arises for the "./ratelimit" directory.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heres a branch of Contour using the above branch: https://github.com/sunjayBhatia/contour/tree/use-go-control-plane-multi-module

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(the above go-control-plane branch also copies the ratelimit module to a package in the new api module)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this branch of Contour works with this PR's branch (plus this commit sunjayBhatia@4be6f62): sunjayBhatia/contour@dc8fa81

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think either approach will work just fine, though the upgrade/transition UX might be cleaner (no possibility for users complaining about ambiguous package paths if they are requiring mismatched versions) if the new modules have a new package path

Copy link
Contributor

@jpeach jpeach Jun 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(the above go-control-plane branch also copies the ratelimit module to a package in the new api module)

I'll check later, but me recollection is that the ratelimit protos don't come from the envoy repository. So they probably need to be versioned differently and it might not make sense for them to be in the same module as the envoy api.


require (
github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b
github.com/envoyproxy/go-control-plane/envoy v0.0.0-00010101000000-000000000000
github.com/envoyproxy/protoc-gen-validate v1.1.0
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
)

require (
cel.dev/expr v0.15.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
)
12 changes: 12 additions & 0 deletions contrib/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cel.dev/expr v0.15.0 h1:O1jzfJCQBfL5BFoYktaxwIhuttaQPsVWerH9/EEKx0w=
github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw=
github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo=
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8=
google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
23 changes: 23 additions & 0 deletions envoy/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module github.com/envoyproxy/go-control-plane/envoy

go 1.21

require (
github.com/census-instrumentation/opencensus-proto v0.4.1
github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b
github.com/envoyproxy/protoc-gen-validate v1.1.0
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10
github.com/prometheus/client_model v0.6.0
go.opentelemetry.io/proto/otlp v0.19.0
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
)

require (
cel.dev/expr v0.15.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
)
Loading