Skip to content

Commit

Permalink
api: remove v2 dependencies from v3 API protos. (#18817)
Browse files Browse the repository at this point in the history
This should reduce the binary size, which is particularly important for Envoy Mobile. Looking at a
local opt build with debug symbols, I'm seeing a drop from ~400MB to ~380MB, so maybe 5% saving. @Reflejo indicates that optimized Envoy Mobile without symbols is observing ~20% improvement.

Related to #10943

Risk level: Low
Testing: bazel query deps to confirm no more v2 API deps.

Signed-off-by: Harvey Tuch <htuch@google.com>
  • Loading branch information
htuch authored Oct 29, 2021
1 parent 136e11d commit 53fca61
Show file tree
Hide file tree
Showing 55 changed files with 36 additions and 193 deletions.
15 changes: 15 additions & 0 deletions api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,39 @@ proto_library(
"//envoy/api/v2/ratelimit:pkg",
"//envoy/api/v2/route:pkg",
"//envoy/config/bootstrap/v2:pkg",
"//envoy/config/cluster/dynamic_forward_proxy/v2alpha:pkg",
"//envoy/config/common/dynamic_forward_proxy/v2alpha:pkg",
"//envoy/config/common/tap/v2alpha:pkg",
"//envoy/config/filter/accesslog/v2:pkg",
"//envoy/config/filter/fault/v2:pkg",
"//envoy/config/filter/http/compressor/v2:pkg",
"//envoy/config/filter/http/dynamic_forward_proxy/v2alpha:pkg",
"//envoy/config/filter/http/gzip/v2:pkg",
"//envoy/config/filter/http/rate_limit/v2:pkg",
"//envoy/config/filter/http/rbac/v2:pkg",
"//envoy/config/filter/network/dubbo_proxy/v2alpha1:pkg",
"//envoy/config/filter/network/http_connection_manager/v2:pkg",
"//envoy/config/filter/network/rate_limit/v2:pkg",
"//envoy/config/filter/network/rbac/v2:pkg",
"//envoy/config/filter/network/redis_proxy/v2:pkg",
"//envoy/config/filter/network/tcp_proxy/v2:pkg",
"//envoy/config/filter/network/thrift_proxy/v2alpha1:pkg",
"//envoy/config/filter/thrift/rate_limit/v2alpha1:pkg",
"//envoy/config/filter/thrift/router/v2alpha1:pkg",
"//envoy/config/health_checker/redis/v2:pkg",
"//envoy/config/listener/v2:pkg",
"//envoy/config/metrics/v2:pkg",
"//envoy/config/overload/v2alpha:pkg",
"//envoy/config/ratelimit/v2:pkg",
"//envoy/config/rbac/v2:pkg",
"//envoy/config/resource_monitor/fixed_heap/v2alpha:pkg",
"//envoy/config/resource_monitor/injected_resource/v2alpha:pkg",
"//envoy/config/retry/omit_canary_hosts/v2:pkg",
"//envoy/config/retry/previous_hosts/v2:pkg",
"//envoy/config/trace/v2:pkg",
"//envoy/config/trace/v2alpha:pkg",
"//envoy/config/transport_socket/alts/v2alpha:pkg",
"//envoy/config/transport_socket/tap/v2alpha:pkg",
"//envoy/data/accesslog/v2:pkg",
"//envoy/data/tap/v2alpha:pkg",
"//envoy/service/accesslog/v2:pkg",
Expand Down
1 change: 0 additions & 1 deletion api/envoy/admin/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/admin/v2alpha:pkg",
"//envoy/config/bootstrap/v3:pkg",
"//envoy/config/cluster/v3:pkg",
"//envoy/config/core/v3:pkg",
Expand Down
1 change: 0 additions & 1 deletion api/envoy/config/accesslog/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/config/core/v3:pkg",
"//envoy/config/filter/accesslog/v2:pkg",
"//envoy/config/route/v3:pkg",
"//envoy/type/matcher/v3:pkg",
"//envoy/type/v3:pkg",
Expand Down
1 change: 0 additions & 1 deletion api/envoy/config/bootstrap/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ api_proto_package(
deps = [
"//envoy/annotations:pkg",
"//envoy/config/accesslog/v3:pkg",
"//envoy/config/bootstrap/v2:pkg",
"//envoy/config/cluster/v3:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/config/listener/v3:pkg",
Expand Down
2 changes: 0 additions & 2 deletions api/envoy/config/cluster/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/annotations:pkg",
"//envoy/api/v2:pkg",
"//envoy/api/v2/cluster:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/config/endpoint/v3:pkg",
"//envoy/type/v3:pkg",
Expand Down
1 change: 0 additions & 1 deletion api/envoy/config/core/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/annotations:pkg",
"//envoy/api/v2/core:pkg",
"//envoy/type/matcher/v3:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
Expand Down
2 changes: 0 additions & 2 deletions api/envoy/config/endpoint/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/api/v2:pkg",
"//envoy/api/v2/endpoint:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
Expand Down
3 changes: 0 additions & 3 deletions api/envoy/config/listener/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/annotations:pkg",
"//envoy/api/v2:pkg",
"//envoy/api/v2/listener:pkg",
"//envoy/config/accesslog/v3:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/config/listener/v2:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
"@com_github_cncf_udpa//xds/core/v3:pkg",
Expand Down
1 change: 0 additions & 1 deletion api/envoy/config/metrics/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/config/core/v3:pkg",
"//envoy/config/metrics/v2:pkg",
"//envoy/type/matcher/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
1 change: 0 additions & 1 deletion api/envoy/config/overload/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/config/overload/v2alpha:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
2 changes: 0 additions & 2 deletions api/envoy/config/route/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/annotations:pkg",
"//envoy/api/v2:pkg",
"//envoy/api/v2/route:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/type/matcher/v3:pkg",
"//envoy/type/metadata/v3:pkg",
Expand Down
1 change: 0 additions & 1 deletion api/envoy/config/tap/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ api_proto_package(
"//envoy/config/common/matcher/v3:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/config/route/v3:pkg",
"//envoy/service/tap/v2alpha:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
2 changes: 0 additions & 2 deletions api/envoy/config/trace/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ api_proto_package(
deps = [
"//envoy/annotations:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/config/trace/v2:pkg",
"//envoy/config/trace/v2alpha:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
"@opencensus_proto//opencensus/proto/trace/v1:trace_config_proto",
],
Expand Down
1 change: 0 additions & 1 deletion api/envoy/data/accesslog/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/config/core/v3:pkg",
"//envoy/data/accesslog/v2:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
1 change: 0 additions & 1 deletion api/envoy/data/tap/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/config/core/v3:pkg",
"//envoy/data/tap/v2alpha:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
1 change: 0 additions & 1 deletion api/envoy/extensions/common/ratelimit/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/api/v2/ratelimit:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
1 change: 0 additions & 1 deletion api/envoy/extensions/filters/common/fault/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/config/filter/fault/v2:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ api_proto_package(
deps = [
"//envoy/config/accesslog/v3:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/config/filter/network/http_connection_manager/v2:pkg",
"//envoy/config/route/v3:pkg",
"//envoy/config/trace/v3:pkg",
"//envoy/type/http/v3:pkg",
Expand Down
1 change: 0 additions & 1 deletion api/envoy/extensions/filters/network/redis_proxy/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/config/core/v3:pkg",
"//envoy/config/filter/network/redis_proxy/v2:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
1 change: 0 additions & 1 deletion api/envoy/extensions/filters/network/tcp_proxy/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ api_proto_package(
deps = [
"//envoy/config/accesslog/v3:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/config/filter/network/tcp_proxy/v2:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/config/filter/thrift/router/v2alpha1:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)
1 change: 0 additions & 1 deletion api/envoy/extensions/filters/network/thrift_proxy/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/config/core/v3:pkg",
"//envoy/config/filter/network/thrift_proxy/v2alpha1:pkg",
"//envoy/config/route/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
5 changes: 1 addition & 4 deletions api/envoy/extensions/health_checkers/redis/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/config/health_checker/redis/v2:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)
5 changes: 1 addition & 4 deletions api/envoy/extensions/resource_monitors/fixed_heap/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/config/resource_monitor/fixed_heap/v2alpha:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/config/resource_monitor/injected_resource/v2alpha:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)
5 changes: 1 addition & 4 deletions api/envoy/extensions/retry/host/omit_canary_hosts/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/config/retry/omit_canary_hosts/v2:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)
5 changes: 1 addition & 4 deletions api/envoy/extensions/retry/host/previous_hosts/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/config/retry/previous_hosts/v2:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)
5 changes: 1 addition & 4 deletions api/envoy/extensions/transport_sockets/alts/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"//envoy/config/transport_socket/alts/v2alpha:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)
1 change: 0 additions & 1 deletion api/envoy/extensions/transport_sockets/tls/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/annotations:pkg",
"//envoy/api/v2/auth:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/type/matcher/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
Expand Down
1 change: 0 additions & 1 deletion api/envoy/service/accesslog/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ api_proto_package(
deps = [
"//envoy/config/core/v3:pkg",
"//envoy/data/accesslog/v3:pkg",
"//envoy/service/accesslog/v2:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
1 change: 0 additions & 1 deletion api/envoy/service/auth/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ api_proto_package(
deps = [
"//envoy/annotations:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/service/auth/v2:pkg",
"//envoy/type/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
1 change: 0 additions & 1 deletion api/envoy/service/cluster/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ api_proto_package(
has_services = True,
deps = [
"//envoy/annotations:pkg",
"//envoy/api/v2:pkg",
"//envoy/service/discovery/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
2 changes: 0 additions & 2 deletions api/envoy/service/discovery/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ licenses(["notice"]) # Apache 2
api_proto_package(
has_services = True,
deps = [
"//envoy/api/v2:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/service/discovery/v2:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
1 change: 0 additions & 1 deletion api/envoy/service/endpoint/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ api_proto_package(
has_services = True,
deps = [
"//envoy/annotations:pkg",
"//envoy/api/v2:pkg",
"//envoy/service/discovery/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
1 change: 0 additions & 1 deletion api/envoy/service/health/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ api_proto_package(
"//envoy/config/cluster/v3:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/config/endpoint/v3:pkg",
"//envoy/service/discovery/v2:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
1 change: 0 additions & 1 deletion api/envoy/service/listener/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ api_proto_package(
has_services = True,
deps = [
"//envoy/annotations:pkg",
"//envoy/api/v2:pkg",
"//envoy/service/discovery/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
1 change: 0 additions & 1 deletion api/envoy/service/load_stats/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ api_proto_package(
deps = [
"//envoy/config/core/v3:pkg",
"//envoy/config/endpoint/v3:pkg",
"//envoy/service/load_stats/v2:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
1 change: 0 additions & 1 deletion api/envoy/service/metrics/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ api_proto_package(
has_services = True,
deps = [
"//envoy/config/core/v3:pkg",
"//envoy/service/metrics/v2:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
"@prometheus_metrics_model//:client_model",
],
Expand Down
1 change: 0 additions & 1 deletion api/envoy/service/ratelimit/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ api_proto_package(
deps = [
"//envoy/config/core/v3:pkg",
"//envoy/extensions/common/ratelimit/v3:pkg",
"//envoy/service/ratelimit/v2:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
)
1 change: 0 additions & 1 deletion api/envoy/service/route/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ api_proto_package(
has_services = True,
deps = [
"//envoy/annotations:pkg",
"//envoy/api/v2:pkg",
"//envoy/service/discovery/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
1 change: 0 additions & 1 deletion api/envoy/service/runtime/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ api_proto_package(
has_services = True,
deps = [
"//envoy/annotations:pkg",
"//envoy/service/discovery/v2:pkg",
"//envoy/service/discovery/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
1 change: 0 additions & 1 deletion api/envoy/service/secret/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ api_proto_package(
has_services = True,
deps = [
"//envoy/annotations:pkg",
"//envoy/service/discovery/v2:pkg",
"//envoy/service/discovery/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
1 change: 0 additions & 1 deletion api/envoy/service/status/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ api_proto_package(
"//envoy/admin/v3:pkg",
"//envoy/annotations:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/service/status/v2:pkg",
"//envoy/type/matcher/v3:pkg",
"@com_github_cncf_udpa//udpa/annotations:pkg",
],
Expand Down
Loading

0 comments on commit 53fca61

Please sign in to comment.