1# Copyright 2022 Google LLC 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# Aggregation Protocol Package 16 17load("@org_tensorflow//tensorflow/core/platform:build_config.bzl", "tf_proto_library") 18load("//fcp:config.bzl", "FCP_COPTS") 19load("@com_github_grpc_grpc//bazel:python_rules.bzl", "py_proto_library") 20 21package( 22 default_visibility = ["//fcp/aggregation:internal"], 23 licenses = ["notice"], # Apache 2.0 24) 25 26proto_library( 27 name = "proto", 28 srcs = ["aggregation_protocol_messages.proto"], 29 deps = [ 30 "//fcp/secagg/shared:proto", 31 ], 32) 33 34cc_proto_library( 35 name = "cc_proto", 36 deps = [ 37 ":proto", 38 ], 39) 40 41py_proto_library( 42 name = "py_pb2", 43 deps = [ 44 ":proto", 45 ], 46) 47 48# Using tf_proto_library to get dependencies to TF protos built correctly. 49tf_proto_library( 50 name = "configuration_proto", 51 srcs = ["configuration.proto"], 52 protodeps = [ 53 "@org_tensorflow//tensorflow/core:protos_all", 54 ], 55) 56 57# Allowing to refer to the cc library generated by the rule above in usual way: 58alias( 59 name = "configuration_cc_proto", 60 actual = "configuration_proto_cc", 61) 62 63alias( 64 name = "configuration_py_pb2", 65 actual = "configuration_proto_py", 66) 67 68cc_library( 69 name = "aggregation_protocol", 70 hdrs = [ 71 "aggregation_protocol.h", 72 ], 73 copts = FCP_COPTS, 74 deps = [ 75 ":cc_proto", 76 "@com_google_absl//absl/status", 77 "@com_google_absl//absl/strings:cord", 78 ], 79) 80 81cc_library( 82 name = "resource_resolver", 83 hdrs = [ 84 "resource_resolver.h", 85 ], 86 copts = FCP_COPTS, 87 deps = [ 88 "@com_google_absl//absl/status:statusor", 89 "@com_google_absl//absl/strings:cord", 90 ], 91) 92 93cc_library( 94 name = "checkpoint_builder", 95 hdrs = [ 96 "checkpoint_builder.h", 97 ], 98 copts = FCP_COPTS, 99 deps = [ 100 "//fcp/aggregation/core:tensor", 101 "@com_google_absl//absl/status", 102 "@com_google_absl//absl/status:statusor", 103 "@com_google_absl//absl/strings:cord", 104 ], 105) 106 107cc_library( 108 name = "checkpoint_parser", 109 hdrs = [ 110 "checkpoint_parser.h", 111 ], 112 copts = FCP_COPTS, 113 deps = [ 114 "//fcp/aggregation/core:tensor", 115 "@com_google_absl//absl/status:statusor", 116 "@com_google_absl//absl/strings:cord", 117 ], 118) 119