diff --git a/bazel/api_build_system.bzl b/bazel/api_build_system.bzl index d9a3e2d9..14cc6f89 100644 --- a/bazel/api_build_system.bzl +++ b/bazel/api_build_system.bzl @@ -5,6 +5,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_test") _PY_SUFFIX = "_py" _CC_SUFFIX = "_cc" +_CC_EXPORT_SUFFIX = "_export_cc" _GO_PROTO_SUFFIX = "_go_proto" _GO_GRPC_SUFFIX = "_go_grpc" _GO_IMPORTPATH_PREFIX = "github.com/envoyproxy/data-plane-api/api/" @@ -169,7 +170,7 @@ def api_cc_test(name, srcs, proto_deps): native.cc_test( name = name, srcs = srcs, - deps = [_LibrarySuffix(d, _CC_SUFFIX) for d in proto_deps], + deps = [_LibrarySuffix(d, _CC_EXPORT_SUFFIX) for d in proto_deps], ) def api_go_test(name, size, importpath, srcs = [], deps = []): diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 3185d0f7..d76337dc 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -15,6 +15,10 @@ def api_dependencies(): name = "com_google_googleapis", locations = REPOSITORY_LOCATIONS, ) + envoy_http_archive( + name = "com_github_cncf_udpa", + locations = REPOSITORY_LOCATIONS, + ) envoy_http_archive( name = "com_github_gogo_protobuf", locations = REPOSITORY_LOCATIONS, diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 0d0600a9..7b0bfeb0 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -18,6 +18,9 @@ PROMETHEUS_SHA = "783bdaf8ee0464b35ec0c8704871e1e72afa0005c3f3587f65d9d6694bf391 KAFKA_SOURCE_SHA = "ae7a1696c0a0302b43c5b21e515c37e6ecd365941f68a510a7e442eebddf39a1" # 2.2.0-rc2 +UDPA_GIT_SHA = "4cbdcb9931ca743a915a7c5fda51b2ee793ed157" # Aug 22, 2019 +UDPA_SHA256 = "6291d0c0e3a4d5f08057ea7a00ed0b0ec3dd4e5a3b1cf20f803774680b5a806f" + REPOSITORY_LOCATIONS = dict( bazel_skylib = dict( sha256 = BAZEL_SKYLIB_SHA256, @@ -34,6 +37,11 @@ REPOSITORY_LOCATIONS = dict( strip_prefix = "googleapis-" + GOOGLEAPIS_GIT_SHA, urls = ["https://github.com/googleapis/googleapis/archive/" + GOOGLEAPIS_GIT_SHA + ".tar.gz"], ), + com_github_cncf_udpa = dict( + sha256 = UDPA_SHA256, + strip_prefix = "udpa-" + UDPA_GIT_SHA, + urls = ["https://github.com/cncf/udpa/archive/" + UDPA_GIT_SHA + ".tar.gz"], + ), com_github_gogo_protobuf = dict( sha256 = GOGOPROTO_SHA256, strip_prefix = "protobuf-" + GOGOPROTO_RELEASE, diff --git a/test/build/BUILD b/test/build/BUILD index ab1e8640..a271aa5d 100644 --- a/test/build/BUILD +++ b/test/build/BUILD @@ -16,6 +16,7 @@ api_cc_test( "//envoy/service/discovery/v2:rtds", "//envoy/service/metrics/v2:metrics_service", "//envoy/service/ratelimit/v2:rls", + "@com_github_cncf_udpa//udpa/service/orca/v1:orca", ], ) diff --git a/test/build/build_test.cc b/test/build/build_test.cc index f0a8e7bf..540b2a51 100644 --- a/test/build/build_test.cc +++ b/test/build/build_test.cc @@ -23,6 +23,7 @@ int main(int argc, char* argv[]) { "envoy.service.accesslog.v2.AccessLogService.StreamAccessLogs", "envoy.service.metrics.v2.MetricsService.StreamMetrics", "envoy.service.ratelimit.v2.RateLimitService.ShouldRateLimit", + "udpa.service.orca.v1.OpenRcaService.StreamCoreMetrics", }; for (const auto& method : methods) { diff --git a/udpa/data/orca/v1/BUILD b/udpa/data/orca/v1/BUILD deleted file mode 100644 index 096ca28b..00000000 --- a/udpa/data/orca/v1/BUILD +++ /dev/null @@ -1,16 +0,0 @@ -load("@envoy_api//bazel:api_build_system.bzl", "api_go_proto_library", "api_proto_library") - -licenses(["notice"]) # Apache 2 - -api_proto_library( - name = "orca_load_report", - srcs = ["orca_load_report.proto"], - visibility = [ - "//visibility:public", - ], -) - -api_go_proto_library( - name = "orca_load_report", - proto = ":orca_load_report", -) diff --git a/udpa/data/orca/v1/orca_load_report.proto b/udpa/data/orca/v1/orca_load_report.proto deleted file mode 100644 index 5c2eda6c..00000000 --- a/udpa/data/orca/v1/orca_load_report.proto +++ /dev/null @@ -1,36 +0,0 @@ -syntax = "proto3"; - -package udpa.data.orca.v1; - -option java_outer_classname = "OrcaLoadReportProto"; -option java_multiple_files = true; -option java_package = "io.envoyproxy.udpa.data.orca.v1"; -option go_package = "v1"; - -import "validate/validate.proto"; - -// See section `ORCA load report format` of the design document in -// :ref:`https://github.com/envoyproxy/envoy/issues/6614`. - -message OrcaLoadReport { - // CPU utilization expressed as a fraction of available CPU resources. This - // should be derived from the latest sample or measurement. - double cpu_utilization = 1 [(validate.rules).double.gte = 0, (validate.rules).double.lte = 1]; - - // Memory utilization expressed as a fraction of available memory - // resources. This should be derived from the latest sample or measurement. - double mem_utilization = 2 [(validate.rules).double.gte = 0, (validate.rules).double.lte = 1]; - - // Total RPS being served by an endpoint. This should cover all services that an endpoint is - // responsible for. - uint64 rps = 3; - - // Application specific requests costs. Each value is an absolute cost (e.g. 3487 bytes of - // storage) associated with the request. - map request_cost = 4; - - // Resource utilization values. Each value is expressed as a fraction of total resources - // available, derived from the latest sample or measurement. - map utilization = 5 - [(validate.rules).map.values.double.gte = 0, (validate.rules).map.values.double.lte = 1]; -} diff --git a/udpa/service/orca/v1/BUILD b/udpa/service/orca/v1/BUILD deleted file mode 100644 index 72543e80..00000000 --- a/udpa/service/orca/v1/BUILD +++ /dev/null @@ -1,20 +0,0 @@ -load("@envoy_api//bazel:api_build_system.bzl", "api_go_grpc_library", "api_proto_library_internal") - -licenses(["notice"]) # Apache 2 - -api_proto_library_internal( - name = "orca", - srcs = ["orca.proto"], - has_services = 1, - deps = [ - "//udpa/data/orca/v1:orca_load_report", - ], -) - -api_go_grpc_library( - name = "orca", - proto = ":orca", - deps = [ - "//udpa/data/orca/v1:orca_load_report_go_proto", - ], -) diff --git a/udpa/service/orca/v1/orca.proto b/udpa/service/orca/v1/orca.proto deleted file mode 100644 index 87871d20..00000000 --- a/udpa/service/orca/v1/orca.proto +++ /dev/null @@ -1,38 +0,0 @@ -syntax = "proto3"; - -package udpa.service.orca.v1; - -option java_outer_classname = "OrcaProto"; -option java_multiple_files = true; -option java_package = "io.envoyproxy.udpa.service.orca.v1"; -option go_package = "v1"; - -import "udpa/data/orca/v1/orca_load_report.proto"; - -import "google/protobuf/duration.proto"; - -import "validate/validate.proto"; - -// See section `Out-of-band (OOB) reporting` of the design document in -// :ref:`https://github.com/envoyproxy/envoy/issues/6614`. - -// Out-of-band (OOB) load reporting service for the additional load reporting -// agent that does not sit in the request path. Reports are periodically sampled -// with sufficient frequency to provide temporal association with requests. -// OOB reporting compensates the limitation of in-band reporting in revealing -// costs for backends that do not provide a steady stream of telemetry such as -// long running stream operations and zero QPS services. This is a server -// streaming service, client needs to terminate current RPC and initiate -// a new call to change backend reporting frequency. -service OpenRcaService { - rpc StreamCoreMetrics(OrcaLoadReportRequest) returns (stream udpa.data.orca.v1.OrcaLoadReport); -} - -message OrcaLoadReportRequest { - // Interval for generating Open RCA core metric responses. - google.protobuf.Duration report_interval = 1; - // Request costs to collect. If this is empty, all known requests costs tracked by - // the load reporting agent will be returned. This provides an opportunity for - // the client to selectively obtain a subset of tracked costs. - repeated string request_cost_names = 2; -}